sfx2/source/view/viewsh.cxx   |    8 +++++---
 svx/source/svdraw/svdpage.cxx |   10 ++++++++--
 2 files changed, 13 insertions(+), 5 deletions(-)

New commits:
commit 2bdc2d6327058d31bfd2ddb08f5c01ea9755bd66
Author:     Caolán McNamara <caolan.mcnam...@collabora.com>
AuthorDate: Tue Jan 30 21:29:31 2024 +0000
Commit:     Miklos Vajna <vmik...@collabora.com>
CommitDate: Thu Feb 1 13:51:59 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>
    (cherry picked from commit 3a48ad467b7fbf9cbdfff1222e08c02b0ff5d544)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162852
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com>
    Reviewed-by: Miklos Vajna <vmik...@collabora.com>

diff --git a/sfx2/source/view/viewsh.cxx b/sfx2/source/view/viewsh.cxx
index 1b39dcaf7acf..22c05d26946c 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>
@@ -3323,10 +3324,11 @@ vcl::Window* 
SfxViewShell::GetEditWindowForActiveOLEObj() const
     return pEditWin;
 }
 
-::Color SfxViewShell::GetColorConfigColor(svtools::ColorConfigEntry 
/*nColorType*/) const
+::Color SfxViewShell::GetColorConfigColor(svtools::ColorConfigEntry eEntry) 
const
 {
-    SAL_WARN("sfx.view", "SfxViewShell::GetColorConfigColor not overriden!");
-    return {};
+    SAL_WARN("sfx.view", "SfxViewShell::GetColorConfigColor not overridden!");
+    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 8378dcfed820..38e31f01070f 100644
--- a/svx/source/svdraw/svdpage.cxx
+++ b/svx/source/svdraw/svdpage.cxx
@@ -32,6 +32,7 @@
 #include <comphelper/diagnose_ex.hxx>
 #include <comphelper/lok.hxx>
 
+#include <sfx2/viewsh.hxx>
 #include <svtools/colorcfg.hxx>
 #include <svx/svdetc.hxx>
 #include <svx/svdobj.hxx>
@@ -1817,8 +1818,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