summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2014-12-19 09:04:41 +0100
committerMiklos Vajna <vmiklos@collabora.co.uk>2014-12-19 09:05:09 +0100
commit9071c5070cbcf6bba00285cdd9b062e961a10287 (patch)
tree71381eb4127ef536658463c9213d15bf3126c4f5 /sw
parent93bb2101197c1ff64a5cc3ab9ffa64f66c0d9641 (diff)
Factor out SwFmtCntnt::dumpAsXml() from nodedump
Change-Id: I6adcaa8534efefa474d489125d3fb95f150e3e89
Diffstat (limited to 'sw')
-rw-r--r--sw/inc/fmtcntnt.hxx2
-rw-r--r--sw/source/core/docnode/nodedump.cxx10
-rw-r--r--sw/source/core/layout/atrfrm.cxx8
3 files changed, 13 insertions, 7 deletions
diff --git a/sw/inc/fmtcntnt.hxx b/sw/inc/fmtcntnt.hxx
index c4efe4f7989c..a33b545be1a2 100644
--- a/sw/inc/fmtcntnt.hxx
+++ b/sw/inc/fmtcntnt.hxx
@@ -44,6 +44,8 @@ public:
const SwNodeIndex *GetCntntIdx() const { return pStartNode; }
void SetNewCntntIdx( const SwNodeIndex *pIdx );
+
+ void dumpAsXml(struct _xmlTextWriter* pWriter) const;
};
inline const SwFmtCntnt &SwAttrSet::GetCntnt(bool bInP) const
diff --git a/sw/source/core/docnode/nodedump.cxx b/sw/source/core/docnode/nodedump.cxx
index f6cd7f85eafb..c0cda7594cc9 100644
--- a/sw/source/core/docnode/nodedump.cxx
+++ b/sw/source/core/docnode/nodedump.cxx
@@ -423,6 +423,9 @@ void lcl_dumpSfxItemSet(WriterHelper& writer, const SfxItemSet* pSet)
case RES_CHRATR_FONTSIZE:
static_cast<const SvxFontHeightItem*>(pItem)->dumpAsXml(writer);
break;
+ case RES_CNTNT:
+ static_cast<const SwFmtCntnt*>(pItem)->dumpAsXml(writer);
+ break;
default: bDone = false; break;
}
if (bDone)
@@ -437,13 +440,6 @@ void lcl_dumpSfxItemSet(WriterHelper& writer, const SfxItemSet* pSet)
boost::optional<OString> oValue;
switch (pItem->Which())
{
- case RES_CNTNT:
- {
- pWhich = "content";
- const SwFmtCntnt* pCntnt = static_cast<const SwFmtCntnt*>(pItem);
- oValue = "node index: " + OString::number(pCntnt->GetCntntIdx()->GetNode().GetIndex());
- break;
- }
case RES_FRM_SIZE:
{
pWhich = "frame size";
diff --git a/sw/source/core/layout/atrfrm.cxx b/sw/source/core/layout/atrfrm.cxx
index 43f6666f5332..dbf0caaf6848 100644
--- a/sw/source/core/layout/atrfrm.cxx
+++ b/sw/source/core/layout/atrfrm.cxx
@@ -555,6 +555,14 @@ SfxPoolItem* SwFmtCntnt::Clone( SfxItemPool* ) const
return new SwFmtCntnt( *this );
}
+void SwFmtCntnt::dumpAsXml(xmlTextWriterPtr pWriter) const
+{
+ xmlTextWriterStartElement(pWriter, BAD_CAST("swFmtCntnt"));
+ xmlTextWriterWriteAttribute(pWriter, BAD_CAST("whichId"), BAD_CAST(OString::number(Which()).getStr()));
+ xmlTextWriterWriteAttribute(pWriter, BAD_CAST("startNode"), BAD_CAST(OString::number(pStartNode->GetNode().GetIndex()).getStr()));
+ xmlTextWriterEndElement(pWriter);
+}
+
// Partially implemented inline in hxx
SwFmtPageDesc::SwFmtPageDesc( const SwFmtPageDesc &rCpy )
: SfxPoolItem( RES_PAGEDESC ),