sc/source/ui/view/hdrcont.cxx |   20 ++++++++++++++++++--
 1 file changed, 18 insertions(+), 2 deletions(-)

New commits:
commit 37dd2393298dc92c59e217e08a152d9ba983c81b
Author:     Tomaž Vajngerl <[email protected]>
AuthorDate: Fri Oct 3 11:04:21 2025 +0900
Commit:     Miklos Vajna <[email protected]>
CommitDate: Thu Oct 9 08:53:34 2025 +0200

    sc: Change header color when sheetview is out of sync
    
    So it is easier to see when the sheetview is out of sync for the
    debugging purpuse.
    
    Change-Id: I302d6d188bf17d8aeecc6cef0d9b351217a62b6e
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/192085
    Tested-by: Jenkins CollaboraOffice <[email protected]>
    Reviewed-by: Miklos Vajna <[email protected]>

diff --git a/sc/source/ui/view/hdrcont.cxx b/sc/source/ui/view/hdrcont.cxx
index bc79dfa97771..902973b28827 100644
--- a/sc/source/ui/view/hdrcont.cxx
+++ b/sc/source/ui/view/hdrcont.cxx
@@ -35,6 +35,7 @@
 #include <tabview.hxx>
 #include <viewdata.hxx>
 #include <columnspanset.hxx>
+#include <SheetViewManager.hxx>
 #include <officecfg/Office/Common.hxx>
 
 #define SC_DRAG_MIN     2
@@ -323,8 +324,23 @@ void ScHeaderControl::Paint( vcl::RenderContext& 
/*rRenderContext*/, const tools
     if ( nLineEnd * nLayoutSign >= nInitScrPos * nLayoutSign )
     {
         Color aFaceColor(rStyleSettings.GetFaceColor());
-        if (pTabView->GetViewData().GetSheetViewID() >= 0)
-            aFaceColor.Merge(COL_LIGHTBLUE, 220);
+        if (pTabView)
+        {
+            ScViewData& rViewData = pTabView->GetViewData();
+            sc::SheetViewID nSheetViewID = rViewData.GetSheetViewID();
+            if (nSheetViewID >= 0)
+            {
+                auto pSheetManager = 
rViewData.GetDocument().GetSheetViewManager(rViewData.GetTabNumber());
+                if (pSheetManager)
+                {
+                    auto pSheetView = pSheetManager->get(nSheetViewID);
+                    if (pSheetView->isSynced())
+                        aFaceColor.Merge(COL_LIGHTBLUE, 220);
+                    else
+                        aFaceColor.Merge(COL_LIGHTRED, 220);
+                }
+            }
+        }
         if (bDark)
             aFaceColor.IncreaseLuminance(20);
         else

Reply via email to