diff options
author | Caolán McNamara <caolanm@redhat.com> | 2023-02-13 20:17:51 +0000 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2023-02-15 13:23:48 +0100 |
commit | f63a46ca670b2cfa9a39c34413c684bca1ed81ad (patch) | |
tree | 8c1682f3687becb022c62e9fd66a9bf47be6ee1a /svtools | |
parent | dfe717f56ab8d4dacb75470851449b615db7fe26 (diff) |
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>
Diffstat (limited to 'svtools')
-rw-r--r-- | svtools/source/control/tabbar.cxx | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/svtools/source/control/tabbar.cxx b/svtools/source/control/tabbar.cxx index 7daba1791d3e..3e4e2d94cedb 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(); } |