From 3b18024e5447a5bcce291aa9442d53cc79eeda1d Mon Sep 17 00:00:00 2001 From: Artur Dorda Date: Tue, 3 Jul 2012 16:04:32 +0200 Subject: Added properties Depth & Diffusion Change-Id: If9aaf021bcdd0a43bbc32e08236f8bc39c7cda82 --- .../inc/drawinglayer/EnhancedShapeDumper.hxx | 2 ++ drawinglayer/source/dumper/EnhancedShapeDumper.cxx | 23 ++++++++++++++++++++++ 2 files changed, 25 insertions(+) (limited to 'drawinglayer') diff --git a/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx b/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx index aecb856b42d6..f328a94fd747 100644 --- a/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx +++ b/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx @@ -51,6 +51,8 @@ public: void dumpEnhancedCustomShapeExtrusionService(com::sun::star::uno::Reference< com::sun::star::beans::XPropertySet > xPropSet); void dumpExtrusionAsAttribute(sal_Bool bExtrusion); void dumpBrightnessAsAttribute(double aBrightness); + void dumpDepthAsElement(com::sun::star::drawing::EnhancedCustomShapeParameterPair aDepth); + void dumpDiffusionAsAttribute(double aDiffusion); private: xmlTextWriterPtr xmlWriter; diff --git a/drawinglayer/source/dumper/EnhancedShapeDumper.cxx b/drawinglayer/source/dumper/EnhancedShapeDumper.cxx index 85bfd276f9e1..aee479e04706 100644 --- a/drawinglayer/source/dumper/EnhancedShapeDumper.cxx +++ b/drawinglayer/source/dumper/EnhancedShapeDumper.cxx @@ -50,6 +50,18 @@ void EnhancedShapeDumper::dumpEnhancedCustomShapeExtrusionService(uno::Reference if(anotherAny >>= aBrightness) dumpBrightnessAsAttribute(aBrightness); } + { + uno::Any anotherAny = xPropSet->getPropertyValue("Depth"); + drawing::EnhancedCustomShapeParameterPair aDepth; + if(anotherAny >>= aDepth) + dumpDepthAsElement(aDepth); + } + { + uno::Any anotherAny = xPropSet->getPropertyValue("Diffusion"); + double aDiffusion; + if(anotherAny >>= aDiffusion) + dumpDiffusionAsAttribute(aDiffusion); + } } void EnhancedShapeDumper::dumpExtrusionAsAttribute(sal_Bool bExtrusion) { @@ -92,3 +104,14 @@ void EnhancedShapeDumper::dumpEnhancedCustomShapeParameterPair(drawing::Enhanced } } +void EnhancedShapeDumper::dumpDepthAsElement(drawing::EnhancedCustomShapeParameterPair aDepth) +{ + xmlTextWriterStartElement(xmlWriter, BAD_CAST( "Depth" )); + dumpEnhancedCustomShapeParameterPair(aDepth); + xmlTextWriterEndElement( xmlWriter ); +} + +void EnhancedShapeDumper::dumpDiffusionAsAttribute(double aDiffusion) +{ + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("diffusion"), "%f", aDiffusion); +} -- cgit