diff options
author | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2016-09-25 00:52:06 +0200 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2016-09-26 00:33:16 +0000 |
commit | fc742749b63e0b22161c99bd2450fcede64ff4b3 (patch) | |
tree | 207752db40b10076b1c308d18e55d1838ba01101 | |
parent | 423c67150631545b512e40d8c1e716b3ba8b6569 (diff) |
tdf97667, add dumpAsXml for the conditional format data
Change-Id: I2f78be8588ed75e1e1e569af01190dad720ff442
Reviewed-on: https://gerrit.libreoffice.org/29258
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
-rw-r--r-- | sc/inc/attrib.hxx | 2 | ||||
-rw-r--r-- | sc/source/core/data/attrib.cxx | 14 |
2 files changed, 16 insertions, 0 deletions
diff --git a/sc/inc/attrib.hxx b/sc/inc/attrib.hxx index b4dc160c679f..8247b1925282 100644 --- a/sc/inc/attrib.hxx +++ b/sc/inc/attrib.hxx @@ -357,6 +357,8 @@ public: void AddCondFormatData( sal_uInt32 nIndex ); void SetCondFormatData( const std::vector<sal_uInt32>& aIndex ); + virtual void dumpAsXml(struct _xmlTextWriter* pWriter) const override; + private: std::vector<sal_uInt32> maIndex; }; diff --git a/sc/source/core/data/attrib.cxx b/sc/source/core/data/attrib.cxx index 3b8a19c83020..b32024a9e7df 100644 --- a/sc/source/core/data/attrib.cxx +++ b/sc/source/core/data/attrib.cxx @@ -31,6 +31,8 @@ #include <editeng/editobj.hxx> #include <editeng/flditem.hxx> +#include <libxml/xmlwriter.h> + #include "attrib.hxx" #include "global.hxx" #include "editutil.hxx" @@ -1078,4 +1080,16 @@ void ScCondFormatItem::SetCondFormatData( const std::vector<sal_uInt32>& rIndex maIndex = rIndex; } +void ScCondFormatItem::dumpAsXml(xmlTextWriterPtr pWriter) const +{ + xmlTextWriterStartElement(pWriter, BAD_CAST("condFormatItem")); + for (const auto& nItem : maIndex) + { + std::string aStrVal = std::to_string(nItem); + xmlTextWriterStartElement(pWriter, BAD_CAST(aStrVal.c_str())); + xmlTextWriterEndElement(pWriter); + } + xmlTextWriterEndElement(pWriter); +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |