sw/source/uibase/docvw/edtwin.cxx    |    3 ++-
 sw/source/uibase/uiview/viewling.cxx |    3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

New commits:
commit 7e4ddea574b18aeed678526cac42f45613b4ae20
Author:     Caolán McNamara <caol...@redhat.com>
AuthorDate: Thu Jan 6 20:10:40 2022 +0000
Commit:     Caolán McNamara <caol...@redhat.com>
CommitDate: Fri Jan 7 09:54:35 2022 +0100

    Resolves: tdf#146342 spelling menu doesn't appear
    
    the XPopupMenu from CreateMenuInterface owns the vcl menu after it's
    created.
    
    Change-Id: I0959b3359a4683ce8ca50912136f829b8bbee859
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128063
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caol...@redhat.com>

diff --git a/sw/source/uibase/docvw/edtwin.cxx 
b/sw/source/uibase/docvw/edtwin.cxx
index 32c85845a26d..5b765f4f7816 100644
--- a/sw/source/uibase/docvw/edtwin.cxx
+++ b/sw/source/uibase/docvw/edtwin.cxx
@@ -5405,7 +5405,8 @@ void SwEditWin::Command( const CommandEvent& rCEvt )
                         aEvent.ExecutePosition.X = aPixPos.X();
                         aEvent.ExecutePosition.Y = aPixPos.Y();
                         css::uno::Reference<css::awt::XPopupMenu> xMenu;
-                        if 
(GetView().TryContextMenuInterception(aROPopup.CreateMenuInterface(), 
"private:resource/ReadonlyContextMenu", xMenu, aEvent))
+                        auto xMenuInterface = aROPopup.CreateMenuInterface();
+                        if 
(GetView().TryContextMenuInterception(xMenuInterface, 
"private:resource/ReadonlyContextMenu", xMenu, aEvent))
                         {
                             if (xMenu.is())
                             {
diff --git a/sw/source/uibase/uiview/viewling.cxx 
b/sw/source/uibase/uiview/viewling.cxx
index adb16218ef45..2c349138f765 100644
--- a/sw/source/uibase/uiview/viewling.cxx
+++ b/sw/source/uibase/uiview/viewling.cxx
@@ -713,7 +713,8 @@ bool SwView::ExecSpellPopup(const Point& rPt)
 
                 OUString sMenuName = bUseGrammarContext ?
                     OUString("private:resource/GrammarContextMenu") : 
OUString("private:resource/SpellContextMenu");
-                if (TryContextMenuInterception(xPopup->CreateMenuInterface(), 
sMenuName, xMenu, aEvent))
+                auto xMenuInterface = xPopup->CreateMenuInterface();
+                if (TryContextMenuInterception(xMenuInterface, sMenuName, 
xMenu, aEvent))
                 {
                     //! happy hacking for context menu modifying extensions of 
this
                     //! 'custom made' menu... *sigh* (code copied from sfx2 
and framework)

Reply via email to