sfx2/source/view/viewsh.cxx   |    6 ++++--
 svx/source/svdraw/svdpage.cxx |   10 ++++++++--
 2 files changed, 12 insertions(+), 4 deletions(-)

New commits:
commit 3a48ad467b7fbf9cbdfff1222e08c02b0ff5d544
Author:     Caolán McNamara <caolan.mcnam...@collabora.com>
AuthorDate: Tue Jan 30 21:29:31 2024 +0000
Commit:     Caolán McNamara <caolan.mcnam...@collabora.com>
CommitDate: Wed Jan 31 10:33:06 2024 +0100

    use ViewShell DOCCOLOR when available
    
    for fallback, continue to warn if the terminal fallback gets used,
    but fill stub it to return the application DOCCOLOR
    
    Change-Id: I2bf3a1c6c6adb58811fd36c70f93932de246f10a
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162782
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com>

diff --git a/sfx2/source/view/viewsh.cxx b/sfx2/source/view/viewsh.cxx
index 06dfc49798be..8c54bd049acb 100644
--- a/sfx2/source/view/viewsh.cxx
+++ b/sfx2/source/view/viewsh.cxx
@@ -30,6 +30,7 @@
 #include <vcl/toolbox.hxx>
 #include <vcl/weld.hxx>
 #include <svl/intitem.hxx>
+#include <svtools/colorcfg.hxx>
 #include <svtools/langhelp.hxx>
 #include <com/sun/star/awt/XPopupMenu.hpp>
 #include <com/sun/star/frame/XLayoutManager.hpp>
@@ -3316,10 +3317,11 @@ vcl::Window* 
SfxViewShell::GetEditWindowForActiveOLEObj() const
     return pEditWin;
 }
 
-::Color SfxViewShell::GetColorConfigColor(svtools::ColorConfigEntry) const
+::Color SfxViewShell::GetColorConfigColor(svtools::ColorConfigEntry eEntry) 
const
 {
     SAL_WARN("sfx.view", "SfxViewShell::GetColorConfigColor not overridden!");
-    return {};
+    svtools::ColorConfig aColorConfig;
+    return aColorConfig.GetColorValue(eEntry).nColor;
 }
 
 void SfxViewShell::SetLOKLanguageTag(const OUString& rBcp47LanguageTag)
diff --git a/svx/source/svdraw/svdpage.cxx b/svx/source/svdraw/svdpage.cxx
index 99137d28b4da..d154fd982901 100644
--- a/svx/source/svdraw/svdpage.cxx
+++ b/svx/source/svdraw/svdpage.cxx
@@ -31,6 +31,7 @@
 #include <tools/debug.hxx>
 #include <comphelper/diagnose_ex.hxx>
 
+#include <sfx2/viewsh.hxx>
 #include <svtools/colorcfg.hxx>
 #include <svx/svdetc.hxx>
 #include <svx/svdobj.hxx>
@@ -1768,8 +1769,13 @@ Color SdrPage::GetPageBackgroundColor( SdrPageView const 
* pView, bool bScreenDi
 
     if(bScreenDisplay && (!pView || pView->GetApplicationDocumentColor() == 
COL_AUTO))
     {
-        svtools::ColorConfig aColorConfig;
-        aColor = aColorConfig.GetColorValue( svtools::DOCCOLOR ).nColor;
+        if (const SfxViewShell* pViewShell = SfxViewShell::Current())
+            aColor = pViewShell->GetColorConfigColor(svtools::DOCCOLOR);
+        else
+        {
+            svtools::ColorConfig aColorConfig;
+            aColor = aColorConfig.GetColorValue( svtools::DOCCOLOR ).nColor;
+        }
     }
     else
     {

Reply via email to