sw/source/core/inc/ftnfrm.hxx | 2 ++ sw/source/core/layout/ftnfrm.cxx | 15 +++++++++++++++ sw/source/core/text/xmldump.cxx | 3 --- 3 files changed, 17 insertions(+), 3 deletions(-)
New commits: commit 9282e294c3f575e8346f6c6aae22530e700c1cec Author: Miklos Vajna <vmik...@collabora.com> AuthorDate: Thu Apr 13 20:11:04 2023 +0200 Commit: Miklos Vajna <vmik...@collabora.com> CommitDate: Fri Apr 14 08:12:44 2023 +0200 sw layout xml dump: extract SwFootnoteFrame::dumpAsXml() from SwFrame Ideally SwFrame should not really know anything about footnote frames. Change-Id: I3bfdc9d16a5940f6fa2af4b85ad4261d7d10c3f6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150375 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmik...@collabora.com> diff --git a/sw/source/core/inc/ftnfrm.hxx b/sw/source/core/inc/ftnfrm.hxx index 56061d97c21f..a514e4ba10d3 100644 --- a/sw/source/core/inc/ftnfrm.hxx +++ b/sw/source/core/inc/ftnfrm.hxx @@ -162,6 +162,8 @@ public: pointer to found last content frame. NULL, if none is found. */ SwContentFrame* FindLastContent(); + + void dumpAsXml(xmlTextWriterPtr writer = nullptr) const override; }; #endif diff --git a/sw/source/core/layout/ftnfrm.cxx b/sw/source/core/layout/ftnfrm.cxx index 6fb88185a6f2..00c5db65a27d 100644 --- a/sw/source/core/layout/ftnfrm.cxx +++ b/sw/source/core/layout/ftnfrm.cxx @@ -17,6 +17,8 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#include <libxml/xmlwriter.h> + #include <txtftn.hxx> #include <fmtftn.hxx> #include <ftnidx.hxx> @@ -2984,4 +2986,17 @@ SwContentFrame* SwFootnoteFrame::FindLastContent() return pLastContentFrame; } +void SwFootnoteFrame::dumpAsXml(xmlTextWriterPtr writer) const +{ + (void)xmlTextWriterStartElement(writer, reinterpret_cast<const xmlChar*>("ftn")); + dumpAsXmlAttributes(writer); + + (void)xmlTextWriterStartElement(writer, BAD_CAST("infos")); + dumpInfosAsXml(writer); + (void)xmlTextWriterEndElement(writer); + dumpChildrenAsXml(writer); + + (void)xmlTextWriterEndElement(writer); +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/core/text/xmldump.cxx b/sw/source/core/text/xmldump.cxx index 8344ddbea178..3a39c0daec00 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::Ftn: - name = "ftn"; - break; case SwFrameType::Body: name = "body"; break;