diff options
author | Caolán McNamara <caolanm@redhat.com> | 2023-05-04 09:53:37 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2023-05-04 21:22:14 +0200 |
commit | a831886004fba93a4eb0e5675b1e3e8afbe3d3bb (patch) | |
tree | 9fa310622639d7fea6260ca181878691eaccfdec /svx | |
parent | 2f9c6fbfd4c96d53357bf63c1903087ad10707b0 (diff) |
Resolves: tdf#155140 gallery right click for context menu doesn't consume event
Change-Id: I13b6d62561e3d9eed47f81c4268a6a32ff108b40
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151355
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'svx')
-rw-r--r-- | svx/inc/galbrws2.hxx | 2 | ||||
-rw-r--r-- | svx/source/gallery2/galbrws2.cxx | 7 | ||||
-rw-r--r-- | svx/source/gallery2/galctrl.cxx | 4 |
3 files changed, 7 insertions, 6 deletions
diff --git a/svx/inc/galbrws2.hxx b/svx/inc/galbrws2.hxx index 9cfb5c7148d1..d5ca8a50a041 100644 --- a/svx/inc/galbrws2.hxx +++ b/svx/inc/galbrws2.hxx @@ -143,7 +143,7 @@ public: sal_Int8 ExecuteDrop( const ExecuteDropEvent& rEvt ); bool StartDrag(); void TogglePreview(); - void ShowContextMenu(const CommandEvent& rCEvt); + bool ShowContextMenu(const CommandEvent& rCEvt); bool KeyInput(const KeyEvent& rEvt); bool ViewBoxHasFocus() const; diff --git a/svx/source/gallery2/galbrws2.cxx b/svx/source/gallery2/galbrws2.cxx index 52c05515237d..8285419d1809 100644 --- a/svx/source/gallery2/galbrws2.cxx +++ b/svx/source/gallery2/galbrws2.cxx @@ -486,20 +486,20 @@ void GalleryBrowser2::TogglePreview() GetViewWindow()->grab_focus(); } -void GalleryBrowser2::ShowContextMenu(const CommandEvent& rCEvt) +bool GalleryBrowser2::ShowContextMenu(const CommandEvent& rCEvt) { Point aMousePos = rCEvt.GetMousePosPixel(); Point aSelPos; const sal_uInt32 nItemId = ImplGetSelectedItemId( rCEvt.IsMouseEvent() ? &aMousePos : nullptr, aSelPos ); if( !(mpCurTheme && nItemId && ( nItemId <= mpCurTheme->GetObjectCount() )) ) - return; + return false; ImplSelectItemId( nItemId ); css::uno::Reference< css::frame::XFrame > xFrame( GetFrame() ); if ( !xFrame.is() ) - return; + return false; weld::Widget* pParent = GetViewWindow(); mnCurActionPos = nItemId - 1; @@ -511,6 +511,7 @@ void GalleryBrowser2::ShowContextMenu(const CommandEvent& rCEvt) GALLERYBROWSERMODE_PREVIEW == GetMode(), this ) ); xPopup->ExecutePopup(pParent, aSelPos); + return true; } bool GalleryBrowser2::ViewBoxHasFocus() const diff --git a/svx/source/gallery2/galctrl.cxx b/svx/source/gallery2/galctrl.cxx index ae9de1ce77b8..716a198ec87f 100644 --- a/svx/source/gallery2/galctrl.cxx +++ b/svx/source/gallery2/galctrl.cxx @@ -384,9 +384,9 @@ bool GalleryIconView::Command(const CommandEvent& rCEvt) { bool bRet = ValueSet::Command(rCEvt); - if (rCEvt.GetCommand() == CommandEventId::ContextMenu) + if (!bRet && rCEvt.GetCommand() == CommandEventId::ContextMenu) { - mpParent->ShowContextMenu(rCEvt); + bRet = mpParent->ShowContextMenu(rCEvt); } return bRet; |