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 aPopupMenu(aBuilder.get_menu("menu")); + VclPtr 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, LinkSetLOKNotifier(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 @@ - + True False 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& pW, const tools::R } VclPtrInstance pWin( this, pW, WB_BORDER | WB_SYSTEMWINDOW ); - if (comphelper::LibreOfficeKit::isActive() && mpLOKNotifier) - pWin->SetLOKNotifier(mpLOKNotifier); + if (comphelper::LibreOfficeKit::isActive() && get_id() == "editviewspellmenu") + { + VclPtr xNotifierParent = pW->GetParentWithLOKNotifier(); + assert(xNotifierParent && xNotifierParent->GetLOKNotifier() && "editview menu without LOKNotifier"); + pWin->SetLOKNotifier(xNotifierParent->GetLOKNotifier()); + } if( pSVData->maNWFData.mbFlatMenu ) pWin->SetBorderStyle( WindowBorderStyle::NOBORDER );