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.tietze@documentfoundation.org>
(cherry picked from commit 87aeb7be943921942f791cd182122e8e073ce804)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130154
Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
diff --git a/sw/source/ui/misc/outline.cxx b/sw/source/ui/misc/outline.cxx
index c7fa599..3c1345f 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 ));