sw/inc/expfld.hxx                |    1 +
 sw/source/core/fields/expfld.cxx |   13 +++++++++++++
 2 files changed, 14 insertions(+)

New commits:
commit 4bf33163b795cca7b1f009410136162aa232660e
Author:     Miklos Vajna <[email protected]>
AuthorDate: Wed Nov 5 08:39:00 2025 +0100
Commit:     Miklos Vajna <[email protected]>
CommitDate: Thu Nov 6 08:20:48 2025 +0100

    sw doc model xml dump: handle SwSetExpField
    
    Otherwise the expanded field value is not visible in the dump, which was
    interesting when working on tdf#165472.
    
    Change-Id: I024ab4293d6131367eaccefbc23dae318362ac6a
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/193441
    Reviewed-by: Michael Stahl <[email protected]>
    Tested-by: Jenkins CollaboraOffice <[email protected]>

diff --git a/sw/inc/expfld.hxx b/sw/inc/expfld.hxx
index f8694304f6c1..e9880e6df610 100644
--- a/sw/inc/expfld.hxx
+++ b/sw/inc/expfld.hxx
@@ -255,6 +255,7 @@ public:
     virtual void                SetPar2(const OUString& rStr) override;
     virtual bool        QueryValue( css::uno::Any& rVal, sal_uInt16 nWhich ) 
const override;
     virtual bool        PutValue( const css::uno::Any& rVal, sal_uInt16 nWhich 
) override;
+    void dumpAsXml(xmlTextWriterPtr pWriter) const override;
 };
 
 inline void  SwSetExpField::SetPromptText(const OUString& rStr)
diff --git a/sw/source/core/fields/expfld.cxx b/sw/source/core/fields/expfld.cxx
index 2f6820154e1e..aa7953717a97 100644
--- a/sw/source/core/fields/expfld.cxx
+++ b/sw/source/core/fields/expfld.cxx
@@ -1152,6 +1152,19 @@ bool SwSetExpField::PutValue( const uno::Any& rAny, 
sal_uInt16 nWhichId )
     return true;
 }
 
+void SwSetExpField::dumpAsXml(xmlTextWriterPtr pWriter) const
+{
+    (void)xmlTextWriterStartElement(pWriter, BAD_CAST("SwSetExpField"));
+    SwFormulaField::dumpAsXml(pWriter);
+
+    (void)xmlTextWriterStartElement(pWriter, BAD_CAST("content"));
+    (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("expand"),
+                                      BAD_CAST(msExpand.toUtf8().getStr()));
+    (void)xmlTextWriterEndElement(pWriter);
+
+    (void)xmlTextWriterEndElement(pWriter);
+}
+
 bool SwSetExpField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const
 {
     switch( nWhichId )

Reply via email to