From 8b79eeb8181e459c6fa82847f9d5ec36cc06f998 Mon Sep 17 00:00:00 2001 From: Artur Dorda Date: Wed, 4 Jul 2012 18:56:28 +0200 Subject: Added dumping of GluePointLeavingDirections & GluePointType properties Change-Id: Ie83dfd31196cc9777e4d582f45f27ff74482d2b4 --- .../inc/drawinglayer/EnhancedShapeDumper.hxx | 2 ++ drawinglayer/source/dumper/EnhancedShapeDumper.cxx | 28 ++++++++++++++++++++++ 2 files changed, 30 insertions(+) (limited to 'drawinglayer') diff --git a/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx b/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx index 894e530bbc08..4beef8fd858f 100644 --- a/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx +++ b/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx @@ -128,6 +128,8 @@ public: void dumpStretchYAsAttribute(sal_Int32 aStretchY); void dumpTextFramesAsElement(com::sun::star::uno::Sequence< com::sun::star::drawing::EnhancedCustomShapeTextFrame > aTextFrames); void dumpGluePointsAsElement(com::sun::star::uno::Sequence< com::sun::star::drawing::EnhancedCustomShapeParameterPair > aGluePoints); + void dumpGluePointLeavingDirectionsAsElement(com::sun::star::uno::Sequence< double > aGluePointLeavingDirections); + void dumpGluePointTypeAsAttribute(sal_Int32 aGluePointType); private: xmlTextWriterPtr xmlWriter; diff --git a/drawinglayer/source/dumper/EnhancedShapeDumper.cxx b/drawinglayer/source/dumper/EnhancedShapeDumper.cxx index ca532d15cac9..a3a34791439a 100644 --- a/drawinglayer/source/dumper/EnhancedShapeDumper.cxx +++ b/drawinglayer/source/dumper/EnhancedShapeDumper.cxx @@ -853,6 +853,18 @@ void EnhancedShapeDumper::dumpEnhancedCustomShapePathService(uno::Reference< bea if(anotherAny >>= aGluePoints) dumpGluePointsAsElement(aGluePoints); } + { + uno::Any anotherAny = xPropSet->getPropertyValue("GluePointLeavingDirections"); + uno::Sequence< double > aGluePointLeavingDirections; + if(anotherAny >>= aGluePointLeavingDirections) + dumpGluePointLeavingDirectionsAsElement(aGluePointLeavingDirections); + } + { + uno::Any anotherAny = xPropSet->getPropertyValue("GluePointType"); + sal_Int32 aGluePointType; + if(anotherAny >>= aGluePointType) + dumpGluePointTypeAsAttribute(aGluePointType); + } } void EnhancedShapeDumper::dumpCoordinatesAsElement(uno::Sequence< drawing::EnhancedCustomShapeParameterPair > aCoordinates) @@ -928,4 +940,20 @@ void EnhancedShapeDumper::dumpGluePointsAsElement(uno::Sequence< drawing::Enhanc xmlTextWriterEndElement( xmlWriter ); } +void EnhancedShapeDumper::dumpGluePointLeavingDirectionsAsElement(uno::Sequence< double > aGluePointLeavingDirections) +{ + xmlTextWriterStartElement(xmlWriter, BAD_CAST( "GluePointLeavingDirections" )); + sal_Int32 nLength = aGluePointLeavingDirections.getLength(); + for (sal_Int32 i = 0; i < nLength; ++i) + { + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("value"), "%f", aGluePointLeavingDirections[i]); + } + xmlTextWriterEndElement( xmlWriter ); +} + +void EnhancedShapeDumper::dumpGluePointTypeAsAttribute(sal_Int32 aGluePointType) +{ + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("gluePointType"), "%" SAL_PRIdINT32, aGluePointType); +} + -- cgit v1.2.3