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>
diff --git a/sw/source/core/text/porfld.cxx b/sw/source/core/text/porfld.cxx
index c366401..12805b3 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 519e56f..ec2ee7a 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;
};
/**