[Libreoffice-commits] core.git: include/xmloff sc/source xmloff/source

Markus Mohrhard markus.mohrhard at googlemail.com
Wed Nov 25 00:51:14 PST 2015


 include/xmloff/xmltoken.hxx       |    3 +++
 sc/source/filter/xml/xmlexprt.cxx |   17 +++++++++++++++++
 xmloff/source/core/xmltoken.cxx   |    3 +++
 3 files changed, 23 insertions(+)

New commits:
commit 4d9a757a384b79cee452b5625bfadeb2eaa42bc2
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Fri Oct 23 21:38:30 2015 +0200

    store custom icon set info into ODF
    
    Change-Id: I1581b28237d2b9f9c22d3f3b0436dc281508aafa
    Reviewed-on: https://gerrit.libreoffice.org/20118
    Reviewed-by: Katarina Behrens <Katarina.Behrens at cib.de>
    Tested-by: Katarina Behrens <Katarina.Behrens at cib.de>

diff --git a/include/xmloff/xmltoken.hxx b/include/xmloff/xmltoken.hxx
index 89596b0..a63fe23 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 bdda325..25eb603 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 3f46062..949ac82 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 ),


More information about the Libreoffice-commits mailing list