diff options
author | Miklos Vajna <vmiklos@collabora.com> | 2021-11-19 13:44:40 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2021-11-19 15:28:42 +0100 |
commit | 32ae1ed7504d58f9216593cb87f25c480a0e623b (patch) | |
tree | c5f5907e1dd6a072e7be3473d4c0cb7cd114cc5a /svx/source/styles | |
parent | 13aa5081793f133077610cd01b7f01ee765b4add (diff) |
PPTX import: handle <a:clrScheme name="...">
We had doc model for this, but the UNO API and the PPTX import was
missing.
Change-Id: I199e9cc235a783d91700ce74f17d442f41d3c3f8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125532
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
Diffstat (limited to 'svx/source/styles')
-rw-r--r-- | svx/source/styles/ColorSets.cxx | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/svx/source/styles/ColorSets.cxx b/svx/source/styles/ColorSets.cxx index 8ab3d939ef5a..fbcf4bd4a889 100644 --- a/svx/source/styles/ColorSets.cxx +++ b/svx/source/styles/ColorSets.cxx @@ -164,11 +164,15 @@ void Theme::dumpAsXml(xmlTextWriterPtr pWriter) const void Theme::ToAny(css::uno::Any& rVal) const { - beans::PropertyValues aValues = { - comphelper::makePropertyValue("Name", maName) - }; + comphelper::SequenceAsHashMap aMap; + aMap["Name"] <<= maName; - rVal <<= aValues; + if (mpColorSet) + { + aMap["ColorSchemeName"] <<= mpColorSet->getName(); + } + + rVal <<= aMap.getAsConstPropertyValueList(); } std::unique_ptr<Theme> Theme::FromAny(const css::uno::Any& rVal) @@ -184,6 +188,15 @@ std::unique_ptr<Theme> Theme::FromAny(const css::uno::Any& rVal) pTheme = std::make_unique<Theme>(aName); } + it = aMap.find("ColorSchemeName"); + if (it != aMap.end() && pTheme) + { + OUString aName; + it->second >>= aName; + auto pColorSet = std::make_unique<ColorSet>(aName); + pTheme->SetColorSet(std::move(pColorSet)); + } + return pTheme; } |