diff options
author | Miklos Vajna <vmiklos@collabora.com> | 2020-11-30 17:44:35 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2020-11-30 19:54:25 +0100 |
commit | a7505356872f981c951b2ec64383a95538890876 (patch) | |
tree | bd427ab05c3953cb4a5b49a035c35058684dbce6 /svx | |
parent | aa56e3b8ef8c2bb16610d45ed21b06fa38ba53a1 (diff) |
tdf#129961 svx: add doc model xml dump for shadow-related pool items
It seems that sdr::table::SdrTableObj is already capable of storing
shadow properties, but this is not easy to inspect, extend the xml
dumper to improve the situation.
Change-Id: Ideef43dfd6b844e0227632ec2cb6ab5d16171d8b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106902
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
Diffstat (limited to 'svx')
-rw-r--r-- | svx/source/svdraw/svdattr.cxx | 54 | ||||
-rw-r--r-- | svx/source/xoutdev/xattr.cxx | 16 |
2 files changed, 70 insertions, 0 deletions
diff --git a/svx/source/svdraw/svdattr.cxx b/svx/source/svdraw/svdattr.cxx index abd037967390..8810427d926b 100644 --- a/svx/source/svdraw/svdattr.cxx +++ b/svx/source/svdraw/svdattr.cxx @@ -727,6 +727,18 @@ bool SdrOnOffItem::GetPresentation(SfxItemPresentation ePres, return true; } +void SdrOnOffItem::dumpAsXml(xmlTextWriterPtr pWriter) const +{ + xmlTextWriterStartElement(pWriter, BAD_CAST("SdrOnOffItem")); + if (Which() == SDRATTR_SHADOW) + { + xmlTextWriterWriteAttribute(pWriter, BAD_CAST("whichId"), BAD_CAST("SDRATTR_SHADOW")); + } + + SfxBoolItem::dumpAsXml(pWriter); + + xmlTextWriterEndElement(pWriter); +} SdrYesNoItem* SdrYesNoItem::Clone(SfxItemPool* /*pPool*/) const { @@ -770,6 +782,20 @@ bool SdrPercentItem::GetPresentation( return true; } +void SdrPercentItem::dumpAsXml(xmlTextWriterPtr pWriter) const +{ + xmlTextWriterStartElement(pWriter, BAD_CAST("SdrPercentItem")); + if (Which() == SDRATTR_SHADOWTRANSPARENCE) + { + xmlTextWriterWriteAttribute(pWriter, BAD_CAST("whichId"), + BAD_CAST("SDRATTR_SHADOWTRANSPARENCE")); + } + + SfxUInt16Item::dumpAsXml(pWriter); + + xmlTextWriterEndElement(pWriter); +} + SdrAngleItem* SdrAngleItem::Clone(SfxItemPool* /*pPool*/) const { return new SdrAngleItem(Which(),GetValue()); @@ -869,6 +895,34 @@ bool SdrMetricItem::GetPresentation(SfxItemPresentation ePres, return true; } +void SdrMetricItem::dumpAsXml(xmlTextWriterPtr pWriter) const +{ + xmlTextWriterStartElement(pWriter, BAD_CAST("SdrMetricItem")); + if (Which() == SDRATTR_SHADOWXDIST) + { + xmlTextWriterWriteAttribute(pWriter, BAD_CAST("whichId"), BAD_CAST("SDRATTR_SHADOWXDIST")); + } + else if (Which() == SDRATTR_SHADOWYDIST) + { + xmlTextWriterWriteAttribute(pWriter, BAD_CAST("whichId"), BAD_CAST("SDRATTR_SHADOWYDIST")); + } + else if (Which() == SDRATTR_SHADOWSIZEX) + { + xmlTextWriterWriteAttribute(pWriter, BAD_CAST("whichId"), BAD_CAST("SDRATTR_SHADOWSIZEX")); + } + else if (Which() == SDRATTR_SHADOWSIZEY) + { + xmlTextWriterWriteAttribute(pWriter, BAD_CAST("whichId"), BAD_CAST("SDRATTR_SHADOWSIZEY")); + } + else if (Which() == SDRATTR_SHADOWBLUR) + { + xmlTextWriterWriteAttribute(pWriter, BAD_CAST("whichId"), BAD_CAST("SDRATTR_SHADOWBLUR")); + } + + SfxInt32Item::dumpAsXml(pWriter); + + xmlTextWriterEndElement(pWriter); +} // items of the legend object diff --git a/svx/source/xoutdev/xattr.cxx b/svx/source/xoutdev/xattr.cxx index 43f0e6c1a2f2..5d3caa64fa1d 100644 --- a/svx/source/xoutdev/xattr.cxx +++ b/svx/source/xoutdev/xattr.cxx @@ -78,6 +78,7 @@ #include <svx/xftshcit.hxx> #include <svx/xftshxy.hxx> #include <svx/xftadit.hxx> +#include <svx/svddef.hxx> #include <basegfx/polygon/b2dpolypolygontools.hxx> #include <unotools/intlwrapper.hxx> #include <unotools/syslocale.hxx> @@ -329,6 +330,21 @@ bool XColorItem::PutValue( const css::uno::Any& rVal, sal_uInt8 /*nMemberId*/) return true; } +void XColorItem::dumpAsXml(xmlTextWriterPtr pWriter) const +{ + xmlTextWriterStartElement(pWriter, BAD_CAST("XColorItem")); + if (Which() == SDRATTR_SHADOWCOLOR) + { + xmlTextWriterWriteAttribute(pWriter, BAD_CAST("whichId"), BAD_CAST("SDRATTR_SHADOWCOLOR")); + } + xmlTextWriterWriteAttribute(pWriter, BAD_CAST("aColor"), + BAD_CAST(aColor.AsRGBHexString().toUtf8().getStr())); + + NameOrIndex::dumpAsXml(pWriter); + + xmlTextWriterEndElement(pWriter); +} + // --- line attributes --- |