diff options
-rw-r--r-- | editeng/source/editeng/editview.cxx | 4 | ||||
-rw-r--r-- | editeng/uiconfig/ui/spellmenu.ui | 2 | ||||
-rw-r--r-- | include/vcl/menu.hxx | 8 | ||||
-rw-r--r-- | vcl/source/window/menu.cxx | 12 |
4 files changed, 9 insertions, 17 deletions
diff --git a/editeng/source/editeng/editview.cxx b/editeng/source/editeng/editview.cxx index d7642736cf27..2212b526a572 100644 --- a/editeng/source/editeng/editview.cxx +++ b/editeng/source/editeng/editview.cxx @@ -920,7 +920,7 @@ void EditView::ExecuteSpellPopup( const Point& rPosPixel, Link<SpellCallbackInfo return; VclBuilder aBuilder(nullptr, AllSettings::GetUIRootDir(), "editeng/ui/spellmenu.ui", ""); - VclPtr<PopupMenu> aPopupMenu(aBuilder.get_menu("menu")); + VclPtr<PopupMenu> aPopupMenu(aBuilder.get_menu("editviewspellmenu")); const sal_uInt16 nAutoCorrId = aPopupMenu->GetItemId("autocorrect"); PopupMenu *pAutoMenu = aPopupMenu->GetPopupMenu(nAutoCorrId); const sal_uInt16 nInsertId = aPopupMenu->GetItemId("insert"); @@ -1104,8 +1104,6 @@ void EditView::ExecuteSpellPopup( const Point& rPosPixel, Link<SpellCallbackInfo LOKSendSpellPopupMenu(aPopupMenu, nGuessLangWord, nGuessLangPara, nWords); return; } - else // For desktop and tablets, we use the tunneled dialog - aPopupMenu->SetLOKNotifier(pViewShell); } sal_uInt16 nId = aPopupMenu->Execute(pImpEditView->GetWindow(), aTempRect, PopupMenuFlags::NoMouseUpClose); diff --git a/editeng/uiconfig/ui/spellmenu.ui b/editeng/uiconfig/ui/spellmenu.ui index 6b6e2cb05b78..ea3bd9486fd0 100644 --- a/editeng/uiconfig/ui/spellmenu.ui +++ b/editeng/uiconfig/ui/spellmenu.ui @@ -2,7 +2,7 @@ <!-- Generated with glade 3.38.1 --> <interface domain="editeng"> <requires lib="gtk+" version="3.20"/> - <object class="GtkMenu" id="menu"> + <object class="GtkMenu" id="editviewspellmenu"> <property name="visible">True</property> <property name="can_focus">False</property> <child> diff --git a/include/vcl/menu.hxx b/include/vcl/menu.hxx index 935fc68eac11..4feef6025ddb 100644 --- a/include/vcl/menu.hxx +++ b/include/vcl/menu.hxx @@ -500,8 +500,6 @@ class VCL_DLLPUBLIC PopupMenu : public Menu friend struct MenuItemData; private: - const vcl::ILibreOfficeKitNotifier* mpLOKNotifier; ///< To emit the LOK callbacks eg. for dialog tunneling. - SAL_DLLPRIVATE MenuFloatingWindow * ImplGetFloatingWindow() const; protected: @@ -538,12 +536,6 @@ public: static bool IsInExecute(); static PopupMenu* GetActivePopupMenu(); - /// Interface to register for dialog / window tunneling. - void SetLOKNotifier(const vcl::ILibreOfficeKitNotifier* pNotifier) - { - mpLOKNotifier = pNotifier; - } - PopupMenu& operator=( const PopupMenu& rMenu ); }; diff --git a/vcl/source/window/menu.cxx b/vcl/source/window/menu.cxx index 5fa5e99e034a..f14056057aa5 100644 --- a/vcl/source/window/menu.cxx +++ b/vcl/source/window/menu.cxx @@ -2714,14 +2714,12 @@ MenuFloatingWindow * PopupMenu::ImplGetFloatingWindow() const { } PopupMenu::PopupMenu() - : mpLOKNotifier(nullptr) { mpSalMenu = ImplGetSVData()->mpDefInst->CreateMenu(false, this); } PopupMenu::PopupMenu( const PopupMenu& rMenu ) - : Menu(), - mpLOKNotifier(nullptr) + : Menu() { mpSalMenu = ImplGetSVData()->mpDefInst->CreateMenu(false, this); *this = rMenu; @@ -2922,8 +2920,12 @@ sal_uInt16 PopupMenu::ImplExecute( const VclPtr<vcl::Window>& pW, const tools::R } VclPtrInstance<MenuFloatingWindow> pWin( this, pW, WB_BORDER | WB_SYSTEMWINDOW ); - if (comphelper::LibreOfficeKit::isActive() && mpLOKNotifier) - pWin->SetLOKNotifier(mpLOKNotifier); + if (comphelper::LibreOfficeKit::isActive() && get_id() == "editviewspellmenu") + { + VclPtr<vcl::Window> xNotifierParent = pW->GetParentWithLOKNotifier(); + assert(xNotifierParent && xNotifierParent->GetLOKNotifier() && "editview menu without LOKNotifier"); + pWin->SetLOKNotifier(xNotifierParent->GetLOKNotifier()); + } if( pSVData->maNWFData.mbFlatMenu ) pWin->SetBorderStyle( WindowBorderStyle::NOBORDER ); |