diff --git a/svx/source/stbctrls/xmlsecctrl.cxx b/svx/source/stbctrls/xmlsecctrl.cxx index bd351e4be3c4..20c6e7d50ed4 100644 --- a/svx/source/stbctrls/xmlsecctrl.cxx +++ b/svx/source/stbctrls/xmlsecctrl.cxx @@ -18,12 +18,12 @@ */ -#include -#include -#include -#include #include +#include #include +#include +#include +#include #include #include @@ -101,9 +101,11 @@ void XmlSecStatusBarControl::Command( const CommandEvent& rCEvt ) { if( rCEvt.GetCommand() == CommandEventId::ContextMenu ) { - VclBuilder aBuilder(nullptr, AllSettings::GetUIRootDir(), "svx/ui/xmlsecstatmenu.ui", ""); - VclPtr aPopupMenu(aBuilder.get_menu("menu")); - if (aPopupMenu->Execute(&GetStatusBar(), rCEvt.GetMousePosPixel())) + tools::Rectangle aRect(rCEvt.GetMousePosPixel(), Size(1, 1)); + weld::Window* pPopupParent = weld::GetPopupParent(GetStatusBar(), aRect); + std::unique_ptr xBuilder(Application::CreateBuilder(pPopupParent, "svx/ui/xmlsecstatmenu.ui")); + std::unique_ptr xPopMenu(xBuilder->weld_menu("menu")); + if (!xPopMenu->popup_at_rect(pPopupParent, aRect).isEmpty()) { css::uno::Any a; SfxUInt16Item aState( GetSlotId(), 0 );