summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2021-12-11 20:25:28 +0000
committerCaolán McNamara <caolanm@redhat.com>2021-12-12 13:33:27 +0100
commit569de88e9c7eda964252518282d26a8f7d059718 (patch)
treee8a8988ea61bbd3b398ed63e517145e9a1088012 /sfx2
parent73e9e027e9978cf5136731118f18b832bd361181 (diff)
prefer css::awt::XPopupMenu api
and using GetXGraphic will return a vcl unographic::XGraphic which also supports XBitmap as well as XGraphic so we can check if the XBitmap we're passing around supports XGraphic and use that if it does and drop the imagewrapper in favor of doing that Change-Id: I3bd7963b53c3f715fca4b5cfb2ddad650ca92e1d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126691 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/source/view/viewsh.cxx10
1 files changed, 2 insertions, 8 deletions
diff --git a/sfx2/source/view/viewsh.cxx b/sfx2/source/view/viewsh.cxx
index 860310b73667..03cd1fe842d0 100644
--- a/sfx2/source/view/viewsh.cxx
+++ b/sfx2/source/view/viewsh.cxx
@@ -1911,13 +1911,7 @@ bool SfxViewShell::TryContextMenuInterception(const Menu& rIn, const OUString& r
// container was modified, create a new menu out of it
css::uno::Reference<uno::XComponentContext> xContext(::comphelper::getProcessComponentContext(), css::uno::UNO_SET_THROW);
rOut.set(xContext->getServiceManager()->createInstanceWithContext("com.sun.star.awt.PopupMenu", xContext), css::uno::UNO_QUERY_THROW);
-
- VCLXMenu* pAwtMenu = comphelper::getFromUnoTunnel<VCLXMenu>(rOut);
- assert(pAwtMenu);
- PopupMenu* pVCLMenu = static_cast<PopupMenu*>(pAwtMenu->GetMenu());
- assert(pVCLMenu);
-
- ::framework::ActionTriggerHelper::CreateMenuFromActionTriggerContainer(pVCLMenu, aEvent.ActionTriggerContainer);
+ ::framework::ActionTriggerHelper::CreateMenuFromActionTriggerContainer(rOut, aEvent.ActionTriggerContainer);
}
return true;
@@ -1984,7 +1978,7 @@ bool SfxViewShell::TryContextMenuInterception(const css::uno::Reference<css::awt
if ( bModified )
{
rPopupMenu->clear();
- ::framework::ActionTriggerHelper::CreateMenuFromActionTriggerContainer(pVCLMenu, aEvent.ActionTriggerContainer);
+ ::framework::ActionTriggerHelper::CreateMenuFromActionTriggerContainer(rPopupMenu, aEvent.ActionTriggerContainer);
}
return true;