summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.com>2023-05-11 23:38:59 +0100
committerMiklos Vajna <vmiklos@collabora.com>2023-05-12 09:52:26 +0200
commitee5c6039d73fee9201fa93ac7973728725422e53 (patch)
treed3d6969189c9df811f7305cd02080d9c898d4ab3
parent28bcb35b12f19858eca3d08559d7914e36ad1d2b (diff)
sw layout xml dump: extract SwSectionFrame::dumpAsXml() from SwFrame
Ideally SwFrame should not really know anything about section frames. Change-Id: I713c4646815e681c377e18ae0e1e0b77c15cf5a6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151688 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
-rw-r--r--sw/source/core/inc/sectfrm.hxx1
-rw-r--r--sw/source/core/layout/sectfrm.cxx13
-rw-r--r--sw/source/core/text/xmldump.cxx3
3 files changed, 14 insertions, 3 deletions
diff --git a/sw/source/core/inc/sectfrm.hxx b/sw/source/core/inc/sectfrm.hxx
index e08a9b0a7137..80d8185bc1c0 100644
--- a/sw/source/core/inc/sectfrm.hxx
+++ b/sw/source/core/inc/sectfrm.hxx
@@ -155,6 +155,7 @@ public:
bool IsBalancedSection() const;
+ virtual void dumpAsXml(xmlTextWriterPtr writer = nullptr) const override;
virtual void dumpAsXmlAttributes(xmlTextWriterPtr writer) const override;
bool IsFootnoteAtEnd() const { return m_bFootnoteAtEnd; }
diff --git a/sw/source/core/layout/sectfrm.cxx b/sw/source/core/layout/sectfrm.cxx
index 0b1ac612bfd9..bc8930cd4332 100644
--- a/sw/source/core/layout/sectfrm.cxx
+++ b/sw/source/core/layout/sectfrm.cxx
@@ -2941,4 +2941,17 @@ bool SwSectionFrame::IsBalancedSection() const
return bRet;
}
+void SwSectionFrame::dumpAsXml(xmlTextWriterPtr writer) const
+{
+ (void)xmlTextWriterStartElement(writer, reinterpret_cast<const xmlChar*>("section"));
+ 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 4c66104c12af..622dae730d88 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::Section:
- name = "section";
- break;
case SwFrameType::Tab:
name = "tab";
break;