sw/source/core/inc/ftnfrm.hxx | 1 + sw/source/core/layout/ftnfrm.cxx | 11 +++++++++++ sw/source/core/text/xmldump.cxx | 9 --------- 3 files changed, 12 insertions(+), 9 deletions(-)
New commits: commit a83088b05f177fb938c2e4ffb06cd19362a5a1ca Author: Miklos Vajna <vmik...@collabora.com> AuthorDate: Thu Nov 30 20:03:16 2023 +0100 Commit: Miklos Vajna <vmik...@collabora.com> CommitDate: Fri Dec 1 08:41:00 2023 +0100 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 <vmik...@collabora.com> 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: */