From 7a6c6712698efc4cdf4b941db565634aae73279c Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Tue, 23 Feb 2021 20:23:41 +0000 Subject: use XPopupMenu::execute to run the menu MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit instead of cheating and pulling the vcl::Menu out of it Change-Id: I498f4577c1e677e860ccb3bf394adbca298f074a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111435 Tested-by: Jenkins Reviewed-by: Caolán McNamara --- sfx2/source/notebookbar/NotebookbarTabControl.cxx | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/sfx2/source/notebookbar/NotebookbarTabControl.cxx b/sfx2/source/notebookbar/NotebookbarTabControl.cxx index dd2e1fba5129..485b7f8da3a6 100644 --- a/sfx2/source/notebookbar/NotebookbarTabControl.cxx +++ b/sfx2/source/notebookbar/NotebookbarTabControl.cxx @@ -19,7 +19,6 @@ #include #include -#include #include #include #include @@ -30,7 +29,7 @@ #include #include #include -#include +#include #include #include #include @@ -348,10 +347,10 @@ IMPL_LINK(NotebookbarTabControl, OpenNotebookbarPopupMenu, NotebookBar*, pNotebo return; xPopupController->setPopupMenu(xPopupMenu); - VCLXMenu* pAwtMenu = comphelper::getUnoTunnelImplementation(xPopupMenu); - PopupMenu* pVCLMenu = static_cast(pAwtMenu->GetMenu()); Point aPos(pNotebookbar->GetSizePixel().getWidth(), NotebookbarTabControl::GetHeaderHeight() - ICON_SIZE + 10); - pVCLMenu->Execute(pNotebookbar, tools::Rectangle(aPos, aPos),PopupMenuFlags::ExecuteDown|PopupMenuFlags::NoMouseUpClose); + xPopupMenu->execute(pNotebookbar->GetComponentInterface(), + css::awt::Rectangle(aPos.X(), aPos.Y(), 1, 1), + css::awt::PopupMenuDirection::EXECUTE_DOWN); Reference xComponent(xPopupController, UNO_QUERY); if (xComponent.is()) -- cgit