sc/source/ui/view/output2.cxx |   13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

New commits:
commit 927fd9820bcdbed35b34c7bb7081a19535aa041b
Author:     Caolán McNamara <caolan.mcnam...@collabora.com>
AuthorDate: Tue Sep 24 14:29:16 2024 +0100
Commit:     Pranam Lashkari <lpra...@collabora.com>
CommitDate: Tue Sep 24 17:18:20 2024 +0200

    prefer the per-ViewShell rendering data for default document bg color
    
    Change-Id: Ie67d6317641d63524c20a3001179ad958ebce300
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173866
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com>
    Reviewed-by: Pranam Lashkari <lpra...@collabora.com>

diff --git a/sc/source/ui/view/output2.cxx b/sc/source/ui/view/output2.cxx
index 877675c0ac48..859eae2800dc 100644
--- a/sc/source/ui/view/output2.cxx
+++ b/sc/source/ui/view/output2.cxx
@@ -74,6 +74,7 @@
 #include <stlsheet.hxx>
 #include <spellcheckcontext.hxx>
 #include <scopetools.hxx>
+#include <tabvwsh.hxx>
 
 #include <com/sun/star/i18n/DirectionProperty.hpp>
 #include <comphelper/scopeguard.hxx>
@@ -2484,6 +2485,13 @@ bool ScOutputData::DrawEditParam::readCellContent(
     return true;
 }
 
+static Color GetConfBackgroundColor()
+{
+    if (const ScTabViewShell* pTabViewShellBg = 
ScTabViewShell::GetActiveViewShell())
+        return pTabViewShellBg->GetViewRenderingData().GetDocColor();
+    return SC_MOD()->GetColorConfig().GetColorValue(svtools::DOCCOLOR).nColor;
+}
+
 void ScOutputData::DrawEditParam::setPatternToEngine(bool bUseStyleColor)
 {
     // syntax highlighting mode is ignored here
@@ -2492,7 +2500,7 @@ void ScOutputData::DrawEditParam::setPatternToEngine(bool 
bUseStyleColor)
     if (SfxPoolItem::areSame(mpPattern, mpOldPattern) && mpCondSet == 
mpOldCondSet && mpPreviewFontSet == mpOldPreviewFontSet )
         return;
 
-    Color nConfBackColor = 
SC_MOD()->GetColorConfig().GetColorValue(svtools::DOCCOLOR).nColor;
+    Color nConfBackColor = GetConfBackgroundColor();
     bool bCellContrast = bUseStyleColor &&
             
Application::GetSettings().GetStyleSettings().GetHighContrastMode();
 
@@ -4581,8 +4589,7 @@ void ScOutputData::DrawRotated(bool bPixelToLogic)
         if (pRowInfo[nRotY].nRotMaxCol != SC_ROTMAX_NONE && 
pRowInfo[nRotY].nRotMaxCol > nRotMax)
             nRotMax = pRowInfo[nRotY].nRotMaxCol;
 
-    ScModule* pScMod = SC_MOD();
-    Color nConfBackColor = 
pScMod->GetColorConfig().GetColorValue(svtools::DOCCOLOR).nColor;
+    Color nConfBackColor = GetConfBackgroundColor();
     bool bCellContrast = mbUseStyleColor &&
             
Application::GetSettings().GetStyleSettings().GetHighContrastMode();
 

Reply via email to