[Libreoffice-commits] core.git: include/svx svx/source
Miklos Vajna (via logerrit)
logerrit at kemper.freedesktop.org
Thu Jul 18 15:20:18 UTC 2019
include/svx/sdr/properties/defaultproperties.hxx | 2 +-
include/svx/sdr/properties/properties.hxx | 4 ++++
svx/source/sdr/properties/defaultproperties.cxx | 1 +
svx/source/sdr/properties/properties.cxx | 8 ++++++++
svx/source/svdraw/svdobj.cxx | 5 +++++
5 files changed, 19 insertions(+), 1 deletion(-)
New commits:
commit 83a615c568a7a23a3aae7ca52012bc947d4cb5de
Author: Miklos Vajna <vmiklos at collabora.com>
AuthorDate: Thu Jul 18 12:12:48 2019 +0200
Commit: Miklos Vajna <vmiklos at collabora.com>
CommitDate: Thu Jul 18 17:18:59 2019 +0200
svx xml dump: show the SdrObject's properties / item set
Shows items usually accessed using GetMergedItemSet(), to help
debugging.
Change-Id: Id3c20e99c33d5e5762c3b58e2f76ab5686031734
Reviewed-on: https://gerrit.libreoffice.org/75852
Reviewed-by: Miklos Vajna <vmiklos at collabora.com>
Tested-by: Jenkins
diff --git a/include/svx/sdr/properties/defaultproperties.hxx b/include/svx/sdr/properties/defaultproperties.hxx
index 82de52f4e6b3..96d4fe5f1d84 100644
--- a/include/svx/sdr/properties/defaultproperties.hxx
+++ b/include/svx/sdr/properties/defaultproperties.hxx
@@ -68,7 +68,7 @@ namespace sdr
// destructor
virtual ~DefaultProperties() override;
- void dumpAsXml(xmlTextWriterPtr pWriter) const;
+ void dumpAsXml(xmlTextWriterPtr pWriter) const override;
// Clone() operator, normally just calls the local copy constructor
virtual std::unique_ptr<BaseProperties> Clone(SdrObject& rObj) const override;
diff --git a/include/svx/sdr/properties/properties.hxx b/include/svx/sdr/properties/properties.hxx
index 7b026f865b1a..56182af840e2 100644
--- a/include/svx/sdr/properties/properties.hxx
+++ b/include/svx/sdr/properties/properties.hxx
@@ -28,6 +28,8 @@
#include <svx/svxdllapi.h>
#include <svl/typedwhich.hxx>
+struct _xmlTextWriter;
+typedef struct _xmlTextWriter* xmlTextWriterPtr;
class SdrObject;
class SfxItemSet;
class SfxPoolItem;
@@ -196,6 +198,8 @@ namespace sdr
// allow detection of e.g. style sheet or single text attribute changes. The
// default implementation returns 0 (zero)
virtual sal_uInt32 getVersion() const;
+
+ virtual void dumpAsXml(xmlTextWriterPtr pWriter) const;
};
// checks the FillStyle item and removes unneeded Gradient, FillBitmap and Hatch items
diff --git a/svx/source/sdr/properties/defaultproperties.cxx b/svx/source/sdr/properties/defaultproperties.cxx
index 60c1d5a00b0c..f9461f796b53 100644
--- a/svx/source/sdr/properties/defaultproperties.cxx
+++ b/svx/source/sdr/properties/defaultproperties.cxx
@@ -233,6 +233,7 @@ namespace sdr
void DefaultProperties::dumpAsXml(xmlTextWriterPtr pWriter) const
{
xmlTextWriterStartElement(pWriter, BAD_CAST("DefaultProperties"));
+ BaseProperties::dumpAsXml(pWriter);
mpItemSet->dumpAsXml(pWriter);
xmlTextWriterEndElement(pWriter);
}
diff --git a/svx/source/sdr/properties/properties.cxx b/svx/source/sdr/properties/properties.cxx
index 457db8e38b3f..c76ecba49c8a 100644
--- a/svx/source/sdr/properties/properties.cxx
+++ b/svx/source/sdr/properties/properties.cxx
@@ -17,6 +17,8 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
+#include <libxml/xmlwriter.h>
+
#include <svx/sdr/properties/properties.hxx>
#include <sdr/properties/itemsettools.hxx>
#include <svl/itemset.hxx>
@@ -154,6 +156,12 @@ namespace sdr
return 0;
}
+ void BaseProperties::dumpAsXml(xmlTextWriterPtr pWriter) const
+ {
+ xmlTextWriterStartElement(pWriter, BAD_CAST("BaseProperties"));
+ xmlTextWriterEndElement(pWriter);
+ }
+
void CleanupFillProperties( SfxItemSet& rItemSet )
{
const bool bFillBitmap = rItemSet.GetItemState(XATTR_FILLBITMAP, false) == SfxItemState::SET;
diff --git a/svx/source/svdraw/svdobj.cxx b/svx/source/svdraw/svdobj.cxx
index 753caf3edd8a..65e8492145fe 100644
--- a/svx/source/svdraw/svdobj.cxx
+++ b/svx/source/svdraw/svdobj.cxx
@@ -1726,6 +1726,11 @@ void SdrObject::dumpAsXml(xmlTextWriterPtr pWriter) const
xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST("nOrdNum"), "%" SAL_PRIuUINT32, GetOrdNumDirect());
xmlTextWriterWriteAttribute(pWriter, BAD_CAST("aOutRect"), BAD_CAST(aOutRect.toString().getStr()));
+ if (mpProperties)
+ {
+ mpProperties->dumpAsXml(pWriter);
+ }
+
if (const OutlinerParaObject* pOutliner = GetOutlinerParaObject())
pOutliner->dumpAsXml(pWriter);
More information about the Libreoffice-commits
mailing list