summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2023-06-03 10:44:51 +0900
committerTomaž Vajngerl <quikee@gmail.com>2023-06-05 12:06:23 +0200
commit6c4c040d2ebc4371a706c762e7e6707875c43535 (patch)
tree940377966332042da96563af68e8efe8100a8e96 /sw
parentadce63eb131f0b20a1d72797d92f07efcee75ec4 (diff)
svx: extract theme color generation into ThemeColorPaletteManager
The generation of theme colors generation code is moved to the ThemeColorPaletteManager class, so it can be reused. Also change the GetThemeColors return type from std::vector<Color> to std::shared_ptr<theme::ColorSet> as we can now safely do that and simplifies things. Change-Id: I4a54bff889a1f97cb1e30467188dc69e07e8c518 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152588 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'sw')
-rw-r--r--sw/inc/docsh.hxx2
-rw-r--r--sw/source/uibase/app/docst.cxx4
2 files changed, 3 insertions, 3 deletions
diff --git a/sw/inc/docsh.hxx b/sw/inc/docsh.hxx
index e5f86c271cd2..bc26384e16a0 100644
--- a/sw/inc/docsh.hxx
+++ b/sw/inc/docsh.hxx
@@ -254,7 +254,7 @@ public:
virtual std::set<Color> GetDocColors() override;
- virtual std::vector<Color> GetThemeColors() override;
+ virtual std::shared_ptr<model::ColorSet> GetThemeColors() override;
sfx::AccessibilityIssueCollection runAccessibilityCheck() override;
diff --git a/sw/source/uibase/app/docst.cxx b/sw/source/uibase/app/docst.cxx
index 17422ef65920..b22c1163094e 100644
--- a/sw/source/uibase/app/docst.cxx
+++ b/sw/source/uibase/app/docst.cxx
@@ -1580,7 +1580,7 @@ std::set<Color> SwDocShell::GetDocColors()
return m_xDoc->GetDocColors();
}
-std::vector<Color> SwDocShell::GetThemeColors()
+std::shared_ptr<model::ColorSet> SwDocShell::GetThemeColors()
{
SdrPage* pPage = m_xDoc->getIDocumentDrawModelAccess().GetDrawModel()->GetPage(0);
if (!pPage)
@@ -1588,7 +1588,7 @@ std::vector<Color> SwDocShell::GetThemeColors()
auto const& pTheme = pPage->getSdrPageProperties().GetTheme();
if (!pTheme)
return {};
- return pTheme->GetColors();
+ return pTheme->getColorSet();
}
void SwDocShell::LoadStyles( SfxObjectShell& rSource )