summaryrefslogtreecommitdiff
path: root/drawinglayer
diff options
context:
space:
mode:
authorArtur Dorda <artur.dorda+libo@gmail.com>2012-07-04 17:57:42 +0200
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2012-07-12 03:10:19 +0200
commit7cb81fc2ebccbf607bf0d08d65f74bb43a83d1ea (patch)
tree2a1251c1d9dd4a062e1d6e9c5f99b519dda97163 /drawinglayer
parentbe89451450580eb5f79e97d33bb5885e764c7c79 (diff)
Added dumping of Coordinates & Segments properties
Change-Id: I4acfe9f1d1ca9bb4f434376bd6fd23804b66a25f
Diffstat (limited to 'drawinglayer')
-rw-r--r--drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx4
-rw-r--r--drawinglayer/source/dumper/EnhancedShapeDumper.cxx42
2 files changed, 46 insertions, 0 deletions
diff --git a/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx b/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx
index 74947ca11e5e..6742021ef064 100644
--- a/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx
+++ b/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx
@@ -42,6 +42,8 @@
#include <com/sun/star/beans/PropertyValues.hpp>
#include <com/sun/star/drawing/EnhancedCustomShapeParameter.hpp>
+#include <com/sun/star/drawing/EnhancedCustomShapeSegment.hpp>
+
#ifndef EnhancedShapeDumper_hxx
#define EnhancedShapeDumper_hxx
@@ -119,6 +121,8 @@ public:
// EnhancedCustomShapePath.idl
void dumpEnhancedCustomShapePathService(com::sun::star::uno::Reference< com::sun::star::beans::XPropertySet > xPropSet);
+ void dumpCoordinatesAsElement(com::sun::star::uno::Sequence< com::sun::star::drawing::EnhancedCustomShapeParameterPair > aCoordinates);
+ void dumpSegmentsAsElement(com::sun::star::uno::Sequence< com::sun::star::drawing::EnhancedCustomShapeSegment > aSegments);
private:
xmlTextWriterPtr xmlWriter;
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 );
+}
+
+