summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolan.mcnamara@collabora.com>2024-01-30 21:29:31 +0000
committerCaolán McNamara <caolan.mcnamara@collabora.com>2024-01-31 10:33:06 +0100
commit3a48ad467b7fbf9cbdfff1222e08c02b0ff5d544 (patch)
tree68381b86541adac186f19f7d6d722e92105c8bb6
parent2b1f5fa987f02ec8014dbf6837c6b090faf11f2d (diff)
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.mcnamara@collabora.com>
-rw-r--r--sfx2/source/view/viewsh.cxx6
-rw-r--r--svx/source/svdraw/svdpage.cxx10
2 files changed, 12 insertions, 4 deletions
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
{