chart2/source/controller/drawinglayer/DrawViewWrapper.cxx |   11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

New commits:
commit 32b814355b50e2f271ce46058990049bc7098266
Author:     Caolán McNamara <caolan.mcnam...@collabora.com>
AuthorDate: Wed Jan 31 19:51:33 2024 +0000
Commit:     Caolán McNamara <caolan.mcnam...@collabora.com>
CommitDate: Sun Feb 4 10:30:42 2024 +0100

    use ViewShell DOCCOLOR when available for charts
    
    Change-Id: I200538bd94d60867d84b7dc37811094b65dd9aa5
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162850
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com>

diff --git a/chart2/source/controller/drawinglayer/DrawViewWrapper.cxx 
b/chart2/source/controller/drawinglayer/DrawViewWrapper.cxx
index 56f1440e23ff..02d37de41d03 100644
--- a/chart2/source/controller/drawinglayer/DrawViewWrapper.cxx
+++ b/chart2/source/controller/drawinglayer/DrawViewWrapper.cxx
@@ -40,6 +40,7 @@
 #include <com/sun/star/drawing/XShape.hpp>
 
 #include <sfx2/objsh.hxx>
+#include <sfx2/viewsh.hxx>
 #include <svx/helperhittest3d.hxx>
 #include <officecfg/Office/Calc.hxx>
 
@@ -212,8 +213,14 @@ void DrawViewWrapper::setMarkHandleProvider( 
MarkHandleProvider* pMarkHandleProv
 
 void DrawViewWrapper::CompleteRedraw(OutputDevice* pOut, const vcl::Region& 
rReg, sdr::contact::ViewObjectContactRedirector* /* pRedirector */)
 {
-    svtools::ColorConfig aColorConfig;
-    Color aFillColor( aColorConfig.GetColorValue( svtools::DOCCOLOR ).nColor );
+    Color aFillColor;
+    if (const SfxViewShell* pViewShell = SfxViewShell::Current())
+        aFillColor = pViewShell->GetColorConfigColor(svtools::DOCCOLOR);
+    else
+    {
+        svtools::ColorConfig aColorConfig;
+        aFillColor = aColorConfig.GetColorValue(svtools::DOCCOLOR).nColor;
+    }
     SetApplicationBackgroundColor(aFillColor);
 
     SdrOutliner& rOutliner = GetModel().GetDrawOutliner();

Reply via email to