sc/source/ui/app/scmod.cxx |   46 ++++++++++++++++++---------------------------
 1 file changed, 19 insertions(+), 27 deletions(-)

New commits:
commit 1a0bc1f8c21284959e4d512e82a9d6279ad1261c
Author:     Caolán McNamara <caolan.mcnam...@collabora.com>
AuthorDate: Mon Aug 26 12:28:46 2024 +0100
Commit:     Caolán McNamara <caolan.mcnam...@collabora.com>
CommitDate: Mon Aug 26 15:23:48 2024 +0200

    In desktop we want to update all the calc shells for dark/light mode
    
    while in kit mode we just want the current, before this in desktop
    mode none of the desktop shells for their dark/light mode updated
    
    Change-Id: I319f067afefedddf3d92c5cff675dac35e046179
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172391
    Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com>
    Tested-by: Jenkins

diff --git a/sc/source/ui/app/scmod.cxx b/sc/source/ui/app/scmod.cxx
index dec004ece9e2..ce3704db8246 100644
--- a/sc/source/ui/app/scmod.cxx
+++ b/sc/source/ui/app/scmod.cxx
@@ -210,42 +210,34 @@ void 
ScModule::ConfigurationChanged(utl::ConfigurationBroadcaster* p, Configurat
             }
         }
 
-        bool bSkipInvalidate = false;
-
         const bool bKit = comphelper::LibreOfficeKit::isActive();
-        if (bKit)
-        {
-            SfxViewShell* pSfxViewShell = SfxViewShell::Current();
-            ScTabViewShell* pViewShell = 
dynamic_cast<ScTabViewShell*>(pSfxViewShell);
-            SfxObjectShell* pCurrentSh = SfxObjectShell::Current();
 
-            if (pViewShell && pCurrentSh)
+        //invalidate only the current view in tiled rendering mode, or all 
views otherwise
+        SfxViewShell* pViewShell = bKit ? SfxViewShell::Current() : 
SfxViewShell::GetFirst();
+        while (pViewShell)
+        {
+            if (ScTabViewShell* pViewSh = 
dynamic_cast<ScTabViewShell*>(pViewShell))
             {
-                ScViewRenderingOptions 
aViewRenderingOptions(pViewShell->GetViewRenderingData());
+                ScViewRenderingOptions 
aViewRenderingOptions(pViewSh->GetViewRenderingData());
                 Color 
aFillColor(m_pColorConfig->GetColorValue(svtools::DOCCOLOR).nColor);
                 aViewRenderingOptions.SetDocColor(aFillColor);
                 
aViewRenderingOptions.SetColorSchemeName(svtools::ColorConfig::GetCurrentSchemeName());
-                const bool bUnchanged(aViewRenderingOptions == 
pViewShell->GetViewRenderingData());
+                const bool bUnchanged(aViewRenderingOptions == 
pViewSh->GetViewRenderingData());
                 if (!bUnchanged)
-                    pViewShell->SetViewRenderingData(aViewRenderingOptions);
-                ScModelObj* pScModelObj = 
comphelper::getFromUnoTunnel<ScModelObj>(pCurrentSh->GetModel());
-                SfxLokHelper::notifyViewRenderState(pViewShell, pScModelObj);
-                // In Online, the document color is the one used for the 
background, contrary to
-                // Writer and Draw that use the application background color.
-                
pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_APPLICATION_BACKGROUND_COLOR,
-                        aFillColor.AsRGBHexString().toUtf8());
+                    pViewSh->SetViewRenderingData(aViewRenderingOptions);
 
-                // if nothing changed, and the hint was 
OnlyCurrentDocumentColorScheme we can skip invalidate
-                bSkipInvalidate = bUnchanged && eHints == 
ConfigurationHints::OnlyCurrentDocumentColorScheme;
-            }
-        }
+                if (SfxObjectShell* pKitCurrentObjSh = bKit ? 
SfxObjectShell::Current() : nullptr)
+                {
+                    ScModelObj* pScModelObj = 
comphelper::getFromUnoTunnel<ScModelObj>(pKitCurrentObjSh->GetModel());
+                    SfxLokHelper::notifyViewRenderState(pViewSh, pScModelObj);
+                    // In Online, the document color is the one used for the 
background, contrary to
+                    // Writer and Draw that use the application background 
color.
+                    
pViewSh->libreOfficeKitViewCallback(LOK_CALLBACK_APPLICATION_BACKGROUND_COLOR,
+                            aFillColor.AsRGBHexString().toUtf8());
+                }
 
-        //invalidate only the current view in tiled rendering mode, or all 
views otherwise
-        SfxViewShell* pViewShell = bKit ? SfxViewShell::Current() : 
SfxViewShell::GetFirst();
-        while (pViewShell)
-        {
-            if (ScTabViewShell* pViewSh = 
dynamic_cast<ScTabViewShell*>(pViewShell))
-            {
+                // if nothing changed, and the hint was 
OnlyCurrentDocumentColorScheme we can skip invalidate
+                const bool bSkipInvalidate = bUnchanged && eHints == 
ConfigurationHints::OnlyCurrentDocumentColorScheme;
                 if (!bSkipInvalidate)
                 {
                     pViewSh->PaintGrid();

Reply via email to