diff options
author | Artur Dorda <artur.dorda+libo@gmail.com> | 2012-07-03 21:10:05 +0200 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2012-07-12 03:10:16 +0200 |
commit | 3501827a4fecd0ca174715a5688ddaf10ad33cdf (patch) | |
tree | 1d803e75d6cfcd4df14fb923bfe8b360ad6c10aa /drawinglayer | |
parent | 39becd1a50de51785de3428dc2a36aa257758081 (diff) |
Added properties Specularity & ProjectionMode
Change-Id: I9e614c571f8d8db1cf00d3251cc4b09ff1dde278
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 51ab82180c38..5a5fbf8eeedd 100644 --- a/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx +++ b/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx @@ -32,6 +32,7 @@ #include <com/sun/star/drawing/EnhancedCustomShapeParameterPair.hpp> #include <com/sun/star/drawing/Direction3D.hpp> #include <com/sun/star/drawing/ShadeMode.hpp> +#include <com/sun/star/drawing/ProjectionMode.hpp> #ifndef EnhancedShapeDumper_hxx #define EnhancedShapeDumper_hxx @@ -70,6 +71,8 @@ public: void dumpRotationCenterAsElement(com::sun::star::drawing::Direction3D aRotationCenter); void dumpShininessAsAttribute(double aShininess); void dumpSkewAsElement(com::sun::star::drawing::EnhancedCustomShapeParameterPair aSkew); + void dumpSpecularityAsAttribute(double aSpecularity); + void dumpProjectionModeAsAttribute(com::sun::star::drawing::ProjectionMode eProjectionMode); private: xmlTextWriterPtr xmlWriter; diff --git a/drawinglayer/source/dumper/EnhancedShapeDumper.cxx b/drawinglayer/source/dumper/EnhancedShapeDumper.cxx index 85c57876c857..5b9b5acd3da6 100644 --- a/drawinglayer/source/dumper/EnhancedShapeDumper.cxx +++ b/drawinglayer/source/dumper/EnhancedShapeDumper.cxx @@ -146,6 +146,18 @@ void EnhancedShapeDumper::dumpEnhancedCustomShapeExtrusionService(uno::Reference if(anotherAny >>= aSkew) dumpSkewAsElement(aSkew); } + { + uno::Any anotherAny = xPropSet->getPropertyValue("Specularity"); + double aSpecularity; + if(anotherAny >>= aSpecularity) + dumpSpecularityAsAttribute(aSpecularity); + } + { + uno::Any anotherAny = xPropSet->getPropertyValue("ProjectionMode"); + drawing::ProjectionMode eProjectionMode; + if(anotherAny >>= eProjectionMode) + dumpProjectionModeAsAttribute(eProjectionMode); + } } void EnhancedShapeDumper::dumpExtrusionAsAttribute(sal_Bool bExtrusion) { @@ -315,4 +327,24 @@ void EnhancedShapeDumper::dumpSkewAsElement(drawing::EnhancedCustomShapeParamete xmlTextWriterEndElement( xmlWriter ); } +void EnhancedShapeDumper::dumpSpecularityAsAttribute(double aSpecularity) +{ + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("specularity"), "%f", aSpecularity); +} + +void EnhancedShapeDumper::dumpProjectionModeAsAttribute(drawing::ProjectionMode eProjectionMode) +{ + switch(eProjectionMode) + { + case drawing::ProjectionMode_PARALLEL: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("projectionMode"), "%s", "PARALLEL"); + break; + case drawing::ProjectionMode_PERSPECTIVE: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("projectionMode"), "%s", "PERSPECTIVE"); + break; + default: + break; + } +} + |