diff --git a/sc/Library_sc.mk b/sc/Library_sc.mk index 82bab43389c1..141c01fc73b8 100644 --- a/sc/Library_sc.mk +++ b/sc/Library_sc.mk @@ -72,6 +72,7 @@ $(eval $(call gb_Library_use_libraries,sc,\ dbtools \ drawinglayercore \ drawinglayer \ + docmodel \ editeng \ for \ forui \ diff --git a/sc/Library_scui.mk b/sc/Library_scui.mk index 02c2bc8244d1..a4c7572734ae 100644 --- a/sc/Library_scui.mk +++ b/sc/Library_scui.mk @@ -50,6 +50,7 @@ $(eval $(call gb_Library_use_libraries,scui,\ comphelper \ cppu \ cppuhelper \ + docmodel \ editeng \ for \ forui \ diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx index f5d10cfe67ab..3d8647dc8ea8 100644 --- a/sc/source/ui/docshell/docsh.cxx +++ b/sc/source/ui/docshell/docsh.cxx @@ -79,6 +79,9 @@ #include #include #include +#include +#include +#include #include #include @@ -215,6 +218,26 @@ std::set ScDocShell::GetDocColors() return m_pDocument->GetDocColors(); } +std::vector ScDocShell::GetThemeColors() +{ + ScTabViewShell* pSh = GetBestViewShell(); + if (!pSh) + return {}; + ScTabView* pTabView = pSh->GetViewData().GetView(); + if (!pTabView) + return {}; + ScDrawView* pView = pTabView->GetScDrawView(); + if (!pView) + return {}; + SdrPage* pPage = pView->GetSdrPageView()->GetPage(); + if (!pPage) + return {}; + auto const& pTheme = pPage->getSdrPageProperties().GetTheme(); + if (!pTheme) + return {}; + return pTheme->GetColors(); +} + void ScDocShell::DoEnterHandler() { ScTabViewShell* pViewSh = ScTabViewShell::GetActiveViewShell(); diff --git a/sc/source/ui/inc/docsh.hxx b/sc/source/ui/inc/docsh.hxx index d92c93e73ff3..5c8484a2fd32 100644 --- a/sc/source/ui/inc/docsh.hxx +++ b/sc/source/ui/inc/docsh.hxx @@ -181,6 +181,7 @@ public: bool bTemplate = false ) const override; virtual std::set GetDocColors() override; + virtual std::vector GetThemeColors() override; virtual bool InitNew( const css::uno::Reference< css::embed::XStorage >& ) override; virtual bool Load( SfxMedium& rMedium ) override; diff --git a/sc/ucalc_setup.mk b/sc/ucalc_setup.mk index 9a2323572611..63351a87aa28 100644 --- a/sc/ucalc_setup.mk +++ b/sc/ucalc_setup.mk @@ -47,6 +47,7 @@ $(eval $(call gb_CppunitTest_use_libraries,sc_ucalc$(1), \ dbtools \ drawinglayer \ drawinglayercore \ + docmodel \ editeng \ for \ forui \