sw/source/core/inc/sectfrm.hxx | 1 - sw/source/core/layout/sectfrm.cxx | 9 +++++++-- sw/source/core/text/xmldump.cxx | 10 ---------- 3 files changed, 7 insertions(+), 13 deletions(-)
New commits: commit b32c9df02bf4abc9d36083c51b28bad6565465c6 Author: Miklos Vajna <vmik...@collabora.com> AuthorDate: Wed Aug 16 20:19:54 2023 +0200 Commit: Miklos Vajna <vmik...@collabora.com> CommitDate: Thu Aug 17 08:13:00 2023 +0200 sw: fold SwSectionFrame::dumpAsXmlAttributes() into dumpAsXml() One dumpAsXml() per SwFrame subclass is enough, no need to have a separate function that dumps just the attributes. Also eliminate a manual reinterpret_cast<> and a static_cast<>. Change-Id: I99c44f4b097586bdc174d3133bbb4ee9f26e57cc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155747 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmik...@collabora.com> diff --git a/sw/source/core/inc/sectfrm.hxx b/sw/source/core/inc/sectfrm.hxx index 80d8185bc1c0..82a41d4e3167 100644 --- a/sw/source/core/inc/sectfrm.hxx +++ b/sw/source/core/inc/sectfrm.hxx @@ -156,7 +156,6 @@ 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; } bool IsEndnAtEnd() const { return m_bEndnAtEnd; } diff --git a/sw/source/core/layout/sectfrm.cxx b/sw/source/core/layout/sectfrm.cxx index 18fac7a397b1..41623fc77177 100644 --- a/sw/source/core/layout/sectfrm.cxx +++ b/sw/source/core/layout/sectfrm.cxx @@ -2958,8 +2958,13 @@ bool SwSectionFrame::IsBalancedSection() const void SwSectionFrame::dumpAsXml(xmlTextWriterPtr writer) const { - (void)xmlTextWriterStartElement(writer, reinterpret_cast<const xmlChar*>("section")); - dumpAsXmlAttributes(writer); + (void)xmlTextWriterStartElement(writer, BAD_CAST("section")); + SwFrame::dumpAsXmlAttributes( writer ); + if ( HasFollow() ) + (void)xmlTextWriterWriteFormatAttribute( writer, BAD_CAST( "follow" ), "%" SAL_PRIuUINT32, GetFollow()->GetFrameId() ); + + if (m_pPrecede != nullptr) + (void)xmlTextWriterWriteFormatAttribute( writer, BAD_CAST( "precede" ), "%" SAL_PRIuUINT32, m_pPrecede->GetFrame().GetFrameId() ); (void)xmlTextWriterStartElement(writer, BAD_CAST("infos")); dumpInfosAsXml(writer); diff --git a/sw/source/core/text/xmldump.cxx b/sw/source/core/text/xmldump.cxx index 29cbd4c5e911..48c893bf403c 100644 --- a/sw/source/core/text/xmldump.cxx +++ b/sw/source/core/text/xmldump.cxx @@ -312,14 +312,4 @@ void SwFlyAtContentFrame::dumpAsXmlAttributes(xmlTextWriterPtr pWriter) const } } -void SwSectionFrame::dumpAsXmlAttributes( xmlTextWriterPtr writer ) const -{ - SwFrame::dumpAsXmlAttributes( writer ); - if ( HasFollow() ) - (void)xmlTextWriterWriteFormatAttribute( writer, BAD_CAST( "follow" ), "%" SAL_PRIuUINT32, GetFollow()->GetFrameId() ); - - if (m_pPrecede != nullptr) - (void)xmlTextWriterWriteFormatAttribute( writer, BAD_CAST( "precede" ), "%" SAL_PRIuUINT32, static_cast<SwSectionFrame*>( m_pPrecede )->GetFrameId() ); -} - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */