diff options
author | Artur Dorda <artur.dorda+libo@gmail.com> | 2012-07-04 17:57:42 +0200 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2012-07-12 03:10:19 +0200 |
commit | 7cb81fc2ebccbf607bf0d08d65f74bb43a83d1ea (patch) | |
tree | 2a1251c1d9dd4a062e1d6e9c5f99b519dda97163 /drawinglayer/source | |
parent | be89451450580eb5f79e97d33bb5885e764c7c79 (diff) |
Added dumping of Coordinates & Segments properties
Change-Id: I4acfe9f1d1ca9bb4f434376bd6fd23804b66a25f
Diffstat (limited to 'drawinglayer/source')
-rw-r--r-- | drawinglayer/source/dumper/EnhancedShapeDumper.cxx | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/drawinglayer/source/dumper/EnhancedShapeDumper.cxx b/drawinglayer/source/dumper/EnhancedShapeDumper.cxx index e7940a28e65d..dbb7f5653264 100644 --- a/drawinglayer/source/dumper/EnhancedShapeDumper.cxx +++ b/drawinglayer/source/dumper/EnhancedShapeDumper.cxx @@ -817,5 +817,47 @@ void EnhancedShapeDumper::dumpRadiusRangeMaximumAsElement(drawing::EnhancedCusto void EnhancedShapeDumper::dumpEnhancedCustomShapePathService(uno::Reference< beans::XPropertySet > xPropSet) { + { + uno::Any anotherAny = xPropSet->getPropertyValue("Coordinates"); + uno::Sequence< drawing::EnhancedCustomShapeParameterPair > aCoordinates; + if(anotherAny >>= aCoordinates) + dumpCoordinatesAsElement(aCoordinates); + } + { + uno::Any anotherAny = xPropSet->getPropertyValue("Segments"); + uno::Sequence< drawing::EnhancedCustomShapeSegment > aSegments; + if(anotherAny >>= aSegments) + dumpSegmentsAsElement(aSegments); + } +} +void EnhancedShapeDumper::dumpCoordinatesAsElement(uno::Sequence< drawing::EnhancedCustomShapeParameterPair > aCoordinates) +{ + xmlTextWriterStartElement(xmlWriter, BAD_CAST( "Coordinates" )); + sal_Int32 nLength = aCoordinates.getLength(); + for (sal_Int32 i = 0; i < nLength; ++i) + { + xmlTextWriterStartElement(xmlWriter, BAD_CAST( "EnhancedCustomShapeParameterPair" )); + dumpEnhancedCustomShapeParameterPair(aCoordinates[i]); + xmlTextWriterEndElement( xmlWriter ); + } + xmlTextWriterEndElement( xmlWriter ); } + +void EnhancedShapeDumper::dumpSegmentsAsElement(uno::Sequence< drawing::EnhancedCustomShapeSegment > aSegments) +{ + xmlTextWriterStartElement(xmlWriter, BAD_CAST( "Segments" )); + sal_Int32 nLength = aSegments.getLength(); + for (sal_Int32 i = 0; i < nLength; ++i) + { + xmlTextWriterStartElement(xmlWriter, BAD_CAST( "EnhancedCustomShapeSegment" )); + sal_Int32 aCommand = aSegments[i].Command; + sal_Int32 aCount = aSegments[i].Count; + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("command"), "%" SAL_PRIdINT32, aCommand); + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("count"), "%" SAL_PRIdINT32, aCount); + xmlTextWriterEndElement( xmlWriter ); + } + xmlTextWriterEndElement( xmlWriter ); +} + + |