sw/source/ui/misc/outline.cxx |   12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

New commits:
commit a0ad72cb1404544ae0a3c3062431ed22edb7fa21
Author:     Heiko Tietze <tietze.he...@gmail.com>
AuthorDate: Fri Feb 18 11:29:26 2022 +0100
Commit:     Adolfo Jayme Barrientos <fit...@ubuntu.com>
CommitDate: Wed Mar 2 06:29:50 2022 +0100

    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 <heiko.tie...@documentfoundation.org>
    (cherry picked from commit 87aeb7be943921942f791cd182122e8e073ce804)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130154
    Reviewed-by: Adolfo Jayme Barrientos <fit...@ubuntu.com>

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 <outline.hrc>
 #include <strings.hrc>
 #include <paratr.hxx>
+#include <svtools/colorcfg.hxx>
 
 #include <IDocumentOutlineNodes.hxx>
 
@@ -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 ));

Reply via email to