Kaydet (Commit) 1ad14b32 authored tarafından Miklos Vajna's avatar Miklos Vajna

sw doc model xml dump: dump float value of user fields

Change-Id: Ie59070254eb293cbfdd688d97bf4bb6c06e77a79
Reviewed-on: https://gerrit.libreoffice.org/58339Reviewed-by: 's avatarMiklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Jenkins
üst a69bac4c
......@@ -7,9 +7,9 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
#include <sal/log.hxx>
#include "LockedCanvasContext.hxx"
#include <sal/log.hxx>
#include <oox/drawingml/shape.hxx>
#include <oox/drawingml/shapecontext.hxx>
#include <oox/drawingml/shapegroupcontext.hxx>
......
......@@ -7,9 +7,9 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
#include <sal/log.hxx>
#include "WpgContext.hxx"
#include <sal/log.hxx>
#include <drawingml/shapepropertiescontext.hxx>
#include <oox/drawingml/shapegroupcontext.hxx>
#include <oox/drawingml/graphicshapecontext.hxx>
......
......@@ -262,6 +262,7 @@ public:
SwFieldIds Which() const { return m_nWhich; }
inline void UpdateFields() const;
virtual void dumpAsXml(struct _xmlTextWriter* pWriter) const;
};
inline void SwFieldType::UpdateFields() const
......
......@@ -60,6 +60,7 @@ public:
virtual void QueryValue( css::uno::Any& rVal, sal_uInt16 nMId ) const override;
virtual void PutValue( const css::uno::Any& rVal, sal_uInt16 nMId ) override;
void dumpAsXml(struct _xmlTextWriter* pWriter) const override;
protected:
virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew ) override;
......
......@@ -154,17 +154,24 @@ void SwFieldType::PutValue( const uno::Any& , sal_uInt16 )
{
}
void SwFieldType::dumpAsXml(xmlTextWriterPtr pWriter) const
{
SwIterator<SwFormatField, SwFieldType> aIter(*this);
if (!aIter.First())
return;
xmlTextWriterStartElement(pWriter, BAD_CAST("SwFieldType"));
for (const SwFormatField* pFormatField = aIter.First(); pFormatField;
pFormatField = aIter.Next())
pFormatField->dumpAsXml(pWriter);
xmlTextWriterEndElement(pWriter);
}
void SwFieldTypes::dumpAsXml(xmlTextWriterPtr pWriter) const
{
xmlTextWriterStartElement(pWriter, BAD_CAST("SwFieldTypes"));
sal_uInt16 nCount = size();
for (sal_uInt16 nType = 0; nType < nCount; ++nType)
{
const SwFieldType *pCurType = (*this)[nType];
SwIterator<SwFormatField, SwFieldType> aIter(*pCurType);
for (const SwFormatField* pFormatField = aIter.First(); pFormatField; pFormatField = aIter.Next())
pFormatField->dumpAsXml(pWriter);
}
(*this)[nType]->dumpAsXml(pWriter);
xmlTextWriterEndElement(pWriter);
}
......@@ -777,6 +784,7 @@ void SwField::dumpAsXml(xmlTextWriterPtr pWriter) const
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()));
xmlTextWriterWriteAttribute(pWriter, BAD_CAST("m_nLang"), BAD_CAST(OString::number(m_nLang.get()).getStr()));
xmlTextWriterEndElement(pWriter);
}
......
......@@ -339,4 +339,13 @@ void SwUserFieldType::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
}
}
void SwUserFieldType::dumpAsXml(xmlTextWriterPtr pWriter) const
{
xmlTextWriterStartElement(pWriter, BAD_CAST("SwUserFieldType"));
xmlTextWriterWriteAttribute(pWriter, BAD_CAST("nValue"), BAD_CAST(OString::number(nValue).getStr()));
xmlTextWriterWriteAttribute(pWriter, BAD_CAST("aContent"), BAD_CAST(aContent.toUtf8().getStr()));
SwFieldType::dumpAsXml(pWriter);
xmlTextWriterEndElement(pWriter);
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment