diff options
author | Miklos Vajna <vmiklos@collabora.com> | 2023-08-03 20:02:35 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2023-08-04 08:06:18 +0200 |
commit | af24ca0ab7ccb7d6c1d07bdb528f577b1e649671 (patch) | |
tree | cae04c23611f3a43b0d5c3d45ceeb98ae903abf4 /sw/source | |
parent | 150a1528882347882e857649290fe81d5aa08345 (diff) |
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 <vmiklos@collabora.com>
Diffstat (limited to 'sw/source')
-rw-r--r-- | sw/source/core/inc/txtfrm.hxx | 2 | ||||
-rw-r--r-- | sw/source/core/text/txtfrm.cxx | 10 | ||||
-rw-r--r-- | sw/source/core/text/xmldump.cxx | 12 |
3 files changed, 9 insertions, 15 deletions
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); |