include/sfx2/childwin.hxx         |    3 +++
 sc/source/ui/app/scdll.cxx        |   14 +++-----------
 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, 10 insertions(+), 18 deletions(-)

New commits:
commit 2fba6df7242586870988b62909156538b42c2bc0
Author:     Pranam Lashkari <lpra...@collabora.com>
AuthorDate: Thu Nov 21 20:11:18 2024 +0530
Commit:     Caolán McNamara <caolan.mcnam...@collabora.com>
CommitDate: Thu Dec 5 15:31:06 2024 +0100

    LOK: don't recreate the dialogs of an old view when loading new views
    
    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 <caolan.mcnam...@collabora.com>
    Tested-by: Caolán McNamara <caolan.mcnam...@collabora.com>
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com>

diff --git a/include/sfx2/childwin.hxx b/include/sfx2/childwin.hxx
index 57c2369233ef..1c4a318fceba 100644
--- a/include/sfx2/childwin.hxx
+++ b/include/sfx2/childwin.hxx
@@ -29,6 +29,7 @@
 
 #include <sfx2/chalign.hxx>
 #include <sfx2/basedlgs.hxx>
+#include <comphelper/lok.hxx>
 
 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 72c1187a295f..6c866a24a6d1 100644
--- a/sc/source/ui/app/scdll.cxx
+++ b/sc/source/ui/app/scdll.cxx
@@ -182,10 +182,7 @@ void ScDLL::Init()
     ScSolverDlgWrapper          ::RegisterChildWindow(false, pMod);
     ScOptSolverDlgWrapper       ::RegisterChildWindow(false, pMod);
     ScXMLSourceDlgWrapper       ::RegisterChildWindow(false, pMod);
-    ScNameDlgWrapper            ::RegisterChildWindow(false, pMod,
-                                           
comphelper::LibreOfficeKit::isActive()
-                                               ? 
SfxChildWindowFlags::NEVERCLONE
-                                               : SfxChildWindowFlags::NONE);
+    ScNameDlgWrapper            ::RegisterChildWindow(false, pMod);
     ScNameDefDlgWrapper         ::RegisterChildWindow(false, pMod);
     ScPivotLayoutWrapper        ::RegisterChildWindow(false, pMod);
     ScTabOpDlgWrapper           ::RegisterChildWindow(false, pMod);
@@ -213,10 +210,7 @@ void ScDLL::Init()
     ScFourierAnalysisDialogWrapper      ::RegisterChildWindow(false, pMod);
     sc::SparklineDialogWrapper          ::RegisterChildWindow(false, pMod);
     sc::SparklineDataRangeDialogWrapper ::RegisterChildWindow(false, pMod);
-    sc::ConditionalFormatEasyDialogWrapper ::RegisterChildWindow(
-        false, pMod,
-        comphelper::LibreOfficeKit::isActive() ? 
SfxChildWindowFlags::NEVERCLONE
-                                               : SfxChildWindowFlags::NONE);
+    sc::ConditionalFormatEasyDialogWrapper          
::RegisterChildWindow(false, pMod);
 
     // Redlining Window
     ScAcceptChgDlgWrapper       ::RegisterChildWindow(false, pMod);
@@ -227,9 +221,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 13d852f58630..ea0cfa113009 100644
--- a/sc/source/ui/view/tabvwshc.cxx
+++ b/sc/source/ui/view/tabvwshc.cxx
@@ -127,7 +127,7 @@ std::shared_ptr<SfxModelessDialogController> 
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 b4734310a39b..ecee16735e0a 100644
--- a/sd/source/ui/app/sddll.cxx
+++ b/sd/source/ui/app/sddll.cxx
@@ -169,9 +169,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 c6b8459def7d..237c1272d504 100644
--- a/sw/source/uibase/app/swmodule.cxx
+++ b/sw/source/uibase/app/swmodule.cxx
@@ -311,9 +311,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 a979b8b50582..b92846a9d6b9 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);
 

Reply via email to