[Libreoffice-commits] core.git: editeng/source include/editeng sw/source

Miklos Vajna vmiklos at collabora.co.uk
Fri Jan 16 00:27:20 PST 2015


 editeng/source/items/frmitems.cxx   |   17 +++++++++++++++++
 include/editeng/lrspitem.hxx        |    1 +
 sw/source/core/docnode/nodedump.cxx |    6 +++---
 3 files changed, 21 insertions(+), 3 deletions(-)

New commits:
commit 0ffb225d374cfda29275db3c22a9866eb5fe5ad2
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Fri Jan 16 09:26:09 2015 +0100

    Factor out SvxLRSpaceItem::dumpAsXml() from sw
    
    Change-Id: Id28c3e1617f2e73c36f13b506488d401a22b00a8

diff --git a/editeng/source/items/frmitems.cxx b/editeng/source/items/frmitems.cxx
index 66f0ba3..216b30e 100644
--- a/editeng/source/items/frmitems.cxx
+++ b/editeng/source/items/frmitems.cxx
@@ -808,6 +808,23 @@ bool SvxLRSpaceItem::HasMetrics() const
     return true;
 }
 
+void SvxLRSpaceItem::dumpAsXml(xmlTextWriterPtr pWriter) const
+{
+    xmlTextWriterStartElement(pWriter, BAD_CAST("svxLRSpaceItem"));
+    xmlTextWriterWriteAttribute(pWriter, BAD_CAST("whichId"), BAD_CAST(OString::number(Which()).getStr()));
+    xmlTextWriterWriteAttribute(pWriter, BAD_CAST("nFirstLineOfst"), BAD_CAST(OString::number(nFirstLineOfst).getStr()));
+    xmlTextWriterWriteAttribute(pWriter, BAD_CAST("nTxtLeft"), BAD_CAST(OString::number(nTxtLeft).getStr()));
+    xmlTextWriterWriteAttribute(pWriter, BAD_CAST("nLeftMargin"), BAD_CAST(OString::number(nLeftMargin).getStr()));
+    xmlTextWriterWriteAttribute(pWriter, BAD_CAST("nRightMargin"), BAD_CAST(OString::number(nRightMargin).getStr()));
+    xmlTextWriterWriteAttribute(pWriter, BAD_CAST("nPropFirstLineOfst"), BAD_CAST(OString::number(nPropFirstLineOfst).getStr()));
+    xmlTextWriterWriteAttribute(pWriter, BAD_CAST("nPropLeftMargin"), BAD_CAST(OString::number(nPropLeftMargin).getStr()));
+    xmlTextWriterWriteAttribute(pWriter, BAD_CAST("nPropRightMargin"), BAD_CAST(OString::number(nPropRightMargin).getStr()));
+    xmlTextWriterWriteAttribute(pWriter, BAD_CAST("bAutoFirst"), BAD_CAST(OString::number(bAutoFirst).getStr()));
+    xmlTextWriterWriteAttribute(pWriter, BAD_CAST("bExplicitZeroMarginValRight"), BAD_CAST(OString::number(bExplicitZeroMarginValRight).getStr()));
+    xmlTextWriterWriteAttribute(pWriter, BAD_CAST("bExplicitZeroMarginValLeft"), BAD_CAST(OString::number(bExplicitZeroMarginValLeft).getStr()));
+    xmlTextWriterEndElement(pWriter);
+}
+
 // class SvxULSpaceItem --------------------------------------------------
 
 SvxULSpaceItem::SvxULSpaceItem( const sal_uInt16 nId )
diff --git a/include/editeng/lrspitem.hxx b/include/editeng/lrspitem.hxx
index c5eb6ec..ef5d737 100644
--- a/include/editeng/lrspitem.hxx
+++ b/include/editeng/lrspitem.hxx
@@ -126,6 +126,7 @@ public:
                     { return nPropFirstLineOfst; }
     inline void SetTxtFirstLineOfstValue( const short nValue )
                     { nFirstLineOfst = nValue; }
+    void dumpAsXml(struct _xmlTextWriter* pWriter) const;
 };
 
 inline SvxLRSpaceItem &SvxLRSpaceItem::operator=( const SvxLRSpaceItem &rCpy )
diff --git a/sw/source/core/docnode/nodedump.cxx b/sw/source/core/docnode/nodedump.cxx
index 55490ee..d63b82a 100644
--- a/sw/source/core/docnode/nodedump.cxx
+++ b/sw/source/core/docnode/nodedump.cxx
@@ -490,6 +490,9 @@ void lcl_dumpSfxItemSet(WriterHelper& writer, const SfxItemSet* pSet)
             case RES_COLUMNBALANCE:
                 static_cast<const SwFmtNoBalancedColumns*>(pItem)->dumpAsXml(writer);
                 break;
+            case RES_LR_SPACE:
+                static_cast<const SvxLRSpaceItem*>(pItem)->dumpAsXml(writer);
+                break;
             default: bDone = false; break;
         }
         if (bDone)
@@ -504,9 +507,6 @@ void lcl_dumpSfxItemSet(WriterHelper& writer, const SfxItemSet* pSet)
         boost::optional<OString> oValue;
         switch (pItem->Which())
         {
-            case RES_LR_SPACE:
-                pWhich = "left-right space";
-                break;
             case RES_UL_SPACE:
                 pWhich = "upper-lower space";
                 break;


More information about the Libreoffice-commits mailing list