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

New commits:
commit 66a884554fd4e945baa4775f2835cd2a2467f800
Author:     Tomaž Vajngerl <[email protected]>
AuthorDate: Fri Oct 3 11:04:21 2025 +0900
Commit:     Tomaž Vajngerl <[email protected]>
CommitDate: Thu Oct 9 11:14:28 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/+/191806
    Tested-by: Jenkins
    Reviewed-by: Tomaž Vajngerl <[email protected]>

diff --git a/sc/source/ui/view/hdrcont.cxx b/sc/source/ui/view/hdrcont.cxx
index e57870510c94..6c938a8919c8 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>
 #include <o3tl/enumrange.hxx>
 
@@ -333,8 +334,20 @@ void ScHeaderControl::Paint( vcl::RenderContext& 
/*rRenderContext*/, const tools
     if ( nLineEnd * nLayoutSign >= nInitScrPos * nLayoutSign )
     {
         Color aFaceColor(rStyleSettings.GetFaceColor());
-        if (pTabView && 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());
+                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