diff options
author | Caolán McNamara <caolanm@redhat.com> | 2020-12-19 21:02:39 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2020-12-20 17:19:05 +0100 |
commit | c75bc340346cd75c03cd87da66c46bf0c8482df8 (patch) | |
tree | 4a7a4939391d5510a21c6df4d93d8d79092539b0 /svx | |
parent | e37e990650694d7d3a44a38a6bf23751bb33da67 (diff) |
weld xmlsecstatmenu
Change-Id: Ic3e2df5b11b5f7ff8938913472ac60aecc0e2c2b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108034
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'svx')
-rw-r--r-- | svx/source/stbctrls/xmlsecctrl.cxx | 16 |
1 files changed, 9 insertions, 7 deletions
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 <vcl/status.hxx> -#include <vcl/builder.hxx> -#include <vcl/menu.hxx> -#include <vcl/image.hxx> #include <vcl/commandevent.hxx> +#include <vcl/image.hxx> #include <vcl/event.hxx> +#include <vcl/status.hxx> +#include <vcl/svapp.hxx> +#include <vcl/weldutils.hxx> #include <sfx2/signaturestate.hxx> #include <sfx2/module.hxx> @@ -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<PopupMenu> 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<weld::Builder> xBuilder(Application::CreateBuilder(pPopupParent, "svx/ui/xmlsecstatmenu.ui")); + std::unique_ptr<weld::Menu> xPopMenu(xBuilder->weld_menu("menu")); + if (!xPopMenu->popup_at_rect(pPopupParent, aRect).isEmpty()) { css::uno::Any a; SfxUInt16Item aState( GetSlotId(), 0 ); |