From d97a819abe84fe667f8b136b1c2adaec5ca7196e Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Fri, 4 Dec 2020 15:18:38 +0000 Subject: add a way to get an awt::XPopupMenu from a PopupMenu MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Ia1cde3b60b71ed9e4d0b7dc8d9ad0b2899d60b98 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107229 Tested-by: Jenkins Reviewed-by: Caolán McNamara --- toolkit/inc/helper/unowrapper.hxx | 3 +++ toolkit/source/helper/unowrapper.cxx | 6 ++++++ 2 files changed, 9 insertions(+) (limited to 'toolkit') diff --git a/toolkit/inc/helper/unowrapper.hxx b/toolkit/inc/helper/unowrapper.hxx index cfb890584c61..6e10e870506d 100644 --- a/toolkit/inc/helper/unowrapper.hxx +++ b/toolkit/inc/helper/unowrapper.hxx @@ -55,6 +55,9 @@ public: virtual void SetWindowInterface( vcl::Window* pWindow, css::uno::Reference< css::awt::XWindowPeer> xIFace ) override; virtual VclPtr GetWindow(const css::uno::Reference& rxWindow) override; + // Menu + virtual css::uno::Reference CreateMenuInterface( PopupMenu* pPopupMenu ) override; + void WindowDestroyed( vcl::Window* pWindow ) override; // Accessibility diff --git a/toolkit/source/helper/unowrapper.cxx b/toolkit/source/helper/unowrapper.cxx index eb37d4137419..edac7fe62b34 100644 --- a/toolkit/source/helper/unowrapper.cxx +++ b/toolkit/source/helper/unowrapper.cxx @@ -21,6 +21,7 @@ #include #include #include +#include #include #include @@ -179,6 +180,11 @@ void UnoWrapper::SetWindowInterface( vcl::Window* pWindow, css::uno::Reference< pWindow->SetWindowPeer( xIFace, pVCLXWindow ); } +css::uno::Reference UnoWrapper::CreateMenuInterface( PopupMenu* pPopupMenu ) +{ + return new VCLXPopupMenu(pPopupMenu); +} + css::uno::Reference< css::awt::XGraphics> UnoWrapper::CreateGraphics( OutputDevice* pOutDev ) { css::uno::Reference< css::awt::XGraphics> xGrf; -- cgit