summaryrefslogtreecommitdiff
path: root/sw/source
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2014-12-15 08:55:25 +0100
committerMiklos Vajna <vmiklos@collabora.co.uk>2014-12-15 09:01:00 +0100
commita741f682a74a2b43310edf606d8ed12ea0436151 (patch)
treef4ffe7615aed4ab46492786ca8659508a8abc546 /sw/source
parent86c8e81178bae50b2de7591fc1cf53cd4d821363 (diff)
Factor out SwNumRuleItem::dumpAsXml() from nodedump
Change-Id: I893d358f8a842e19248cfeb151170ed2872c3dae
Diffstat (limited to 'sw/source')
-rw-r--r--sw/source/core/docnode/nodedump.cxx4
-rw-r--r--sw/source/core/para/paratr.cxx9
2 files changed, 12 insertions, 1 deletions
diff --git a/sw/source/core/docnode/nodedump.cxx b/sw/source/core/docnode/nodedump.cxx
index 7104951a8b8a..877a41f2e98f 100644
--- a/sw/source/core/docnode/nodedump.cxx
+++ b/sw/source/core/docnode/nodedump.cxx
@@ -410,6 +410,9 @@ void lcl_dumpSfxItemSet(WriterHelper& writer, const SfxItemSet* pSet)
case RES_PARATR_OUTLINELEVEL:
static_cast<const SfxUInt16Item*>(pItem)->dumpAsXml(writer);
break;
+ case RES_PARATR_NUMRULE:
+ static_cast<const SwNumRuleItem*>(pItem)->dumpAsXml(writer);
+ break;
default: bDone = false; break;
}
if (bDone)
@@ -424,7 +427,6 @@ void lcl_dumpSfxItemSet(WriterHelper& writer, const SfxItemSet* pSet)
boost::optional<OString> oValue;
switch (pItem->Which())
{
- case RES_PARATR_NUMRULE: pWhich = "paragraph numbering rule"; oValue = OUStringToOString(static_cast<const SwNumRuleItem*>(pItem)->GetValue(), RTL_TEXTENCODING_UTF8); break;
case RES_CHRATR_FONT: pWhich = "character font"; oValue = OUStringToOString(static_cast<const SvxFontItem*>(pItem)->GetFamilyName(), RTL_TEXTENCODING_UTF8); break;
case RES_CHRATR_BACKGROUND: pWhich = "character background"; break;
case RES_CHRATR_CTL_FONT: pWhich = "character ctl font"; break;
diff --git a/sw/source/core/para/paratr.cxx b/sw/source/core/para/paratr.cxx
index 507784fe5acf..9459002439da 100644
--- a/sw/source/core/para/paratr.cxx
+++ b/sw/source/core/para/paratr.cxx
@@ -39,6 +39,7 @@
#include "paratr.hxx"
#include "charfmt.hxx"
#include "cmdid.h"
+#include <libxml/xmlwriter.h>
using namespace ::com::sun::star;
@@ -237,6 +238,14 @@ bool SwNumRuleItem::PutValue( const uno::Any& rVal, sal_uInt8 )
return true;
}
+void SwNumRuleItem::dumpAsXml(xmlTextWriterPtr pWriter) const
+{
+ xmlTextWriterStartElement(pWriter, BAD_CAST("swNumRuleItem"));
+ xmlTextWriterWriteAttribute(pWriter, BAD_CAST("whichId"), BAD_CAST(OString::number(Which()).getStr()));
+ xmlTextWriterWriteAttribute(pWriter, BAD_CAST("value"), BAD_CAST(GetValue().toUtf8().getStr()));
+ xmlTextWriterEndElement(pWriter);
+}
+
SfxPoolItem* SwParaConnectBorderItem::Clone( SfxItemPool * ) const
{
return new SwParaConnectBorderItem( *this );