diff options
author | Caolán McNamara <caolanm@redhat.com> | 2021-12-11 21:09:39 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2021-12-12 13:35:00 +0100 |
commit | afa35742a4633db31b6d6c72cf45741506e9edfb (patch) | |
tree | 10fb0b0116ddf6fcc2ee34c9baa39b1ec0103a83 /sfx2 | |
parent | 569de88e9c7eda964252518282d26a8f7d059718 (diff) |
prefer more css::awt::XPopupMenu api
Change-Id: Ib008281d63071ea79935af83cbe434be66155455
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126692
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/view/viewsh.cxx | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/sfx2/source/view/viewsh.cxx b/sfx2/source/view/viewsh.cxx index 03cd1fe842d0..8fdf33487a56 100644 --- a/sfx2/source/view/viewsh.cxx +++ b/sfx2/source/view/viewsh.cxx @@ -25,7 +25,6 @@ #include <svl/eitem.hxx> #include <svl/whiter.hxx> #include <toolkit/awt/vclxmenu.hxx> -#include <vcl/menu.hxx> #include <vcl/svapp.hxx> #include <vcl/toolbox.hxx> #include <vcl/weld.hxx> @@ -1850,7 +1849,8 @@ void SfxViewShell::RemoveContextMenuInterceptor_Impl( const uno::Reference< ui:: pImpl->aInterceptorContainer.removeInterface( xInterceptor ); } -bool SfxViewShell::TryContextMenuInterception(const Menu& rIn, const OUString& rMenuIdentifier, +bool SfxViewShell::TryContextMenuInterception(const css::uno::Reference<css::awt::XPopupMenu>& rIn, + const OUString& rMenuIdentifier, css::uno::Reference<css::awt::XPopupMenu>& rOut, ui::ContextMenuExecuteEvent aEvent) { @@ -1859,7 +1859,7 @@ bool SfxViewShell::TryContextMenuInterception(const Menu& rIn, const OUString& r // create container from menu aEvent.ActionTriggerContainer = ::framework::ActionTriggerHelper::CreateActionTriggerContainerFromMenu( - &rIn, &rMenuIdentifier ); + rIn, &rMenuIdentifier); // get selection from controller aEvent.Selection.set( GetController(), uno::UNO_QUERY ); @@ -1920,15 +1920,11 @@ bool SfxViewShell::TryContextMenuInterception(const Menu& rIn, const OUString& r bool SfxViewShell::TryContextMenuInterception(const css::uno::Reference<css::awt::XPopupMenu>& rPopupMenu, const OUString& rMenuIdentifier, css::ui::ContextMenuExecuteEvent aEvent) { - VCLXMenu* pAwtMenu = comphelper::getFromUnoTunnel<VCLXMenu>(rPopupMenu); - PopupMenu* pVCLMenu = static_cast<PopupMenu*>(pAwtMenu->GetMenu()); - if (!pVCLMenu) - return false; - bool bModified = false; // create container from menu - aEvent.ActionTriggerContainer = ::framework::ActionTriggerHelper::CreateActionTriggerContainerFromMenu(pVCLMenu, &rMenuIdentifier); + aEvent.ActionTriggerContainer = ::framework::ActionTriggerHelper::CreateActionTriggerContainerFromMenu( + rPopupMenu, &rMenuIdentifier); // get selection from controller aEvent.Selection = css::uno::Reference< css::view::XSelectionSupplier >( GetController(), css::uno::UNO_QUERY ); |