summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.com>2021-12-06 20:10:22 +0100
committerMiklos Vajna <vmiklos@collabora.com>2021-12-07 08:20:48 +0100
commit68c15984ea17354c03e5ddf03e0c0b4214999659 (patch)
tree76266741fd01d759c85498d63197479d83bb0e7e
parentloplugin:unusedmethods (diff)
downloadcore-68c15984ea17354c03e5ddf03e0c0b4214999659.tar.gz
core-68c15984ea17354c03e5ddf03e0c0b4214999659.zip
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>
-rw-r--r--sw/source/core/text/porfld.cxx12
-rw-r--r--sw/source/core/text/porfld.hxx2
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;
};
/**