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

Noel Grandin noel at peralex.com
Mon Sep 12 13:12:34 UTC 2016


 include/svx/sdr/properties/defaultproperties.hxx |    3 +++
 include/svx/svdtext.hxx                          |    2 ++
 svx/source/sdr/properties/defaultproperties.cxx  |    8 ++++++++
 svx/source/svdraw/svdtext.cxx                    |    8 ++++++++
 svx/source/table/cell.cxx                        |   13 +++++++++++++
 svx/source/table/cell.hxx                        |    8 +++++---
 svx/source/table/svdotable.cxx                   |    1 +
 svx/source/table/tablemodel.cxx                  |   12 ++++++++++++
 svx/source/table/tablemodel.hxx                  |    3 +++
 9 files changed, 55 insertions(+), 3 deletions(-)

New commits:
commit 1d7dd96e313dd23ca8d49abf879d51db448f76ee
Author: Noel Grandin <noel at peralex.com>
Date:   Mon Sep 12 11:10:18 2016 +0200

    impress: extend dumpAsXml to table cell and styles
    
    Change-Id: If11ca945cae4f5127394dcc3871f4b6a76c24fac

diff --git a/include/svx/sdr/properties/defaultproperties.hxx b/include/svx/sdr/properties/defaultproperties.hxx
index f629a31..0a8e4e5 100644
--- a/include/svx/sdr/properties/defaultproperties.hxx
+++ b/include/svx/sdr/properties/defaultproperties.hxx
@@ -23,6 +23,7 @@
 #include <svx/sdr/properties/properties.hxx>
 #include <svx/svxdllapi.h>
 
+struct _xmlTextWriter;
 
 namespace sdr
 {
@@ -59,6 +60,8 @@ namespace sdr
             // destructor
             virtual ~DefaultProperties();
 
+            void dumpAsXml(struct _xmlTextWriter * pWriter) const;
+
             // Clone() operator, normally just calls the local copy constructor
             virtual BaseProperties& Clone(SdrObject& rObj) const override;
 
diff --git a/include/svx/svdtext.hxx b/include/svx/svdtext.hxx
index 8338428..4733ad4 100644
--- a/include/svx/svdtext.hxx
+++ b/include/svx/svdtext.hxx
@@ -65,6 +65,8 @@ public:
     /** returns the current OutlinerParaObject and removes it from this instance */
     OutlinerParaObject* RemoveOutlinerParaObject();
 
+    void dumpAsXml(struct _xmlTextWriter * pWriter) const;
+
 protected:
     virtual const SfxItemSet& GetObjectItemSet();
     virtual void SetObjectItem(const SfxPoolItem& rItem);
diff --git a/svx/source/sdr/properties/defaultproperties.cxx b/svx/source/sdr/properties/defaultproperties.cxx
index eed5976..b048d37 100644
--- a/svx/source/sdr/properties/defaultproperties.cxx
+++ b/svx/source/sdr/properties/defaultproperties.cxx
@@ -28,6 +28,7 @@
 #include <svx/svddef.hxx>
 #include <svx/svdpool.hxx>
 #include <editeng/eeitem.hxx>
+#include <libxml/xmlwriter.h>
 
 
 namespace sdr
@@ -218,6 +219,13 @@ namespace sdr
                 ScaleItemSet(*mpItemSet, rScale);
             }
         }
+
+        void DefaultProperties::dumpAsXml(struct _xmlTextWriter * pWriter) const
+        {
+            xmlTextWriterStartElement(pWriter, BAD_CAST("defaultProperties"));
+            mpItemSet->dumpAsXml(pWriter);
+            xmlTextWriterEndElement(pWriter);
+        }
     } // end of namespace properties
 } // end of namespace sdr
 
diff --git a/svx/source/svdraw/svdtext.cxx b/svx/source/svdraw/svdtext.cxx
index 483f7e5..64e94b2 100644
--- a/svx/source/svdraw/svdtext.cxx
+++ b/svx/source/svdraw/svdtext.cxx
@@ -25,6 +25,7 @@
 #include "editeng/fhgtitem.hxx"
 #include <editeng/eeitem.hxx>
 #include <svl/itemset.hxx>
+#include <libxml/xmlwriter.h>
 #include <memory>
 
 SdrText::SdrText( SdrTextObj& rObject, OutlinerParaObject* pOutlinerParaObject /* = 0 */ )
@@ -201,4 +202,11 @@ SfxStyleSheet* SdrText::GetStyleSheet() const
     return mrObject.GetStyleSheet();
 }
 
+void SdrText::dumpAsXml(struct _xmlTextWriter * pWriter) const
+{
+    xmlTextWriterStartElement(pWriter, BAD_CAST("sdrText"));
+    mpOutlinerParaObject->dumpAsXml(pWriter);
+    xmlTextWriterEndElement(pWriter);
+}
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svx/source/table/cell.cxx b/svx/source/table/cell.cxx
index 90f4990..5d43b9a 100644
--- a/svx/source/table/cell.cxx
+++ b/svx/source/table/cell.cxx
@@ -34,6 +34,7 @@
 
 #include <osl/mutex.hxx>
 #include <vcl/svapp.hxx>
+#include <libxml/xmlwriter.h>
 
 #include "sdr/properties/textproperties.hxx"
 #include "editeng/outlobj.hxx"
@@ -1671,6 +1672,18 @@ void SAL_CALL Cell::disposing( const EventObject& /*Source*/ ) throw (RuntimeExc
     dispose();
 }
 
+void Cell::dumpAsXml(struct _xmlTextWriter * pWriter, sal_Int32 nRow, sal_Int32 nCol) const
+{
+    xmlTextWriterStartElement(pWriter, BAD_CAST("cell"));
+    xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST("row"), "%" SAL_PRIdINT32, nRow);
+    xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST("col"), "%" SAL_PRIdINT32, nCol);
+    SdrText::dumpAsXml(pWriter);
+    //SvxUnoTextBase::dumpAsXml(pWriter);
+    //mpPropSet->dumpAsXml(pWriter);
+    mpProperties->dumpAsXml(pWriter);
+    xmlTextWriterEndElement(pWriter);
+}
+
 } }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svx/source/table/cell.hxx b/svx/source/table/cell.hxx
index 7a3352b..55e5ab7 100644
--- a/svx/source/table/cell.hxx
+++ b/svx/source/table/cell.hxx
@@ -194,6 +194,8 @@ public:
 
     SVX_DLLPRIVATE void notifyModified();
 
+    void dumpAsXml(struct _xmlTextWriter * pWriter, sal_Int32 nRow, sal_Int32 nCol) const;
+
 protected:
     SVX_DLLPRIVATE virtual const SfxItemSet& GetObjectItemSet() override;
     SVX_DLLPRIVATE virtual void SetObjectItem(const SfxPoolItem& rItem) override;
@@ -213,14 +215,14 @@ private:
 
     css::table::CellContentType mnCellContentType;
 
-    OUString msFormula;
+    OUString        msFormula;
     double          mfValue;
     ::sal_Int32     mnError;
-    bool      mbMerged;
+    bool            mbMerged;
     ::sal_Int32     mnRowSpan;
     ::sal_Int32     mnColSpan;
 
-    Rectangle maCellRect;
+    Rectangle       maCellRect;
 
     css::uno::Reference< css::table::XTable > mxTable;
 };
diff --git a/svx/source/table/svdotable.cxx b/svx/source/table/svdotable.cxx
index 4a0d86e..1f11ef2 100644
--- a/svx/source/table/svdotable.cxx
+++ b/svx/source/table/svdotable.cxx
@@ -635,6 +635,7 @@ void SdrTableObjImpl::dumpAsXml(xmlTextWriterPtr pWriter) const
     xmlTextWriterStartElement(pWriter, BAD_CAST("sdrTableObjImpl"));
     if (mpLayouter)
         mpLayouter->dumpAsXml(pWriter);
+    mxTable->dumpAsXml(pWriter);
     xmlTextWriterEndElement(pWriter);
 }
 
diff --git a/svx/source/table/tablemodel.cxx b/svx/source/table/tablemodel.cxx
index a66f497..65ee911 100644
--- a/svx/source/table/tablemodel.cxx
+++ b/svx/source/table/tablemodel.cxx
@@ -24,6 +24,7 @@
 
 #include <vcl/svapp.hxx>
 #include <osl/mutex.hxx>
+#include <libxml/xmlwriter.h>
 
 #include "cell.hxx"
 #include "cellcursor.hxx"
@@ -1123,6 +1124,17 @@ void TableModel::updateColumns()
     }
 }
 
+void TableModel::dumpAsXml(struct _xmlTextWriter * pWriter) const
+{
+    xmlTextWriterStartElement(pWriter, BAD_CAST("tableModel"));
+    for (sal_Int32 nRow = 0; nRow < getRowCountImpl(); ++nRow)
+        for (sal_Int32 nCol = 0; nCol < getColumnCountImpl(); ++nCol)
+        {
+            maRows[nRow]->maCells[nCol]->dumpAsXml(pWriter, nRow, nCol);
+        }
+    xmlTextWriterEndElement(pWriter);
+}
+
 } }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svx/source/table/tablemodel.hxx b/svx/source/table/tablemodel.hxx
index 3a03b51..336f0d7 100644
--- a/svx/source/table/tablemodel.hxx
+++ b/svx/source/table/tablemodel.hxx
@@ -30,6 +30,7 @@
 #include <comphelper/listenernotification.hxx>
 #include "celltypes.hxx"
 
+struct _xmlTextWriter;
 
 namespace sdr { namespace table {
 
@@ -84,6 +85,8 @@ public:
     /// Get the width of all columns in this table.
     std::vector<sal_Int32> getColumnWidths();
 
+    void dumpAsXml(struct _xmlTextWriter * pWriter) const;
+
     // ICellRange
     virtual sal_Int32 getLeft() override;
     virtual sal_Int32 getTop() override;


More information about the Libreoffice-commits mailing list