[Libreoffice-commits] core.git: sw/inc sw/source
Miklos Vajna
vmiklos at collabora.co.uk
Wed Feb 25 00:07:46 PST 2015
sw/inc/fmtautofmt.hxx | 2 ++
sw/source/core/doc/docredln.cxx | 4 ----
sw/source/core/docnode/nodedump.cxx | 7 +------
sw/source/core/txtnode/fmtatr2.cxx | 10 ++++++++++
4 files changed, 13 insertions(+), 10 deletions(-)
New commits:
commit 9ed292b945a1f0268fcfdb5a37756ccb43da1cc3
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date: Wed Feb 25 09:05:55 2015 +0100
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
diff --git a/sw/inc/fmtautofmt.hxx b/sw/inc/fmtautofmt.hxx
index dea9fc0..e781623 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 7342206..2182451 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 e485e33..edcf5ae 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 a10aac7..bfba293 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()
More information about the Libreoffice-commits
mailing list