sc: add theme colors to the color picker

Change-Id: Iae8f502a24187f4d41f60fbb727066f214d1cf70
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151449
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
This commit is contained in:
Tomaž Vajngerl 2023-05-05 23:09:32 +09:00 committed by Tomaž Vajngerl
parent 4232b46b4a
commit 600ad0a53e
5 changed files with 27 additions and 0 deletions

View file

@ -72,6 +72,7 @@ $(eval $(call gb_Library_use_libraries,sc,\
dbtools \
drawinglayercore \
drawinglayer \
docmodel \
editeng \
for \
forui \

View file

@ -50,6 +50,7 @@ $(eval $(call gb_Library_use_libraries,scui,\
comphelper \
cppu \
cppuhelper \
docmodel \
editeng \
for \
forui \

View file

@ -79,6 +79,9 @@
#include <sot/formats.hxx>
#include <svx/compatflags.hxx>
#include <svx/dialogs.hrc>
#include <svx/svdpagv.hxx>
#include <svx/svdpage.hxx>
#include <docmodel/theme/Theme.hxx>
#include <formulacell.hxx>
#include <global.hxx>
@ -215,6 +218,26 @@ std::set<Color> ScDocShell::GetDocColors()
return m_pDocument->GetDocColors();
}
std::vector<Color> 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();

View file

@ -181,6 +181,7 @@ public:
bool bTemplate = false ) const override;
virtual std::set<Color> GetDocColors() override;
virtual std::vector<Color> GetThemeColors() override;
virtual bool InitNew( const css::uno::Reference< css::embed::XStorage >& ) override;
virtual bool Load( SfxMedium& rMedium ) override;

View file

@ -47,6 +47,7 @@ $(eval $(call gb_CppunitTest_use_libraries,sc_ucalc$(1), \
dbtools \
drawinglayer \
drawinglayercore \
docmodel \
editeng \
for \
forui \