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

Miklos Vajna vmiklos at collabora.co.uk
Tue Jan 20 00:11:54 PST 2015


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

New commits:
commit 71edf281f38a3ee839a99393cb06316c7231f3d2
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Tue Jan 20 09:10:35 2015 +0100

    Factor out SvxShadowItem::dumpAsXml() from sw
    
    Change-Id: Id25a050a9840d83cff4b390faec7478f17336524

diff --git a/editeng/source/items/frmitems.cxx b/editeng/source/items/frmitems.cxx
index 8b68df0..2c0adcc 100644
--- a/editeng/source/items/frmitems.cxx
+++ b/editeng/source/items/frmitems.cxx
@@ -1589,6 +1589,17 @@ void SvxShadowItem::SetEnumValue( sal_uInt16 nVal )
     SetLocation( (const SvxShadowLocation)nVal );
 }
 
+void SvxShadowItem::dumpAsXml(xmlTextWriterPtr pWriter) const
+{
+    xmlTextWriterStartElement(pWriter, BAD_CAST("svxShadowItem"));
+    xmlTextWriterWriteAttribute(pWriter, BAD_CAST("whichId"), BAD_CAST(OString::number(Which()).getStr()));
+    xmlTextWriterWriteAttribute(pWriter, BAD_CAST("aShadowColor"), BAD_CAST(aShadowColor.AsRGBHexString().toUtf8().getStr()));
+    xmlTextWriterWriteAttribute(pWriter, BAD_CAST("nWidth"), BAD_CAST(OString::number(nWidth).getStr()));
+    xmlTextWriterWriteAttribute(pWriter, BAD_CAST("eLocation"), BAD_CAST(OString::number(eLocation).getStr()));
+    xmlTextWriterWriteAttribute(pWriter, BAD_CAST("presentation"), BAD_CAST(EE_RESSTR(RID_SVXITEMS_SHADOW_BEGIN + eLocation).toUtf8().getStr()));
+    xmlTextWriterEndElement(pWriter);
+}
+
 // class SvxBoxItem ------------------------------------------------------
 
 SvxBoxItem::SvxBoxItem( const SvxBoxItem& rCpy ) :
diff --git a/include/editeng/shaditem.hxx b/include/editeng/shaditem.hxx
index 43ec3bc..c7761fca 100644
--- a/include/editeng/shaditem.hxx
+++ b/include/editeng/shaditem.hxx
@@ -83,6 +83,7 @@ public:
     virtual OUString   GetValueTextByPos( sal_uInt16 nPos ) const SAL_OVERRIDE;
     virtual sal_uInt16      GetEnumValue() const SAL_OVERRIDE;
     virtual void            SetEnumValue( sal_uInt16 nNewVal ) SAL_OVERRIDE;
+    void dumpAsXml(struct _xmlTextWriter* pWriter) const;
 };
 
 inline SvxShadowItem &SvxShadowItem::operator=( const SvxShadowItem& rFmtShadow )
diff --git a/sw/source/core/docnode/nodedump.cxx b/sw/source/core/docnode/nodedump.cxx
index 5822f89..b05809a 100644
--- a/sw/source/core/docnode/nodedump.cxx
+++ b/sw/source/core/docnode/nodedump.cxx
@@ -496,6 +496,9 @@ void lcl_dumpSfxItemSet(WriterHelper& writer, const SfxItemSet* pSet)
             case RES_UL_SPACE:
                 static_cast<const SvxULSpaceItem*>(pItem)->dumpAsXml(writer);
                 break;
+            case RES_SHADOW:
+                static_cast<const SvxShadowItem*>(pItem)->dumpAsXml(writer);
+                break;
             default: bDone = false; break;
         }
         if (bDone)
@@ -510,9 +513,6 @@ void lcl_dumpSfxItemSet(WriterHelper& writer, const SfxItemSet* pSet)
         boost::optional<OString> oValue;
         switch (pItem->Which())
         {
-            case RES_SHADOW:
-                pWhich = "shadow";
-                break;
             case RES_PAGEDESC:
             {
                 pWhich = "page description";


More information about the Libreoffice-commits mailing list