Resolves: tdf#149482 don't insert if the mouse is not still pressed
In repeat callback, if we didn't see a mouse up, but find that the mouse
is no longer pressed at this point, then bail
Change-Id: I6e5d1d7201065fadcc2242fd52323ffb56766383
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146921
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
diff --git a/svtools/source/control/tabbar.cxx b/svtools/source/control/tabbar.cxx
index 7daba17..3e4e2d9 100644
--- a/svtools/source/control/tabbar.cxx
+++ b/svtools/source/control/tabbar.cxx
@@ -881,6 +881,15 @@ void TabBar::ImplShowPage( sal_uInt16 nPos )
IMPL_LINK( TabBar, ImplClickHdl, weld::Button&, rBtn, void )
{
if ((GetPointerState().mnState & (MOUSE_LEFT | MOUSE_MIDDLE | MOUSE_RIGHT)) == 0)
{
// like tdf#149482 if we didn't see a mouse up, but find that the mouse is no
// longer pressed at this point, then bail
mpImpl->mxButtonBox->m_xPrevRepeater->Stop();
mpImpl->mxButtonBox->m_xNextRepeater->Stop();
return;
}
EndEditMode();
sal_uInt16 nNewPos = mnFirstPos;
@@ -919,6 +928,14 @@ IMPL_LINK( TabBar, ImplClickHdl, weld::Button&, rBtn, void )
IMPL_LINK_NOARG(TabBar, ImplAddClickHandler, weld::Button&, void)
{
if ((GetPointerState().mnState & (MOUSE_LEFT | MOUSE_MIDDLE | MOUSE_RIGHT)) == 0)
{
// tdf#149482 if we didn't see a mouse up, but find that the mouse is no
// longer pressed at this point, then bail
mpImpl->mxButtonBox->m_xAddRepeater->Stop();
return;
}
EndEditMode();
AddTabClick();
}