[Libreoffice-commits] core.git: sw/inc sw/source
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Mon Jul 30 15:19:37 UTC 2018
sw/inc/fldbas.hxx | 1 +
sw/inc/usrfld.hxx | 1 +
sw/source/core/fields/fldbas.cxx | 9 +++++++++
sw/source/core/fields/usrfld.cxx | 10 ++++++++++
4 files changed, 21 insertions(+)
New commits:
commit 05ae22e9f99ae6236a77a3fbfb5ac1e3f95df619
Author: Miklos Vajna <vmiklos at collabora.co.uk>
AuthorDate: Mon Jul 30 14:23:11 2018 +0200
Commit: Miklos Vajna <vmiklos at collabora.co.uk>
CommitDate: Mon Jul 30 17:19:14 2018 +0200
sw doc model xml dump: cover SwValueField
Also SwUserField.
Change-Id: Ie8a8ca997e5b89bcf6b40363721e9caaeb60f696
Reviewed-on: https://gerrit.libreoffice.org/58325
Reviewed-by: Miklos Vajna <vmiklos at collabora.co.uk>
Tested-by: Jenkins
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 ),
More information about the Libreoffice-commits
mailing list