diff options
-rw-r--r-- | sw/inc/fldbas.hxx | 1 | ||||
-rw-r--r-- | sw/inc/usrfld.hxx | 1 | ||||
-rw-r--r-- | sw/source/core/fields/fldbas.cxx | 9 | ||||
-rw-r--r-- | sw/source/core/fields/usrfld.cxx | 10 |
4 files changed, 21 insertions, 0 deletions
diff --git a/sw/inc/fldbas.hxx b/sw/inc/fldbas.hxx index 8765362f6754..46d1a01d70ad 100644 --- a/sw/inc/fldbas.hxx +++ b/sw/inc/fldbas.hxx @@ -446,6 +446,7 @@ public: } static sal_uInt32 GetSystemFormat(SvNumberFormatter* pFormatter, sal_uInt32 nFormat); + void dumpAsXml(struct _xmlTextWriter* pWriter) const override; }; class SW_DLLPUBLIC SwFormulaField : public SwValueField diff --git a/sw/inc/usrfld.hxx b/sw/inc/usrfld.hxx index c776f5b200c4..fccf5b070538 100644 --- a/sw/inc/usrfld.hxx +++ b/sw/inc/usrfld.hxx @@ -109,6 +109,7 @@ public: virtual void SetPar2(const OUString& rStr) override; virtual bool QueryValue( css::uno::Any& rVal, sal_uInt16 nWhichId ) const override; virtual bool PutValue( const css::uno::Any& rVal, sal_uInt16 nWhichId ) override; + void dumpAsXml(struct _xmlTextWriter* pWriter) const override; }; #endif // INCLUDED_SW_INC_USRFLD_HXX diff --git a/sw/source/core/fields/fldbas.cxx b/sw/source/core/fields/fldbas.cxx index 887bf3a008de..fcfc52f61932 100644 --- a/sw/source/core/fields/fldbas.cxx +++ b/sw/source/core/fields/fldbas.cxx @@ -613,6 +613,14 @@ sal_uInt32 SwValueField::GetSystemFormat(SvNumberFormatter* pFormatter, sal_uInt return nFormat; } +void SwValueField::dumpAsXml(xmlTextWriterPtr pWriter) const +{ + xmlTextWriterStartElement(pWriter, BAD_CAST("SwValueField")); + xmlTextWriterWriteAttribute(pWriter, BAD_CAST("m_fValue"), BAD_CAST(OString::number(m_fValue).getStr())); + SwField::dumpAsXml(pWriter); + xmlTextWriterEndElement(pWriter); +} + /// set language of the format void SwValueField::SetLanguage( LanguageType nLng ) { @@ -768,6 +776,7 @@ void SwField::dumpAsXml(xmlTextWriterPtr pWriter) const xmlTextWriterStartElement(pWriter, BAD_CAST("SwField")); xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST("symbol"), "%s", BAD_CAST(typeid(*this).name())); xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST("ptr"), "%p", this); + xmlTextWriterWriteAttribute(pWriter, BAD_CAST("m_nFormat"), BAD_CAST(OString::number(m_nFormat).getStr())); xmlTextWriterEndElement(pWriter); } diff --git a/sw/source/core/fields/usrfld.cxx b/sw/source/core/fields/usrfld.cxx index 809884e163d2..c843d1a5e490 100644 --- a/sw/source/core/fields/usrfld.cxx +++ b/sw/source/core/fields/usrfld.cxx @@ -19,6 +19,8 @@ #include <sal/config.h> +#include <libxml/xmlwriter.h> + #include <o3tl/any.hxx> #include <svl/zforlist.hxx> @@ -155,6 +157,14 @@ bool SwUserField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId ) return true; } +void SwUserField::dumpAsXml(xmlTextWriterPtr pWriter) const +{ + xmlTextWriterStartElement(pWriter, BAD_CAST("SwUserField")); + xmlTextWriterWriteAttribute(pWriter, BAD_CAST("nSubType"), BAD_CAST(OString::number(nSubType).getStr())); + SwValueField::dumpAsXml(pWriter); + xmlTextWriterEndElement(pWriter); +} + SwUserFieldType::SwUserFieldType( SwDoc* pDocPtr, const OUString& aNam ) : SwValueFieldType( pDocPtr, SwFieldIds::User ), nValue( 0 ), |