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

Miklos Vajna vmiklos at collabora.co.uk
Wed Dec 17 00:08:10 PST 2014


 editeng/source/items/frmitems.cxx   |   14 ++++++++++++++
 include/editeng/brushitem.hxx       |    2 ++
 sw/source/core/docnode/nodedump.cxx |    4 +++-
 3 files changed, 19 insertions(+), 1 deletion(-)

New commits:
commit 53421edf6c821d9a74c32c2fd8d5eb15fb5e5fd3
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Wed Dec 17 09:07:10 2014 +0100

    Factor out SvxBrushItem::dumpAsXml() from sw
    
    Change-Id: I5421cf5a7d1a2ff4db81d028f44a490c234b9ccf

diff --git a/editeng/source/items/frmitems.cxx b/editeng/source/items/frmitems.cxx
index e4b6e0c..784326d 100644
--- a/editeng/source/items/frmitems.cxx
+++ b/editeng/source/items/frmitems.cxx
@@ -81,6 +81,7 @@
 #include <editeng/unoprnms.hxx>
 #include <editeng/memberids.hrc>
 #include <editeng/editerr.hxx>
+#include <libxml/xmlwriter.h>
 
 using namespace ::editeng;
 using namespace ::com::sun::star;
@@ -4102,6 +4103,19 @@ void  SvxBrushItem::ApplyGraphicTransparency_Impl()
     }
 }
 
+void SvxBrushItem::dumpAsXml(xmlTextWriterPtr pWriter) const
+{
+    xmlTextWriterStartElement(pWriter, BAD_CAST("svxBrushItem"));
+    xmlTextWriterWriteAttribute(pWriter, BAD_CAST("whichId"), BAD_CAST(OString::number(Which()).getStr()));
+    xmlTextWriterWriteAttribute(pWriter, BAD_CAST("color"), BAD_CAST(aColor.AsRGBHexString().toUtf8().getStr()));
+    xmlTextWriterWriteAttribute(pWriter, BAD_CAST("shadingValue"), BAD_CAST(OString::number(nShadingValue).getStr()));
+    xmlTextWriterWriteAttribute(pWriter, BAD_CAST("link"), BAD_CAST(maStrLink.toUtf8().getStr()));
+    xmlTextWriterWriteAttribute(pWriter, BAD_CAST("filter"), BAD_CAST(maStrFilter.toUtf8().getStr()));
+    xmlTextWriterWriteAttribute(pWriter, BAD_CAST("graphicPos"), BAD_CAST(OString::number(eGraphicPos).getStr()));
+    xmlTextWriterWriteAttribute(pWriter, BAD_CAST("loadAgain"), BAD_CAST(OString::boolean(bLoadAgain).getStr()));
+    xmlTextWriterEndElement(pWriter);
+}
+
 // class SvxFrameDirectionItem ----------------------------------------------
 
 SvxFrameDirectionItem::SvxFrameDirectionItem( SvxFrameDirection nValue ,
diff --git a/include/editeng/brushitem.hxx b/include/editeng/brushitem.hxx
index ae4cb9a..16dc38d 100644
--- a/include/editeng/brushitem.hxx
+++ b/include/editeng/brushitem.hxx
@@ -127,6 +127,8 @@ public:
     static SvxGraphicPosition   WallpaperStyle2GraphicPos( WallpaperStyle eStyle );
     static WallpaperStyle       GraphicPos2WallpaperStyle( SvxGraphicPosition ePos );
     static sal_Int8             TransparencyToPercent(sal_Int32 nTrans);
+
+    void dumpAsXml(struct _xmlTextWriter* pWriter) const;
 };
 
 #endif // INCLUDED_EDITENG_BRUSHITEM_HXX
diff --git a/sw/source/core/docnode/nodedump.cxx b/sw/source/core/docnode/nodedump.cxx
index 17540bc..a83799b 100644
--- a/sw/source/core/docnode/nodedump.cxx
+++ b/sw/source/core/docnode/nodedump.cxx
@@ -416,6 +416,9 @@ void lcl_dumpSfxItemSet(WriterHelper& writer, const SfxItemSet* pSet)
             case RES_CHRATR_FONT:
                 static_cast<const SvxFontItem*>(pItem)->dumpAsXml(writer);
                 break;
+            case RES_CHRATR_BACKGROUND:
+                static_cast<const SvxBrushItem*>(pItem)->dumpAsXml(writer);
+                break;
             default: bDone = false; break;
         }
         if (bDone)
@@ -430,7 +433,6 @@ void lcl_dumpSfxItemSet(WriterHelper& writer, const SfxItemSet* pSet)
         boost::optional<OString> oValue;
         switch (pItem->Which())
         {
-            case RES_CHRATR_BACKGROUND: pWhich = "character background"; break;
             case RES_CHRATR_CTL_FONT: pWhich = "character ctl font"; break;
             case RES_CHRATR_FONTSIZE:
             {


More information about the Libreoffice-commits mailing list