sw/source/core/inc/txtfrm.hxx | 2 -- sw/source/core/text/txtfrm.cxx | 10 +++++++++- sw/source/core/text/xmldump.cxx | 12 ------------ 3 files changed, 9 insertions(+), 15 deletions(-)
New commits: commit af24ca0ab7ccb7d6c1d07bdb528f577b1e649671 Author: Miklos Vajna <vmik...@collabora.com> AuthorDate: Thu Aug 3 20:02:35 2023 +0200 Commit: Miklos Vajna <vmik...@collabora.com> CommitDate: Fri Aug 4 08:06:18 2023 +0200 sw: fold SwTextFrame::dumpAsXmlAttributes() into dumpAsXml() One dumpAsXml() per SwFrame subclass is enough, no need to have a separate functiont hat dumps just the attributes. Change-Id: I23888dadc36848d28dee1b1d2e4eecd964ed4fe1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155323 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmik...@collabora.com> diff --git a/sw/source/core/inc/txtfrm.hxx b/sw/source/core/inc/txtfrm.hxx index fe42319e1a41..2cfa91e88dca 100644 --- a/sw/source/core/inc/txtfrm.hxx +++ b/sw/source/core/inc/txtfrm.hxx @@ -808,8 +808,6 @@ public: static SwView* GetView(); - virtual void dumpAsXmlAttributes(xmlTextWriterPtr writer) const override; - void dumpAsXml(xmlTextWriterPtr writer = nullptr) const override; }; diff --git a/sw/source/core/text/txtfrm.cxx b/sw/source/core/text/txtfrm.cxx index c1c2c2a40f6f..f4b90547173f 100644 --- a/sw/source/core/text/txtfrm.cxx +++ b/sw/source/core/text/txtfrm.cxx @@ -796,7 +796,15 @@ SwTextFrame::SwTextFrame(SwTextNode * const pNode, SwFrame* pSib, void SwTextFrame::dumpAsXml(xmlTextWriterPtr writer) const { (void)xmlTextWriterStartElement(writer, reinterpret_cast<const xmlChar*>("txt")); - dumpAsXmlAttributes(writer); + 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<SwTextFrame*>(m_pPrecede)->GetFrameId() ); + + (void)xmlTextWriterWriteAttribute(writer, BAD_CAST("offset"), BAD_CAST(OString::number(static_cast<sal_Int32>(mnOffset)).getStr())); + sw::MergedPara const*const pMerged(GetMergedPara()); if (pMerged) { diff --git a/sw/source/core/text/xmldump.cxx b/sw/source/core/text/xmldump.cxx index 83111d397d38..402727606fde 100644 --- a/sw/source/core/text/xmldump.cxx +++ b/sw/source/core/text/xmldump.cxx @@ -294,18 +294,6 @@ void SwFont::dumpAsXml(xmlTextWriterPtr writer) const (void)xmlTextWriterEndElement(writer); } -void SwTextFrame::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<SwTextFrame*>(m_pPrecede)->GetFrameId() ); - - (void)xmlTextWriterWriteAttribute(writer, BAD_CAST("offset"), BAD_CAST(OString::number(static_cast<sal_Int32>(mnOffset)).getStr())); -} - void SwFlyAtContentFrame::dumpAsXmlAttributes(xmlTextWriterPtr pWriter) const { SwFlyFreeFrame::dumpAsXmlAttributes(pWriter);