diff options
author | Artur Dorda <artur.dorda+libo@gmail.com> | 2012-07-03 20:57:08 +0200 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2012-07-12 03:10:15 +0200 |
commit | f104a3649608959b3b845dd3694aaf897e8808e6 (patch) | |
tree | ab0caed829ebf2c3ef5ddd0dc80c519c9bd3109e | |
parent | 6c245e0687c4ff9f7b4e6240282a11ca600d2e32 (diff) |
Added properties Metal & ShadeMode
Change-Id: I254a9089d78b97dde331812f77ad7977631b0d12
-rw-r--r-- | drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx | 3 | ||||
-rw-r--r-- | drawinglayer/source/dumper/EnhancedShapeDumper.cxx | 41 |
2 files changed, 44 insertions, 0 deletions
diff --git a/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx b/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx index bc2e713f2c5d..aca302b5356a 100644 --- a/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx +++ b/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx @@ -31,6 +31,7 @@ #include <com/sun/star/beans/XPropertySet.hpp> #include <com/sun/star/drawing/EnhancedCustomShapeParameterPair.hpp> #include <com/sun/star/drawing/Direction3D.hpp> +#include <com/sun/star/drawing/ShadeMode.hpp> #ifndef EnhancedShapeDumper_hxx #define EnhancedShapeDumper_hxx @@ -63,6 +64,8 @@ public: void dumpSecondLightLevelAsAttribute(double aSecondLightLevel); void dumpFirstLightDirectionAsElement(com::sun::star::drawing::Direction3D aFirstLightDirection); void dumpSecondLightDirectionAsElement(com::sun::star::drawing::Direction3D aSecondLightDirection); + void dumpMetalAsAttribute(sal_Bool bMetal); + void dumpShadeModeAsAttribute(com::sun::star::drawing::ShadeMode eShadeMode); private: xmlTextWriterPtr xmlWriter; diff --git a/drawinglayer/source/dumper/EnhancedShapeDumper.cxx b/drawinglayer/source/dumper/EnhancedShapeDumper.cxx index a4eafb6f1447..527115fed3d2 100644 --- a/drawinglayer/source/dumper/EnhancedShapeDumper.cxx +++ b/drawinglayer/source/dumper/EnhancedShapeDumper.cxx @@ -110,6 +110,18 @@ void EnhancedShapeDumper::dumpEnhancedCustomShapeExtrusionService(uno::Reference if(anotherAny >>= aSecondLightDirection) dumpSecondLightDirectionAsElement(aSecondLightDirection); } + { + uno::Any anotherAny = xPropSet->getPropertyValue("Metal"); + sal_Bool bMetal; + if(anotherAny >>= bMetal) + dumpMetalAsAttribute(bMetal); + } + { + uno::Any anotherAny = xPropSet->getPropertyValue("ShadeMode"); + drawing::ShadeMode eShadeMode; + if(anotherAny >>= eShadeMode) + dumpShadeModeAsAttribute(eShadeMode); + } } void EnhancedShapeDumper::dumpExtrusionAsAttribute(sal_Bool bExtrusion) { @@ -224,4 +236,33 @@ void EnhancedShapeDumper::dumpSecondLightDirectionAsElement(drawing::Direction3D xmlTextWriterEndElement( xmlWriter ); } +void EnhancedShapeDumper::dumpMetalAsAttribute(sal_Bool bMetal) +{ + if(bMetal) + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("metal"), "%s", "true"); + else + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("metal"), "%s", "false"); +} + +void EnhancedShapeDumper::dumpShadeModeAsAttribute(drawing::ShadeMode eShadeMode) +{ + switch(eShadeMode) + { + case drawing::ShadeMode_FLAT: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("shadeMode"), "%s", "FLAT"); + break; + case drawing::ShadeMode_PHONG: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("shadeMode"), "%s", "PHONG"); + break; + case drawing::ShadeMode_SMOOTH: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("shadeMode"), "%s", "SMOOTH"); + break; + case drawing::ShadeMode_DRAFT: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("shadeMode"), "%s", "DRAFT"); + break; + default: + break; + } +} + |