From c9763a9f160bd0e91a19cfb681556f49a28cbac5 Mon Sep 17 00:00:00 2001 From: Pranam Lashkari Date: Thu, 21 Nov 2024 20:11:18 +0530 Subject: [PATCH] LOK: don't recreate the dialogs of an old view when loading new views MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit follow up for f5ebf512ccd3d5ae3af5fe706b411a85fa19182d now same actions are performed on all the dialogs Change-Id: I6531a766327dda106770a2c513ebd492dea7c655 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176933 Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara Tested-by: Jenkins CollaboraOffice (cherry picked from commit 2fba6df7242586870988b62909156538b42c2bc0) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177892 Tested-by: Jenkins --- include/sfx2/childwin.hxx | 3 +++ sc/source/ui/app/scdll.cxx | 4 +--- sc/source/ui/view/tabvwshc.cxx | 2 +- sd/source/ui/app/sddll.cxx | 4 +--- sw/source/uibase/app/swmodule.cxx | 4 +--- test/source/lokcallback.cxx | 1 + 6 files changed, 8 insertions(+), 10 deletions(-) diff --git a/include/sfx2/childwin.hxx b/include/sfx2/childwin.hxx index ff12fe30b3d0..216b101923d4 100644 --- a/include/sfx2/childwin.hxx +++ b/include/sfx2/childwin.hxx @@ -29,6 +29,7 @@ #include #include +#include namespace com::sun::star::frame { class XFrame; } @@ -184,6 +185,8 @@ const int nCloseResponseToJustHide = -42; { \ SfxChildWinFactory aFact( \ Class::CreateImpl, MyID, Pos ); \ + if (comphelper::LibreOfficeKit::isActive() && nFlags == SfxChildWindowFlags::NONE) \ + nFlags |= SfxChildWindowFlags::NEVERCLONE; \ aFact.aInfo.nFlags |= nFlags; \ aFact.aInfo.bVisible = bVis; \ SfxChildWindow::RegisterChildWindow(pMod, aFact); \ diff --git a/sc/source/ui/app/scdll.cxx b/sc/source/ui/app/scdll.cxx index c08e6a47c5f8..f581ad886bfd 100644 --- a/sc/source/ui/app/scdll.cxx +++ b/sc/source/ui/app/scdll.cxx @@ -223,9 +223,7 @@ void ScDLL::Init() SvxHlinkDlgWrapper ::RegisterChildWindow(false, pMod); SvxFontWorkChildWindow ::RegisterChildWindow(false, pMod); SvxIMapDlgChildWindow ::RegisterChildWindow(false, pMod); - ScSpellDialogChildWindow::RegisterChildWindow( - false, pMod, comphelper::LibreOfficeKit::isActive() ? SfxChildWindowFlags::NEVERCLONE - : SfxChildWindowFlags::NONE); + ScSpellDialogChildWindow ::RegisterChildWindow(false, pMod); ScValidityRefChildWin::RegisterChildWindow(false, pMod); sc::SearchResultsDlgWrapper::RegisterChildWindow(false, pMod); diff --git a/sc/source/ui/view/tabvwshc.cxx b/sc/source/ui/view/tabvwshc.cxx index 4cf74a88295b..8fc9fb1276cf 100644 --- a/sc/source/ui/view/tabvwshc.cxx +++ b/sc/source/ui/view/tabvwshc.cxx @@ -128,7 +128,7 @@ std::shared_ptr ScTabViewShell::CreateRefDialogCont if ( nCurRefDlgId != nSlotId ) { - if (!(comphelper::LibreOfficeKit::isActive() && nSlotId == SID_OPENDLG_FUNCTION)) + if (!comphelper::LibreOfficeKit::isActive()) { // the dialog has been opened in a different view // -> lock the dispatcher for this view (modal mode) diff --git a/sd/source/ui/app/sddll.cxx b/sd/source/ui/app/sddll.cxx index 78646f8c049e..07a043c0828e 100644 --- a/sd/source/ui/app/sddll.cxx +++ b/sd/source/ui/app/sddll.cxx @@ -172,9 +172,7 @@ void SdDLL::RegisterControllers(SdModule* pMod) SvxBmpMaskChildWindow::RegisterChildWindow(false, pMod); SvxIMapDlgChildWindow::RegisterChildWindow(false, pMod); SvxHlinkDlgWrapper::RegisterChildWindow(false, pMod); - ::sd::SpellDialogChildWindow::RegisterChildWindow( - false, pMod, comphelper::LibreOfficeKit::isActive() ? SfxChildWindowFlags::NEVERCLONE - : SfxChildWindowFlags::NONE); + ::sd::SpellDialogChildWindow::RegisterChildWindow(false, pMod); #if HAVE_FEATURE_AVMEDIA ::avmedia::MediaPlayer::RegisterChildWindow(false, pMod); #endif diff --git a/sw/source/uibase/app/swmodule.cxx b/sw/source/uibase/app/swmodule.cxx index 98d4364fcdd9..ef814781bdd8 100644 --- a/sw/source/uibase/app/swmodule.cxx +++ b/sw/source/uibase/app/swmodule.cxx @@ -312,9 +312,7 @@ void SwDLL::RegisterControls() SwInsertAuthMarkWrapper::RegisterChildWindow( false, pMod ); SwWordCountWrapper::RegisterChildWindow( false, pMod ); SvxRubyChildWindow::RegisterChildWindow( false, pMod); - SwSpellDialogChildWindow::RegisterChildWindow( - false, pMod, comphelper::LibreOfficeKit::isActive() ? SfxChildWindowFlags::NEVERCLONE - : SfxChildWindowFlags::NONE); + SwSpellDialogChildWindow::RegisterChildWindow(false, pMod); DevelopmentToolChildWindow::RegisterChildWindow(false, pMod); SvxGrafRedToolBoxControl::RegisterControl( SID_ATTR_GRAF_RED, pMod ); diff --git a/test/source/lokcallback.cxx b/test/source/lokcallback.cxx index 0914ea4db73c..0fb3cefef214 100644 --- a/test/source/lokcallback.cxx +++ b/test/source/lokcallback.cxx @@ -197,6 +197,7 @@ SfxChildWindow* TestLokCallbackWrapper::InitializeSidebar() assert(pViewShell); SfxViewFrame& rViewFrame = pViewShell->GetViewFrame(); + rViewFrame.ShowChildWindow(SID_SIDEBAR); SfxChildWindow* pSideBar = rViewFrame.GetChildWindow(SID_SIDEBAR); assert(pSideBar);