diff --git a/sw/inc/pagedesc.hxx b/sw/inc/pagedesc.hxx index 522986f87c1b..86e3fc075a7c 100644 --- a/sw/inc/pagedesc.hxx +++ b/sw/inc/pagedesc.hxx @@ -42,6 +42,7 @@ class SfxPoolItem; class SwTextFormatColl; class SwNode; class SwPageDescs; +typedef struct _xmlTextWriter* xmlTextWriterPtr; /// Footnote information. class SW_DLLPUBLIC SwPageFootnoteInfo @@ -273,6 +274,8 @@ public: SwPageDesc( const SwPageDesc& ); virtual ~SwPageDesc() override; + + void dumpAsXml(xmlTextWriterPtr pWriter) const; }; namespace std { @@ -431,6 +434,8 @@ public: bool contains( const value_type& x ) const { return x->m_pdList == this; } + + void dumpAsXml(xmlTextWriterPtr pWriter) const; }; #endif // INCLUDED_SW_INC_PAGEDESC_HXX diff --git a/sw/source/core/doc/docfmt.cxx b/sw/source/core/doc/docfmt.cxx index f2e9b105e355..deacc7c61609 100644 --- a/sw/source/core/doc/docfmt.cxx +++ b/sw/source/core/doc/docfmt.cxx @@ -1939,6 +1939,7 @@ void SwDoc::dumpAsXml(xmlTextWriterPtr pWriter) const xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST("ptr"), "%p", this); m_pNodes->dumpAsXml(pWriter); + m_PageDescs.dumpAsXml(pWriter); maDBData.dumpAsXml(pWriter); mpMarkManager->dumpAsXml(pWriter); m_pUndoManager->dumpAsXml(pWriter); diff --git a/sw/source/core/layout/pagedesc.cxx b/sw/source/core/layout/pagedesc.cxx index a0c7e08ee45b..56211090e081 100644 --- a/sw/source/core/layout/pagedesc.cxx +++ b/sw/source/core/layout/pagedesc.cxx @@ -17,6 +17,8 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#include + #include #include #include @@ -425,6 +427,36 @@ SwPageDesc* SwPageDesc::GetByName(SwDoc& rDoc, const OUString& rName) return nullptr; } +void SwPageDesc::dumpAsXml(xmlTextWriterPtr pWriter) const +{ + xmlTextWriterStartElement(pWriter, BAD_CAST("SwPageDesc")); + xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST("ptr"), "%p", this); + xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST("m_StyleName"), "%s", + BAD_CAST(m_StyleName.toUtf8().getStr())); + xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST("m_pFollow"), "%p", m_pFollow); + xmlTextWriterWriteFormatAttribute( + pWriter, BAD_CAST("m_eUse"), "0x%s", + BAD_CAST(OString::number(static_cast(m_eUse), 16).getStr())); + + xmlTextWriterStartElement(pWriter, BAD_CAST("m_Master")); + m_Master.dumpAsXml(pWriter); + xmlTextWriterEndElement(pWriter); + + xmlTextWriterStartElement(pWriter, BAD_CAST("m_Left")); + m_Left.dumpAsXml(pWriter); + xmlTextWriterEndElement(pWriter); + + xmlTextWriterStartElement(pWriter, BAD_CAST("m_FirstMaster")); + m_FirstMaster.dumpAsXml(pWriter); + xmlTextWriterEndElement(pWriter); + + xmlTextWriterStartElement(pWriter, BAD_CAST("m_FirstLeft")); + m_FirstLeft.dumpAsXml(pWriter); + xmlTextWriterEndElement(pWriter); + + xmlTextWriterEndElement(pWriter); +} + SwPageFootnoteInfo::SwPageFootnoteInfo() : m_nMaxHeight( 0 ) , m_nLineWidth(10) @@ -587,4 +619,16 @@ void SwPageDescs::erase( size_type index_ ) erase( begin() + index_ ); } +void SwPageDescs::dumpAsXml(xmlTextWriterPtr pWriter) const +{ + xmlTextWriterStartElement(pWriter, BAD_CAST("SwPageDescs")); + + for (const auto& pPageDesc : m_PosIndex) + { + pPageDesc->dumpAsXml(pWriter); + } + + xmlTextWriterEndElement(pWriter); +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */