diff options
author | Noel Grandin <noel@peralex.com> | 2016-09-12 11:10:18 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2016-09-12 15:11:56 +0200 |
commit | 1d7dd96e313dd23ca8d49abf879d51db448f76ee (patch) | |
tree | c8f2d0aadd38bec9783655304b4eb5ae10c9cf2f | |
parent | ab6dcd326ad7bf8c47a820514440bf8ac5f0d5f3 (diff) |
impress: extend dumpAsXml to table cell and styles
Change-Id: If11ca945cae4f5127394dcc3871f4b6a76c24fac
-rw-r--r-- | include/svx/sdr/properties/defaultproperties.hxx | 3 | ||||
-rw-r--r-- | include/svx/svdtext.hxx | 2 | ||||
-rw-r--r-- | svx/source/sdr/properties/defaultproperties.cxx | 8 | ||||
-rw-r--r-- | svx/source/svdraw/svdtext.cxx | 8 | ||||
-rw-r--r-- | svx/source/table/cell.cxx | 13 | ||||
-rw-r--r-- | svx/source/table/cell.hxx | 8 | ||||
-rw-r--r-- | svx/source/table/svdotable.cxx | 1 | ||||
-rw-r--r-- | svx/source/table/tablemodel.cxx | 12 | ||||
-rw-r--r-- | svx/source/table/tablemodel.hxx | 3 |
9 files changed, 55 insertions, 3 deletions
diff --git a/include/svx/sdr/properties/defaultproperties.hxx b/include/svx/sdr/properties/defaultproperties.hxx index f629a31209d1..0a8e4e5682e2 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 8338428fe241..4733ad4f6230 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 eed59766cd2f..b048d37d832b 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 483f7e5efd3c..64e94b2516cf 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 90f499065962..5d43b9af4b39 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 7a3352b2887d..55e5ab738761 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 4a0d86ec4552..1f11ef2725e8 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 a66f497b4563..65ee911f4bb2 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 3a03b5173784..336f0d7d2c28 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; |