sc/source/ui/view/output2.cxx | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-)
New commits: commit d17898aafa6f39e1e71959922209656b2243ae67 Author: Caolán McNamara <caolan.mcnam...@collabora.com> AuthorDate: Tue Sep 24 14:29:16 2024 +0100 Commit: Caolán McNamara <caolan.mcnam...@collabora.com> CommitDate: Tue Sep 24 20:31:29 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> (cherry picked from commit 927fd9820bcdbed35b34c7bb7081a19535aa041b) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173795 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com> diff --git a/sc/source/ui/view/output2.cxx b/sc/source/ui/view/output2.cxx index e7079568ddab..db376c5db514 100644 --- a/sc/source/ui/view/output2.cxx +++ b/sc/source/ui/view/output2.cxx @@ -72,6 +72,7 @@ #include <stlsheet.hxx> #include <spellcheckcontext.hxx> #include <scopetools.hxx> +#include <tabvwsh.hxx> #include <com/sun/star/i18n/DirectionProperty.hpp> #include <comphelper/scopeguard.hxx> @@ -2540,6 +2541,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 @@ -2548,7 +2556,7 @@ void ScOutputData::DrawEditParam::setPatternToEngine(bool bUseStyleColor) if (ScPatternAttr::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(); @@ -4646,8 +4654,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();