diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2023-01-25 16:55:14 +0900 |
---|---|---|
committer | Tomaž Vajngerl <quikee@gmail.com> | 2023-01-25 14:56:34 +0000 |
commit | cae93bc7a401cb6ddaf33b7a23e2ff3c3bfada40 (patch) | |
tree | b6776613dbd82d9d0a8fe0c0685e4c47ffb78ed4 /sw/source/uibase/app | |
parent | 8640e24b12c7df3170c9f3e7ff3edced81fd0838 (diff) |
sw: support theme colors in color picker in writer
Implements SfxDocumentShell::GetThemeColors, which allows the
color picker to use the theme colors and change them in Writer.
Change-Id: Ic13d2086d4ff037b377b475630b02ed1509fdf3d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146120
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'sw/source/uibase/app')
-rw-r--r-- | sw/source/uibase/app/docst.cxx | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/sw/source/uibase/app/docst.cxx b/sw/source/uibase/app/docst.cxx index f13b90b70af6..e3cc7b0f6b6e 100644 --- a/sw/source/uibase/app/docst.cxx +++ b/sw/source/uibase/app/docst.cxx @@ -81,6 +81,8 @@ #include <SwUndoFmt.hxx> #include <strings.hrc> #include <AccessibilityCheck.hxx> +#include <svx/ColorSets.hxx> +#include <svx/svdpage.hxx> using namespace ::com::sun::star; @@ -1575,6 +1577,17 @@ std::set<Color> SwDocShell::GetDocColors() return m_xDoc->GetDocColors(); } +std::vector<Color> SwDocShell::GetThemeColors() +{ + SdrPage* pPage = m_xDoc->getIDocumentDrawModelAccess().GetDrawModel()->GetPage(0); + if (!pPage) + return {}; + svx::Theme* pTheme = pPage->getSdrPageProperties().GetTheme(); + if (!pTheme) + return {}; + return pTheme->GetColors(); +} + void SwDocShell::LoadStyles( SfxObjectShell& rSource ) { LoadStyles_(rSource, false); |