Kaydet (Commit) 7fe28b2c authored tarafından Miklos Vajna's avatar Miklos Vajna

Factor out SwFmtPageDesc::dumpAsXml() from docnode

Change-Id: I813804ece7507fef84c43ba8fc290b151c8063ab
üst 60143f4f
...@@ -81,6 +81,7 @@ public: ...@@ -81,6 +81,7 @@ public:
void RegisterToEndNotInfo( SwEndNoteInfo& ); void RegisterToEndNotInfo( SwEndNoteInfo& );
void RegisterToPageDesc( SwPageDesc& ); void RegisterToPageDesc( SwPageDesc& );
bool KnowsPageDesc() const; bool KnowsPageDesc() const;
void dumpAsXml(struct _xmlTextWriter* pWriter) const;
}; };
inline const SwFmtPageDesc &SwAttrSet::GetPageDesc(bool bInP) const inline const SwFmtPageDesc &SwAttrSet::GetPageDesc(bool bInP) const
......
...@@ -499,6 +499,9 @@ void lcl_dumpSfxItemSet(WriterHelper& writer, const SfxItemSet* pSet) ...@@ -499,6 +499,9 @@ void lcl_dumpSfxItemSet(WriterHelper& writer, const SfxItemSet* pSet)
case RES_SHADOW: case RES_SHADOW:
static_cast<const SvxShadowItem*>(pItem)->dumpAsXml(writer); static_cast<const SvxShadowItem*>(pItem)->dumpAsXml(writer);
break; break;
case RES_PAGEDESC:
static_cast<const SwFmtPageDesc*>(pItem)->dumpAsXml(writer);
break;
default: bDone = false; break; default: bDone = false; break;
} }
if (bDone) if (bDone)
...@@ -513,14 +516,6 @@ void lcl_dumpSfxItemSet(WriterHelper& writer, const SfxItemSet* pSet) ...@@ -513,14 +516,6 @@ void lcl_dumpSfxItemSet(WriterHelper& writer, const SfxItemSet* pSet)
boost::optional<OString> oValue; boost::optional<OString> oValue;
switch (pItem->Which()) switch (pItem->Which())
{ {
case RES_PAGEDESC:
{
pWhich = "page description";
const SwFmtPageDesc* pFmt = static_cast<const SwFmtPageDesc*>(pItem);
if (pFmt->GetPageDesc())
oValue = "name: " + OUStringToOString(pFmt->GetPageDesc()->GetName(), RTL_TEXTENCODING_UTF8);
break;
}
case RES_FRMATR_STYLE_NAME: case RES_FRMATR_STYLE_NAME:
{ {
pWhich = "frame style name"; pWhich = "frame style name";
......
...@@ -769,6 +769,20 @@ bool SwFmtPageDesc::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId ) ...@@ -769,6 +769,20 @@ bool SwFmtPageDesc::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
return bRet; return bRet;
} }
void SwFmtPageDesc::dumpAsXml(xmlTextWriterPtr pWriter) const
{
xmlTextWriterStartElement(pWriter, BAD_CAST("swFmtPageDesc"));
xmlTextWriterWriteAttribute(pWriter, BAD_CAST("whichId"), BAD_CAST(OString::number(Which()).getStr()));
if (oNumOffset)
xmlTextWriterWriteAttribute(pWriter, BAD_CAST("oNumOffset"), BAD_CAST(OString::number(*oNumOffset).getStr()));
else
xmlTextWriterWriteAttribute(pWriter, BAD_CAST("oNumOffset"), BAD_CAST("none"));
xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST("pPageDesc"), "%p", GetPageDesc());
if (const SwPageDesc* pPageDesc = GetPageDesc())
xmlTextWriterWriteAttribute(pWriter, BAD_CAST("presentation"), BAD_CAST(pPageDesc->GetName().toUtf8().getStr()));
xmlTextWriterEndElement(pWriter);
}
// class SwFmtCol // class SwFmtCol
// Partially implemented inline in hxx // Partially implemented inline in hxx
......
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