summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.com>2023-04-27 20:17:09 +0200
committerMiklos Vajna <vmiklos@collabora.com>2023-04-28 08:04:00 +0200
commit10cf767884de2c465304ef4b617d924e2d13630f (patch)
tree1aa51c63fb11ea5657d110062b16e921186a209b
parent1b85a555d3ee618b542dce414687c97f934b8b56 (diff)
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 <vmiklos@collabora.com>
-rw-r--r--sw/source/core/inc/bodyfrm.hxx2
-rw-r--r--sw/source/core/layout/pagechg.cxx13
-rw-r--r--sw/source/core/text/xmldump.cxx3
3 files changed, 15 insertions, 3 deletions
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;