diff options
author | Caolán McNamara <caolanm@redhat.com> | 2020-12-04 15:18:38 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2020-12-04 17:48:20 +0100 |
commit | d97a819abe84fe667f8b136b1c2adaec5ca7196e (patch) | |
tree | 385c14608eb25c8a817f3aba02991ed1e159fd56 /svtools | |
parent | d087459826212867e72a0031d3b2e91941140f60 (diff) |
add a way to get an awt::XPopupMenu from a PopupMenu
Change-Id: Ia1cde3b60b71ed9e4d0b7dc8d9ad0b2899d60b98
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107229
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'svtools')
-rw-r--r-- | svtools/source/control/managedmenubutton.cxx | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/svtools/source/control/managedmenubutton.cxx b/svtools/source/control/managedmenubutton.cxx index 45e9d98ca1a8..4db9d2a1858b 100644 --- a/svtools/source/control/managedmenubutton.cxx +++ b/svtools/source/control/managedmenubutton.cxx @@ -9,11 +9,11 @@ #include <comphelper/processfactory.hxx> #include <comphelper/propertyvalue.hxx> -#include <toolkit/awt/vclxmenu.hxx> #include <vcl/builderfactory.hxx> #include <vcl/menu.hxx> #include <vcl/menubtn.hxx> +#include <com/sun/star/awt/XPopupMenu.hpp> #include <com/sun/star/frame/theDesktop.hpp> #include <com/sun/star/frame/ModuleManager.hpp> #include <com/sun/star/frame/thePopupMenuControllerFactory.hpp> @@ -31,7 +31,7 @@ public: void dispose() override; private: - rtl::Reference<VCLXPopupMenu> m_xPopupMenu; + css::uno::Reference<css::awt::XPopupMenu> m_xPopupMenu; css::uno::Reference<css::frame::XPopupMenuController> m_xPopupController; }; @@ -71,7 +71,7 @@ void ManagedMenuButton::Activate() } if (!m_xPopupMenu.is()) - m_xPopupMenu.set(new VCLXPopupMenu(GetPopupMenu())); + m_xPopupMenu = GetPopupMenu()->CreateMenuInterface(); // FIXME: get the frame from the parent VclBuilder. css::uno::Reference<css::uno::XComponentContext> xContext(comphelper::getProcessComponentContext()); @@ -112,7 +112,7 @@ void ManagedMenuButton::Activate() "com.sun.star.comp.framework.ResourceMenuController", aArgs, xContext), css::uno::UNO_QUERY); if (m_xPopupController.is()) - m_xPopupController->setPopupMenu(m_xPopupMenu.get()); + m_xPopupController->setPopupMenu(m_xPopupMenu); } } |