summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2015-02-25 09:05:55 +0100
committerMiklos Vajna <vmiklos@collabora.co.uk>2015-02-25 09:07:13 +0100
commit9ed292b945a1f0268fcfdb5a37756ccb43da1cc3 (patch)
treee9b38053c6177121875fd15f51ae762c55976632 /sw
parent6a835bbbd114156c2c32b1a1079097178b815dac (diff)
Extract SwFmtAutoFmt::dumpAsXml() from SwTxtNode
Also remove code from SwRangeRedline::dumpAsXml(), where that extra data pointer seems to be ~always 0, so don't bother dumping it. Change-Id: I4509b9366c1862248fcd3cc7ca6bb257ea7517f8
Diffstat (limited to 'sw')
-rw-r--r--sw/inc/fmtautofmt.hxx2
-rw-r--r--sw/source/core/doc/docredln.cxx4
-rw-r--r--sw/source/core/docnode/nodedump.cxx7
-rw-r--r--sw/source/core/txtnode/fmtatr2.cxx10
4 files changed, 13 insertions, 10 deletions
diff --git a/sw/inc/fmtautofmt.hxx b/sw/inc/fmtautofmt.hxx
index dea9fc043b51..e7816237226c 100644
--- a/sw/inc/fmtautofmt.hxx
+++ b/sw/inc/fmtautofmt.hxx
@@ -57,6 +57,8 @@ public:
void SetStyleHandle( std::shared_ptr<SfxItemSet> pHandle ) { mpHandle = pHandle; }
const std::shared_ptr<SfxItemSet> GetStyleHandle() const { return mpHandle; }
std::shared_ptr<SfxItemSet> GetStyleHandle() { return mpHandle; }
+
+ void dumpAsXml(struct _xmlTextWriter* pWriter) const SAL_OVERRIDE;
};
#endif
diff --git a/sw/source/core/doc/docredln.cxx b/sw/source/core/doc/docredln.cxx
index 7342206325c3..21824512beb7 100644
--- a/sw/source/core/doc/docredln.cxx
+++ b/sw/source/core/doc/docredln.cxx
@@ -1644,10 +1644,6 @@ void SwRangeRedline::dumpAsXml(xmlTextWriterPtr pWriter) const
SwPaM::dumpAsXml(pWriter);
- const SwRedlineExtraData* pExtraRedlineData = GetExtraData();
- xmlTextWriterStartElement(pWriter, BAD_CAST("swRedlineExtraData"));
- xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST("symbol"), "%s", BAD_CAST(typeid(pExtraRedlineData).name()));
- xmlTextWriterEndElement(pWriter); // swRadlineExtraData
xmlTextWriterEndElement(pWriter);
}
diff --git a/sw/source/core/docnode/nodedump.cxx b/sw/source/core/docnode/nodedump.cxx
index e485e3380483..edcf5ae02142 100644
--- a/sw/source/core/docnode/nodedump.cxx
+++ b/sw/source/core/docnode/nodedump.cxx
@@ -322,12 +322,7 @@ void SwTxtNode::dumpAsXml( xmlTextWriterPtr w ) const
writer.writeFormatAttribute("value", "%s", BAD_CAST(oValue->getStr()));
if (pHint->Which() == RES_TXTATR_AUTOFMT)
- {
- std::shared_ptr<SfxItemSet> const pSet(pHint->GetAutoFmt().GetStyleHandle());
- writer.startElement("autofmt");
- pSet->dumpAsXml(writer);
- writer.endElement();
- }
+ pHint->GetAutoFmt().dumpAsXml(writer);
writer.endElement();
}
diff --git a/sw/source/core/txtnode/fmtatr2.cxx b/sw/source/core/txtnode/fmtatr2.cxx
index a10aac7a87fc..bfba29307670 100644
--- a/sw/source/core/txtnode/fmtatr2.cxx
+++ b/sw/source/core/txtnode/fmtatr2.cxx
@@ -17,6 +17,7 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
+#include <libxml/xmlwriter.h>
#include <hintids.hxx>
#include <poolfmt.hxx>
#include "unomid.h"
@@ -146,6 +147,15 @@ bool SwFmtAutoFmt::PutValue( const uno::Any& , sal_uInt8 )
return false;
}
+void SwFmtAutoFmt::dumpAsXml(xmlTextWriterPtr pWriter) const
+{
+ xmlTextWriterStartElement(pWriter, BAD_CAST("swFmtAutoFmt"));
+ xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST("ptr"), "%p", this);
+ xmlTextWriterWriteAttribute(pWriter, BAD_CAST("whichId"), BAD_CAST(OString::number(Which()).getStr()));
+ mpHandle->dumpAsXml(pWriter);
+ xmlTextWriterEndElement(pWriter);
+}
+
SwFmtINetFmt::SwFmtINetFmt()
: SfxPoolItem( RES_TXTATR_INETFMT )
, msURL()