tdf#144587 Fix lines in treelists using dark mode

As reported by the user, the lines in a treelist are dark over a dark background. This patch fixes that.

Tested with kf5, gen and gtk3.

Change-Id: I7f1a206f4adba496d312b25a9db121df317c7c84
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141315
Reviewed-by: Heiko Tietze <heiko.tietze@documentfoundation.org>
Tested-by: Jenkins
diff --git a/vcl/source/treelist/svimpbox.cxx b/vcl/source/treelist/svimpbox.cxx
index b9a3118..63b4d92 100644
--- a/vcl/source/treelist/svimpbox.cxx
+++ b/vcl/source/treelist/svimpbox.cxx
@@ -1020,11 +1020,15 @@ void SvImpLBox::DrawNet(vcl::RenderContext& rRenderContext)
    rRenderContext.Push(vcl::PushFlags::LINECOLOR);

    const StyleSettings& rStyleSettings = rRenderContext.GetSettings().GetStyleSettings();
    Color aCol = rStyleSettings.GetFaceColor();

    if (aCol.IsRGBEqual(rRenderContext.GetBackground().GetColor()))
        aCol = rStyleSettings.GetShadowColor();
    rRenderContext.SetLineColor(aCol);
    // Set color to draw the vertical and horizontal lines
    Color aOldLineColor = rRenderContext.GetLineColor();
    Color aBackgroundColor = rRenderContext.GetBackground().GetColor();
    if (aBackgroundColor.IsDark())
        rRenderContext.SetLineColor(rStyleSettings.GetLightColor());
    else
        rRenderContext.SetLineColor(rStyleSettings.GetShadowColor());

    Point aPos1, aPos2;
    sal_uInt16 nDistance;
    sal_uLong nMax = m_nVisibleCount + nOffs + 1;
@@ -1064,6 +1068,7 @@ void SvImpLBox::DrawNet(vcl::RenderContext& rRenderContext)
        pEntry = m_pView->NextVisible(pEntry);
    }

    rRenderContext.SetLineColor(aOldLineColor);
    rRenderContext.Pop();
}