From 32ae1ed7504d58f9216593cb87f25c480a0e623b Mon Sep 17 00:00:00 2001 From: Miklos Vajna Date: Fri, 19 Nov 2021 13:44:40 +0100 Subject: PPTX import: handle 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 Tested-by: Jenkins --- svx/source/styles/ColorSets.cxx | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) (limited to 'svx/source/styles') 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::FromAny(const css::uno::Any& rVal) @@ -184,6 +188,15 @@ std::unique_ptr Theme::FromAny(const css::uno::Any& rVal) pTheme = std::make_unique(aName); } + it = aMap.find("ColorSchemeName"); + if (it != aMap.end() && pTheme) + { + OUString aName; + it->second >>= aName; + auto pColorSet = std::make_unique(aName); + pTheme->SetColorSet(std::move(pColorSet)); + } + return pTheme; } -- cgit