diff options
author | Artur Dorda <artur.dorda+libo@gmail.com> | 2012-07-04 18:52:04 +0200 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2012-07-12 03:10:20 +0200 |
commit | 85ff400da59a8bb0ab64d2676696fddcd5714858 (patch) | |
tree | 320c25fb0e6b6b44c7b332b9f5bfa16fcef7eb0d /drawinglayer | |
parent | 4b4ca8030285bd66526ff5bb2b6ea5a75a6c6bc7 (diff) |
Added dumping of TextFrames & GluePoints properties
Change-Id: Ibaa5f782d511d406575bfec6267f95d6ae50b87c
Diffstat (limited to 'drawinglayer')
-rw-r--r-- | drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx | 3 | ||||
-rw-r--r-- | drawinglayer/source/dumper/EnhancedShapeDumper.cxx | 46 |
2 files changed, 49 insertions, 0 deletions
diff --git a/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx b/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx index 982348357432..894e530bbc08 100644 --- a/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx +++ b/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx @@ -43,6 +43,7 @@ #include <com/sun/star/drawing/EnhancedCustomShapeParameter.hpp> #include <com/sun/star/drawing/EnhancedCustomShapeSegment.hpp> +#include <com/sun/star/drawing/EnhancedCustomShapeTextFrame.hpp> #ifndef EnhancedShapeDumper_hxx #define EnhancedShapeDumper_hxx @@ -125,6 +126,8 @@ public: void dumpSegmentsAsElement(com::sun::star::uno::Sequence< com::sun::star::drawing::EnhancedCustomShapeSegment > aSegments); void dumpStretchXAsAttribute(sal_Int32 aStretchX); 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); private: xmlTextWriterPtr xmlWriter; diff --git a/drawinglayer/source/dumper/EnhancedShapeDumper.cxx b/drawinglayer/source/dumper/EnhancedShapeDumper.cxx index a461c47190e7..ca532d15cac9 100644 --- a/drawinglayer/source/dumper/EnhancedShapeDumper.cxx +++ b/drawinglayer/source/dumper/EnhancedShapeDumper.cxx @@ -841,6 +841,18 @@ void EnhancedShapeDumper::dumpEnhancedCustomShapePathService(uno::Reference< bea if(anotherAny >>= aStretchY) dumpStretchYAsAttribute(aStretchY); } + { + uno::Any anotherAny = xPropSet->getPropertyValue("TextFrames"); + uno::Sequence< drawing::EnhancedCustomShapeTextFrame > aTextFrames; + if(anotherAny >>= aTextFrames) + dumpTextFramesAsElement(aTextFrames); + } + { + uno::Any anotherAny = xPropSet->getPropertyValue("GluePoints"); + uno::Sequence< drawing::EnhancedCustomShapeParameterPair > aGluePoints; + if(anotherAny >>= aGluePoints) + dumpGluePointsAsElement(aGluePoints); + } } void EnhancedShapeDumper::dumpCoordinatesAsElement(uno::Sequence< drawing::EnhancedCustomShapeParameterPair > aCoordinates) @@ -882,4 +894,38 @@ void EnhancedShapeDumper::dumpStretchYAsAttribute(sal_Int32 aStretchY) xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("stretchY"), "%" SAL_PRIdINT32, aStretchY); } +void EnhancedShapeDumper::dumpTextFramesAsElement(uno::Sequence< drawing::EnhancedCustomShapeTextFrame > aTextFrames) +{ + xmlTextWriterStartElement(xmlWriter, BAD_CAST( "TextFrames" )); + sal_Int32 nLength = aTextFrames.getLength(); + for (sal_Int32 i = 0; i < nLength; ++i) + { + xmlTextWriterStartElement(xmlWriter, BAD_CAST( "EnhancedCustomShapeTextFrame" )); + { + xmlTextWriterStartElement(xmlWriter, BAD_CAST( "TopLeft" )); + dumpEnhancedCustomShapeParameterPair(aTextFrames[i].TopLeft); + xmlTextWriterEndElement( xmlWriter ); + + xmlTextWriterStartElement(xmlWriter, BAD_CAST( "BottomRight" )); + dumpEnhancedCustomShapeParameterPair(aTextFrames[i].BottomRight); + xmlTextWriterEndElement( xmlWriter ); + } + xmlTextWriterEndElement( xmlWriter ); + } + xmlTextWriterEndElement( xmlWriter ); +} + +void EnhancedShapeDumper::dumpGluePointsAsElement(uno::Sequence< drawing::EnhancedCustomShapeParameterPair > aGluePoints) +{ + xmlTextWriterStartElement(xmlWriter, BAD_CAST( "GluePoints" )); + sal_Int32 nLength = aGluePoints.getLength(); + for (sal_Int32 i = 0; i < nLength; ++i) + { + xmlTextWriterStartElement(xmlWriter, BAD_CAST( "EnhancedCustomShapeParameterPair" )); + dumpEnhancedCustomShapeParameterPair(aGluePoints[i]); + xmlTextWriterEndElement( xmlWriter ); + } + xmlTextWriterEndElement( xmlWriter ); +} + |