Kaydet (Commit) 9071c507 authored tarafından Miklos Vajna's avatar Miklos Vajna

Factor out SwFmtCntnt::dumpAsXml() from nodedump

Change-Id: I6adcaa8534efefa474d489125d3fb95f150e3e89
üst 93bb2101
......@@ -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
......
......@@ -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";
......
......@@ -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 ),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment