diff options
author | Artur Dorda <artur.dorda+libo@gmail.com> | 2012-07-04 19:01:54 +0200 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2012-07-12 03:10:20 +0200 |
commit | cf7e4d3cedaee86da6887ff068565185fee4874a (patch) | |
tree | 593b14f5ab41c4a28b823f61c691e7ea17e03685 /drawinglayer | |
parent | 72fc403a6f90a7b4db5956acf2a572856aee9f7b (diff) |
Added dumping of TextPathAllowed & SubViewSize properties
Change-Id: I4088e15cf010f2c0c4493b9a7781c9720d375480
Diffstat (limited to 'drawinglayer')
-rw-r--r-- | drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx | 3 | ||||
-rw-r--r-- | drawinglayer/source/dumper/EnhancedShapeDumper.cxx | 32 |
2 files changed, 35 insertions, 0 deletions
diff --git a/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx b/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx index 11cb4295aee8..74c231cfb484 100644 --- a/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx +++ b/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx @@ -44,6 +44,7 @@ #include <com/sun/star/drawing/EnhancedCustomShapeSegment.hpp> #include <com/sun/star/drawing/EnhancedCustomShapeTextFrame.hpp> +#include <com/sun/star/awt/Size.hpp> #ifndef EnhancedShapeDumper_hxx #define EnhancedShapeDumper_hxx @@ -132,6 +133,8 @@ public: void dumpGluePointTypeAsAttribute(sal_Int32 aGluePointType); void dumpExtrusionAllowedAsAttribute(sal_Bool bExtrusionAllowed); void dumpConcentricGradientFillAllowedAsAttribute(sal_Bool bConcentricGradientFillAllowed); + void dumpTextPathAllowedAsAttribute(sal_Bool bTextPathAllowed); + void dumpSubViewSizeAsElement(com::sun::star::uno::Sequence< com::sun::star::awt::Size > aSubViewSize); private: xmlTextWriterPtr xmlWriter; diff --git a/drawinglayer/source/dumper/EnhancedShapeDumper.cxx b/drawinglayer/source/dumper/EnhancedShapeDumper.cxx index 40203097b680..735919b16cbc 100644 --- a/drawinglayer/source/dumper/EnhancedShapeDumper.cxx +++ b/drawinglayer/source/dumper/EnhancedShapeDumper.cxx @@ -877,6 +877,18 @@ void EnhancedShapeDumper::dumpEnhancedCustomShapePathService(uno::Reference< bea if(anotherAny >>= bConcentricGradientFillAllowed) dumpConcentricGradientFillAllowedAsAttribute(bConcentricGradientFillAllowed); } + { + uno::Any anotherAny = xPropSet->getPropertyValue("TextPathAllowed"); + sal_Bool bTextPathAllowed; + if(anotherAny >>= bTextPathAllowed) + dumpTextPathAllowedAsAttribute(bTextPathAllowed); + } + { + uno::Any anotherAny = xPropSet->getPropertyValue("SubViewSize"); + uno::Sequence< awt::Size > aSubViewSize; + if(anotherAny >>= aSubViewSize) + dumpSubViewSizeAsElement(aSubViewSize); + } } void EnhancedShapeDumper::dumpCoordinatesAsElement(uno::Sequence< drawing::EnhancedCustomShapeParameterPair > aCoordinates) @@ -984,4 +996,24 @@ void EnhancedShapeDumper::dumpConcentricGradientFillAllowedAsAttribute(sal_Bool xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("concentricGradientFillAllowed"), "%s", "false"); } +void EnhancedShapeDumper::dumpTextPathAllowedAsAttribute(sal_Bool bTextPathAllowed) +{ + if(bTextPathAllowed) + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textPathAllowed"), "%s", "true"); + else + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textPathAllowed"), "%s", "false"); +} +void EnhancedShapeDumper::dumpSubViewSizeAsElement(uno::Sequence< awt::Size > aSubViewSize) +{ + xmlTextWriterStartElement(xmlWriter, BAD_CAST( "SubViewSize" )); + sal_Int32 nLength = aSubViewSize.getLength(); + for (sal_Int32 i = 0; i < nLength; ++i) + { + xmlTextWriterStartElement(xmlWriter, BAD_CAST( "Size" )); + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("width"), "%" SAL_PRIdINT32, aSubViewSize[i].Width); + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("height"), "%" SAL_PRIdINT32, aSubViewSize[i].Height); + xmlTextWriterEndElement( xmlWriter ); + } + xmlTextWriterEndElement( xmlWriter ); +} |