summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.com>2023-11-30 20:03:16 +0100
committerMiklos Vajna <vmiklos@collabora.com>2023-12-01 08:41:00 +0100
commita83088b05f177fb938c2e4ffb06cd19362a5a1ca (patch)
tree1d2dc1ed5b5aa574d294c698a17d6be001a8ff62 /sw
parent4b0fa253a4540f5461397815d290586f9ddabe61 (diff)
sw: extract SwFootnoteFrame::dumpAsXmlAttributes() from SwFrame
Allows getting rid of a static cast. Change-Id: I4784cf0335ab435a987963177b4812746f7c3b56 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160166 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Diffstat (limited to 'sw')
-rw-r--r--sw/source/core/inc/ftnfrm.hxx1
-rw-r--r--sw/source/core/layout/ftnfrm.cxx11
-rw-r--r--sw/source/core/text/xmldump.cxx9
3 files changed, 12 insertions, 9 deletions
diff --git a/sw/source/core/inc/ftnfrm.hxx b/sw/source/core/inc/ftnfrm.hxx
index 89d9f34f863a..558c4941bf06 100644
--- a/sw/source/core/inc/ftnfrm.hxx
+++ b/sw/source/core/inc/ftnfrm.hxx
@@ -163,6 +163,7 @@ public:
SwContentFrame* FindLastContent();
void dumpAsXml(xmlTextWriterPtr writer = nullptr) const override;
+ void dumpAsXmlAttributes(xmlTextWriterPtr writer) const override;
};
#endif
diff --git a/sw/source/core/layout/ftnfrm.cxx b/sw/source/core/layout/ftnfrm.cxx
index 4baed772787b..70453c572774 100644
--- a/sw/source/core/layout/ftnfrm.cxx
+++ b/sw/source/core/layout/ftnfrm.cxx
@@ -3007,4 +3007,15 @@ void SwFootnoteFrame::dumpAsXml(xmlTextWriterPtr writer) const
(void)xmlTextWriterEndElement(writer);
}
+void SwFootnoteFrame::dumpAsXmlAttributes(xmlTextWriterPtr writer) const
+{
+ SwLayoutFrame::dumpAsXmlAttributes(writer);
+
+ (void)xmlTextWriterWriteFormatAttribute( writer, BAD_CAST("ref"), "%" SAL_PRIuUINT32, GetRef()->GetFrameId() );
+ if (GetMaster())
+ (void)xmlTextWriterWriteFormatAttribute( writer, BAD_CAST("master"), "%" SAL_PRIuUINT32, GetMaster()->GetFrameId() );
+ if (GetFollow())
+ (void)xmlTextWriterWriteFormatAttribute( writer, BAD_CAST("follow"), "%" SAL_PRIuUINT32, GetFollow()->GetFrameId() );
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/text/xmldump.cxx b/sw/source/core/text/xmldump.cxx
index 245a1aa96945..a14c5a485109 100644
--- a/sw/source/core/text/xmldump.cxx
+++ b/sw/source/core/text/xmldump.cxx
@@ -198,15 +198,6 @@ void SwFrame::dumpAsXmlAttributes( xmlTextWriterPtr writer ) const
(void)xmlTextWriterWriteFormatAttribute( writer, BAD_CAST( "upper" ), "%" SAL_PRIuUINT32, GetUpper()->GetFrameId() );
if ( GetLower( ) )
(void)xmlTextWriterWriteFormatAttribute( writer, BAD_CAST( "lower" ), "%" SAL_PRIuUINT32, GetLower()->GetFrameId() );
- if (IsFootnoteFrame())
- {
- SwFootnoteFrame const*const pFF(static_cast<SwFootnoteFrame const*>(this));
- (void)xmlTextWriterWriteFormatAttribute( writer, BAD_CAST("ref"), "%" SAL_PRIuUINT32, pFF->GetRef()->GetFrameId() );
- if (pFF->GetMaster())
- (void)xmlTextWriterWriteFormatAttribute( writer, BAD_CAST("master"), "%" SAL_PRIuUINT32, pFF->GetMaster()->GetFrameId() );
- if (pFF->GetFollow())
- (void)xmlTextWriterWriteFormatAttribute( writer, BAD_CAST("follow"), "%" SAL_PRIuUINT32, pFF->GetFollow()->GetFrameId() );
- }
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */