diff options
author | Miklos Vajna <vmiklos@collabora.com> | 2021-12-06 20:10:22 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2021-12-07 08:20:48 +0100 |
commit | 68c15984ea17354c03e5ddf03e0c0b4214999659 (patch) | |
tree | 76266741fd01d759c85498d63197479d83bb0e7e /sw | |
parent | 5cad267240a11daa0be76077f858f37679f330d7 (diff) |
sw layout xml dump: handle SwFieldPortions
This is the case where the field has a single placeholder character, but
it typically expands to more characters at a view level.
Change-Id: I5f11b29772697dbca3475aa53cf9301b67e64452
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126459
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/core/text/porfld.cxx | 12 | ||||
-rw-r--r-- | sw/source/core/text/porfld.hxx | 2 |
2 files changed, 14 insertions, 0 deletions
diff --git a/sw/source/core/text/porfld.cxx b/sw/source/core/text/porfld.cxx index c366401c9153..12805b33b039 100644 --- a/sw/source/core/text/porfld.cxx +++ b/sw/source/core/text/porfld.cxx @@ -464,6 +464,18 @@ void SwFieldPortion::HandlePortion( SwPortionHandler& rPH ) const rPH.Special( GetLen(), m_aExpand, GetWhichPor(), nH, nW, m_pFont.get() ); } +void SwFieldPortion::dumpAsXml(xmlTextWriterPtr pWriter) const +{ + (void)xmlTextWriterStartElement(pWriter, BAD_CAST("SwFieldPortion")); + SwExpandPortion::dumpAsXml(pWriter); + + (void)xmlTextWriterStartElement(pWriter, BAD_CAST("expand")); + (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("value"), BAD_CAST(m_aExpand.toUtf8().getStr())); + (void)xmlTextWriterEndElement(pWriter); + + (void)xmlTextWriterEndElement(pWriter); +} + SwPosSize SwFieldPortion::GetTextSize( const SwTextSizeInfo &rInf ) const { SwFontSave aSave( rInf, m_pFont.get() ); diff --git a/sw/source/core/text/porfld.hxx b/sw/source/core/text/porfld.hxx index 519e56f8f58c..ec2ee7a61c51 100644 --- a/sw/source/core/text/porfld.hxx +++ b/sw/source/core/text/porfld.hxx @@ -107,6 +107,8 @@ public: // Accessibility: pass information about this portion to the PortionHandler virtual void HandlePortion( SwPortionHandler& rPH ) const override; + + void dumpAsXml(xmlTextWriterPtr pWriter) const override; }; /** |