summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2015-10-23 21:38:30 +0200
committerKatarina Behrens <Katarina.Behrens@cib.de>2015-11-25 08:50:42 +0000
commit4d9a757a384b79cee452b5625bfadeb2eaa42bc2 (patch)
tree8ce439107060b177fac5f674b6065aa339452602
parentc0772f7037794e1cea578a8833c79730fbe448c2 (diff)
store custom icon set info into ODF
Change-Id: I1581b28237d2b9f9c22d3f3b0436dc281508aafa Reviewed-on: https://gerrit.libreoffice.org/20118 Reviewed-by: Katarina Behrens <Katarina.Behrens@cib.de> Tested-by: Katarina Behrens <Katarina.Behrens@cib.de>
-rw-r--r--include/xmloff/xmltoken.hxx3
-rw-r--r--sc/source/filter/xml/xmlexprt.cxx17
-rw-r--r--xmloff/source/core/xmltoken.cxx3
3 files changed, 23 insertions, 0 deletions
diff --git a/include/xmloff/xmltoken.hxx b/include/xmloff/xmltoken.hxx
index 89596b07995d..a63fe2374f84 100644
--- a/include/xmloff/xmltoken.hxx
+++ b/include/xmloff/xmltoken.hxx
@@ -525,6 +525,9 @@ namespace xmloff { namespace token {
XML_CUSTOM3,
XML_CUSTOM4,
XML_CUSTOM5,
+ XML_CUSTOM_ICONSET,
+ XML_CUSTOM_ICONSET_INDEX,
+ XML_CUSTOM_ICONSET_NAME,
XML_CUT,
XML_CUT_OFFS,
XML_CX,
diff --git a/sc/source/filter/xml/xmlexprt.cxx b/sc/source/filter/xml/xmlexprt.cxx
index bdda325cac1c..25eb6032f75b 100644
--- a/sc/source/filter/xml/xmlexprt.cxx
+++ b/sc/source/filter/xml/xmlexprt.cxx
@@ -4396,7 +4396,24 @@ void ScXMLExport::ExportConditionalFormat(SCTAB nTab)
const ScIconSetFormat& mrIconSet = static_cast<const ScIconSetFormat&>(*pFormatEntry);
OUString aIconSetName = getIconSetName(mrIconSet.GetIconSetData()->eIconSetType);
AddAttribute( XML_NAMESPACE_CALC_EXT, XML_ICON_SET_TYPE, aIconSetName );
+ if (mrIconSet.GetIconSetData()->mbCustom)
+ AddAttribute(XML_NAMESPACE_CALC_EXT, XML_CUSTOM, OUString::boolean(true));
+
SvXMLElementExport aElementColorScale(*this, XML_NAMESPACE_CALC_EXT, XML_ICON_SET, true, true);
+
+ if (mrIconSet.GetIconSetData()->mbCustom)
+ {
+ for (std::vector<std::pair<ScIconSetType, sal_Int32> >::const_iterator
+ it = mrIconSet.GetIconSetData()->maCustomVector.begin();
+ it != mrIconSet.GetIconSetData()->maCustomVector.end(); ++it)
+ {
+ AddAttribute(XML_NAMESPACE_CALC_EXT, XML_CUSTOM_ICONSET_NAME, getIconSetName(it->first));
+ AddAttribute(XML_NAMESPACE_CALC_EXT, XML_CUSTOM_ICONSET_INDEX, OUString::number(it->second));
+ SvXMLElementExport aCustomIcon(*this, XML_NAMESPACE_CALC_EXT, XML_CUSTOM_ICONSET, true, true);
+ }
+
+ }
+
if(!mrIconSet.GetIconSetData()->mbShowValue)
AddAttribute(XML_NAMESPACE_CALC_EXT, XML_SHOW_VALUE, XML_FALSE);
for (auto const& it : mrIconSet)
diff --git a/xmloff/source/core/xmltoken.cxx b/xmloff/source/core/xmltoken.cxx
index 3f46062204be..949ac82a47c2 100644
--- a/xmloff/source/core/xmltoken.cxx
+++ b/xmloff/source/core/xmltoken.cxx
@@ -529,6 +529,9 @@ namespace xmloff { namespace token {
TOKEN( "custom3", XML_CUSTOM3 ),
TOKEN( "custom4", XML_CUSTOM4 ),
TOKEN( "custom5", XML_CUSTOM5 ),
+ TOKEN( "custom-iconset", XML_CUSTOM_ICONSET ),
+ TOKEN( "custom-iconset-index", XML_CUSTOM_ICONSET_INDEX ),
+ TOKEN( "custom-iconset-name", XML_CUSTOM_ICONSET_NAME ),
TOKEN( "cut", XML_CUT ),
TOKEN( "cut-offs", XML_CUT_OFFS ),
TOKEN( "cx", XML_CX ),