sw/source/core/inc/bodyfrm.hxx | 2 ++ sw/source/core/layout/pagechg.cxx | 13 +++++++++++++ sw/source/core/text/xmldump.cxx | 3 --- 3 files changed, 15 insertions(+), 3 deletions(-)
New commits: commit 10cf767884de2c465304ef4b617d924e2d13630f Author: Miklos Vajna <vmik...@collabora.com> AuthorDate: Thu Apr 27 20:17:09 2023 +0200 Commit: Miklos Vajna <vmik...@collabora.com> CommitDate: Fri Apr 28 08:04:00 2023 +0200 sw layout xml dump: extract SwBodyFrame::dumpAsXml() from SwFrame Ideally SwFrame should not really know anything about body frames. Change-Id: Ieddbf592b8e7a5597b0de91a4acffa8abe2f2868 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151143 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmik...@collabora.com> diff --git a/sw/source/core/inc/bodyfrm.hxx b/sw/source/core/inc/bodyfrm.hxx index 436b8fbb465a..fe7418177c25 100644 --- a/sw/source/core/inc/bodyfrm.hxx +++ b/sw/source/core/inc/bodyfrm.hxx @@ -33,6 +33,8 @@ public: SwBodyFrame( SwFrameFormat*, SwFrame* ); virtual void PaintSubsidiaryLines( const SwPageFrame*, const SwRect& ) const override; + + void dumpAsXml(xmlTextWriterPtr writer = nullptr) const override; }; #endif diff --git a/sw/source/core/layout/pagechg.cxx b/sw/source/core/layout/pagechg.cxx index 152368d9d913..3abc8f20127d 100644 --- a/sw/source/core/layout/pagechg.cxx +++ b/sw/source/core/layout/pagechg.cxx @@ -174,6 +174,19 @@ void SwBodyFrame::Format( vcl::RenderContext* /*pRenderContext*/, const SwBorder setFramePrintAreaValid(true); } +void SwBodyFrame::dumpAsXml(xmlTextWriterPtr writer) const +{ + (void)xmlTextWriterStartElement(writer, reinterpret_cast<const xmlChar*>("body")); + dumpAsXmlAttributes(writer); + + (void)xmlTextWriterStartElement(writer, BAD_CAST("infos")); + dumpInfosAsXml(writer); + (void)xmlTextWriterEndElement(writer); + dumpChildrenAsXml(writer); + + (void)xmlTextWriterEndElement(writer); +} + SwPageFrame::SwPageFrame( SwFrameFormat *pFormat, SwFrame* pSib, SwPageDesc *pPgDsc ) : SwFootnoteBossFrame( pFormat, pSib ), m_pDesc( pPgDsc ), diff --git a/sw/source/core/text/xmldump.cxx b/sw/source/core/text/xmldump.cxx index 3a39c0daec00..39231f410e56 100644 --- a/sw/source/core/text/xmldump.cxx +++ b/sw/source/core/text/xmldump.cxx @@ -174,9 +174,6 @@ void SwFrame::dumpAsXml( xmlTextWriterPtr writer ) const switch ( GetType( ) ) { - case SwFrameType::Body: - name = "body"; - break; case SwFrameType::Fly: name = "fly"; break;