diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2014-12-22 10:34:04 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2014-12-22 19:33:56 +0100 |
commit | 68a5ae93c68d195d33963c94b5c3ac1eb5dc1ce0 (patch) | |
tree | f91b1220cd140dc4a7212e85add36a4563d04726 /sw/source/core/layout/atrfrm.cxx | |
parent | cc15d898721f90412cf03ff76e4163cc91251d67 (diff) |
Factor out SwFmtAnchor::dumpAsXml() from nodedump
Change-Id: I080fd80cf0a2fd0531edcb21f189aaf4fd922ecc
Diffstat (limited to 'sw/source/core/layout/atrfrm.cxx')
-rw-r--r-- | sw/source/core/layout/atrfrm.cxx | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/sw/source/core/layout/atrfrm.cxx b/sw/source/core/layout/atrfrm.cxx index 070bb4ba061b..3c3b0b902b6d 100644 --- a/sw/source/core/layout/atrfrm.cxx +++ b/sw/source/core/layout/atrfrm.cxx @@ -1666,6 +1666,30 @@ bool SwFmtAnchor::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId ) return bRet; } +void SwFmtAnchor::dumpAsXml(xmlTextWriterPtr pWriter) const +{ + xmlTextWriterStartElement(pWriter, BAD_CAST("swFmtAnchor")); + xmlTextWriterWriteAttribute(pWriter, BAD_CAST("whichId"), BAD_CAST(OString::number(Which()).getStr())); + + if (m_pCntntAnchor) + { + std::stringstream aCntntAnchor; + aCntntAnchor << *m_pCntntAnchor; + xmlTextWriterWriteAttribute(pWriter, BAD_CAST("pCntntAnchor"), BAD_CAST(aCntntAnchor.str().c_str())); + } + else + xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST("pCntntAnchor"), "%p", m_pCntntAnchor.get()); + xmlTextWriterWriteAttribute(pWriter, BAD_CAST("nAnchorType"), BAD_CAST(OString::number(nAnchorId).getStr())); + xmlTextWriterWriteAttribute(pWriter, BAD_CAST("nPageNum"), BAD_CAST(OString::number(nPageNum).getStr())); + xmlTextWriterWriteAttribute(pWriter, BAD_CAST("nOrder"), BAD_CAST(OString::number(mnOrder).getStr())); + xmlTextWriterWriteAttribute(pWriter, BAD_CAST("nOrderCounter"), BAD_CAST(OString::number(mnOrderCounter).getStr())); + OUString aPresentation; + GetPresentation(SFX_ITEM_PRESENTATION_NAMELESS, SFX_MAPUNIT_100TH_MM, SFX_MAPUNIT_100TH_MM, aPresentation); + xmlTextWriterWriteAttribute(pWriter, BAD_CAST("presentation"), BAD_CAST(aPresentation.toUtf8().getStr())); + + xmlTextWriterEndElement(pWriter); +} + // Partially implemented inline in hxx SwFmtURL::SwFmtURL() : SfxPoolItem( RES_URL ), |