Related: tdf#117245 editeng: cover tab stop items for sw doc model xml ...

... dump purposes

Change-Id: Ib6c7dff9f2e76c3358dbdc06d2ba53fa2601c043
Reviewed-on: https://gerrit.libreoffice.org/53859
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Jenkins <ci@libreoffice.org>
This commit is contained in:
Miklos Vajna
2018-05-04 17:47:50 +02:00
parent 5e34e3741d
commit dff25d295f
2 changed files with 19 additions and 0 deletions

View File

@@ -21,6 +21,7 @@
#include <com/sun/star/style/LineSpacing.hpp> #include <com/sun/star/style/LineSpacing.hpp>
#include <com/sun/star/style/LineSpacingMode.hpp> #include <com/sun/star/style/LineSpacingMode.hpp>
#include <com/sun/star/uno/Sequence.hxx> #include <com/sun/star/uno/Sequence.hxx>
#include <libxml/xmlwriter.h>
#include <comphelper/fileformat.h> #include <comphelper/fileformat.h>
#include <comphelper/extract.hxx> #include <comphelper/extract.hxx>
#include <osl/diagnose.h> #include <osl/diagnose.h>
@@ -692,6 +693,15 @@ void SvxTabStop::fillDecimal() const
m_cDecimal = SvtSysLocale().GetLocaleData().getNumDecimalSep()[0]; m_cDecimal = SvtSysLocale().GetLocaleData().getNumDecimalSep()[0];
} }
void SvxTabStop::dumpAsXml(xmlTextWriterPtr pWriter) const
{
xmlTextWriterStartElement(pWriter, BAD_CAST("SvxTabStop"));
xmlTextWriterWriteAttribute(pWriter, BAD_CAST("nTabPos"),
BAD_CAST(OString::number(nTabPos).getStr()));
xmlTextWriterWriteAttribute(pWriter, BAD_CAST("eAdjustment"),
BAD_CAST(OString::number(static_cast<int>(eAdjustment)).getStr()));
xmlTextWriterEndElement(pWriter);
}
// class SvxTabStopItem -------------------------------------------------- // class SvxTabStopItem --------------------------------------------------
@@ -958,6 +968,13 @@ void SvxTabStopItem::Insert( const SvxTabStopItem* pTabs )
} }
} }
void SvxTabStopItem::dumpAsXml(xmlTextWriterPtr pWriter) const
{
xmlTextWriterStartElement(pWriter, BAD_CAST("SvxTabStopItem"));
for (const auto& rTabStop : maTabStops)
rTabStop.dumpAsXml(pWriter);
xmlTextWriterEndElement(pWriter);
}
// class SvxFormatSplitItem ------------------------------------------------- // class SvxFormatSplitItem -------------------------------------------------
SvxFormatSplitItem::~SvxFormatSplitItem() SvxFormatSplitItem::~SvxFormatSplitItem()

View File

@@ -85,6 +85,7 @@ public:
cFill = rTS.cFill; cFill = rTS.cFill;
return *this; return *this;
} }
void dumpAsXml(struct _xmlTextWriter* pWriter) const;
}; };
// class SvxTabStopItem -------------------------------------------------- // class SvxTabStopItem --------------------------------------------------
@@ -149,6 +150,7 @@ public:
virtual SfxPoolItem* Clone( SfxItemPool *pPool = nullptr ) const override; virtual SfxPoolItem* Clone( SfxItemPool *pPool = nullptr ) const override;
void dumpAsXml(struct _xmlTextWriter* pWriter) const override;
}; };
#endif #endif