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>
diff --git a/sfx2/source/view/viewsh.cxx b/sfx2/source/view/viewsh.cxx
index 06dfc49..8c54bd0 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 99137d2..d154fd9 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
{