diff options
author | Artur Dorda <artur.dorda+libo@gmail.com> | 2012-07-04 03:39:53 +0200 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2012-07-12 03:10:17 +0200 |
commit | 2704fe3973e2e2d72183d2ca148b29aceab746d1 (patch) | |
tree | e168cadef1ccb9a4a7824b1349bfa9067137767c /drawinglayer | |
parent | Added properties MirroredY & TextRotateAngle (diff) | |
download | core-2704fe3973e2e2d72183d2ca148b29aceab746d1.tar.gz core-2704fe3973e2e2d72183d2ca148b29aceab746d1.zip |
Added dumping property AdjustmentValues
Change-Id: Iac59e89f3d7dd5e75ca43b43c19639880fc2b3d5
Diffstat (limited to 'drawinglayer')
-rw-r--r-- | drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx | 2 | ||||
-rw-r--r-- | drawinglayer/source/dumper/EnhancedShapeDumper.cxx | 38 |
2 files changed, 40 insertions, 0 deletions
diff --git a/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx b/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx index 42cdd21ba2bd..375864a76f63 100644 --- a/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx +++ b/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx @@ -36,6 +36,7 @@ #include <com/sun/star/drawing/Position3D.hpp> #include <com/sun/star/awt/Rectangle.hpp> +#include <com/sun/star/drawing/EnhancedCustomShapeAdjustmentValue.hpp> #ifndef EnhancedShapeDumper_hxx #define EnhancedShapeDumper_hxx @@ -87,6 +88,7 @@ public: void dumpMirroredXAsAttribute(sal_Bool bMirroredX); void dumpMirroredYAsAttribute(sal_Bool bMirroredY); void dumpTextRotateAngleAsAttribute(double aTextRotateAngle); + void dumpAdjustmentValuesAsElement(com::sun::star::uno::Sequence< com::sun::star::drawing::EnhancedCustomShapeAdjustmentValue> aAdjustmentValues); private: xmlTextWriterPtr xmlWriter; diff --git a/drawinglayer/source/dumper/EnhancedShapeDumper.cxx b/drawinglayer/source/dumper/EnhancedShapeDumper.cxx index a79c8f4f7601..7336db7c76e4 100644 --- a/drawinglayer/source/dumper/EnhancedShapeDumper.cxx +++ b/drawinglayer/source/dumper/EnhancedShapeDumper.cxx @@ -427,6 +427,12 @@ void EnhancedShapeDumper::dumpEnhancedCustomShapeGeometryService(uno::Reference< if(anotherAny >>= aTextRotateAngle) dumpTextRotateAngleAsAttribute(aTextRotateAngle); } + { + uno::Any anotherAny = xPropSet->getPropertyValue("AdjustmentValues"); + uno::Sequence< drawing::EnhancedCustomShapeAdjustmentValue> aAdjustmentValues; + if(anotherAny >>= aAdjustmentValues) + dumpAdjustmentValuesAsElement(aAdjustmentValues); + } } void EnhancedShapeDumper::dumpTypeAsAttribute(rtl::OUString sType) { @@ -465,4 +471,36 @@ void EnhancedShapeDumper::dumpTextRotateAngleAsAttribute(double aTextRotateAngle xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textRotateAngle"), "%f", aTextRotateAngle); } +void EnhancedShapeDumper::dumpAdjustmentValuesAsElement(uno::Sequence< drawing::EnhancedCustomShapeAdjustmentValue> aAdjustmentValues) + { + xmlTextWriterStartElement(xmlWriter, BAD_CAST( "AdjustmentValues" )); + sal_Int32 nLength = aAdjustmentValues.getLength(); + for (sal_Int32 i = 0; i < nLength; ++i) + { + xmlTextWriterStartElement(xmlWriter, BAD_CAST( "EnhancedCustomShapeAdjustmentValue" )); + uno::Any aAny = aAdjustmentValues[i].Value; + rtl::OUString sValue; + if(aAny >>= sValue) + { + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("value"), "%s", + rtl::OUStringToOString(sValue, RTL_TEXTENCODING_UTF8).getStr()); + } + switch(aAdjustmentValues[i].State) + { + case beans::PropertyState_DIRECT_VALUE: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("propertyState"), "%s", "DIRECT_VALUE"); + break; + case beans::PropertyState_DEFAULT_VALUE: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("propertyState"), "%s", "DEFAULT_VALUE"); + break; + case beans::PropertyState_AMBIGUOUS_VALUE: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("propertyState"), "%s", "AMBIGUOUS_VALUE"); + break; + default: + break; + } + xmlTextWriterEndElement( xmlWriter ); + } + xmlTextWriterEndElement( xmlWriter ); + } |