summaryrefslogtreecommitdiff
path: root/svx/source/styles
diff options
context:
space:
mode:
Diffstat (limited to 'svx/source/styles')
-rw-r--r--svx/source/styles/ColorSets.cxx32
1 files changed, 32 insertions, 0 deletions
diff --git a/svx/source/styles/ColorSets.cxx b/svx/source/styles/ColorSets.cxx
index 91a44f1782ea..8ab3d939ef5a 100644
--- a/svx/source/styles/ColorSets.cxx
+++ b/svx/source/styles/ColorSets.cxx
@@ -14,6 +14,13 @@
#include <libxml/xmlwriter.h>
+#include <com/sun/star/beans/PropertyValues.hpp>
+
+#include <comphelper/propertyvalue.hxx>
+#include <comphelper/sequenceashashmap.hxx>
+
+using namespace com::sun::star;
+
namespace svx
{
@@ -155,6 +162,31 @@ void Theme::dumpAsXml(xmlTextWriterPtr pWriter) const
(void)xmlTextWriterEndElement(pWriter);
}
+void Theme::ToAny(css::uno::Any& rVal) const
+{
+ beans::PropertyValues aValues = {
+ comphelper::makePropertyValue("Name", maName)
+ };
+
+ rVal <<= aValues;
+}
+
+std::unique_ptr<Theme> Theme::FromAny(const css::uno::Any& rVal)
+{
+ comphelper::SequenceAsHashMap aMap(rVal);
+ std::unique_ptr<Theme> pTheme;
+
+ auto it = aMap.find("Name");
+ if (it != aMap.end())
+ {
+ OUString aName;
+ it->second >>= aName;
+ pTheme = std::make_unique<Theme>(aName);
+ }
+
+ return pTheme;
+}
+
} // end of namespace svx
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */