From 87aeb7be943921942f791cd182122e8e073ce804 Mon Sep 17 00:00:00 2001 From: Heiko Tietze Date: Fri, 18 Feb 2022 11:29:26 +0100 Subject: Resolves tdf#137381 - Use app colors on chapter numbering preview Change-Id: I8e5edec1ad6f4b6f44855014ce91a642efbd75f9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130133 Tested-by: Jenkins Reviewed-by: Heiko Tietze --- sw/source/ui/misc/outline.cxx | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/sw/source/ui/misc/outline.cxx b/sw/source/ui/misc/outline.cxx index c7fa599c9bfa..3c1345f308ae 100644 --- a/sw/source/ui/misc/outline.cxx +++ b/sw/source/ui/misc/outline.cxx @@ -42,6 +42,7 @@ #include #include #include +#include #include @@ -875,8 +876,8 @@ void NumberingPreview::Paint(vcl::RenderContext& rRenderContext, const tools::Re pVDev->SetOutputSize(aSize); // #101524# OJ - pVDev->SetFillColor(rRenderContext.GetSettings().GetStyleSettings().GetWindowColor()); - pVDev->SetLineColor(rRenderContext.GetSettings().GetStyleSettings().GetButtonTextColor()); + pVDev->SetFillColor(SwViewOption::GetDocColor()); + pVDev->SetLineColor(SwViewOption::GetDocBoundariesColor()); pVDev->DrawRect(tools::Rectangle(Point(0,0), aSize)); if (pActNum) @@ -897,8 +898,11 @@ void NumberingPreview::Paint(vcl::RenderContext& rRenderContext, const tools::Re tools::Long nYStart = 4; aStdFont = OutputDevice::GetDefaultFont(DefaultFontType::UI_SANS, GetAppLanguage(), GetDefaultFontFlags::OnlyOne, &rRenderContext); - // #101524# OJ - aStdFont.SetColor(SwViewOption::GetFontColor()); + + if (svtools::ColorConfig().GetColorValue(svtools::FONTCOLOR, false).nColor == COL_AUTO) + aStdFont.SetColor( SwViewOption::GetDocColor().IsDark() ? COL_WHITE : COL_BLACK ); + else + aStdFont.SetColor( SwViewOption::GetFontColor() ); const tools::Long nFontHeight = nYStep * ( bPosition ? 15 : 6 ) / 10; aStdFont.SetFontSize(Size( 0, nFontHeight )); -- cgit