summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArtur Dorda <artur.dorda+libo@gmail.com>2012-07-03 21:23:31 +0200
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2012-07-12 03:10:16 +0200
commit39e516aaedd8261949d7c866c550dd3e00274a17 (patch)
treedaf85b9fab26b1c7087d396350f7d03976b16401
parent3501827a4fecd0ca174715a5688ddaf10ad33cdf (diff)
Added properties ViewPoint & Origin
Change-Id: I87deba7504eff3feb6671835b33768045f502ba5
-rw-r--r--drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx3
-rw-r--r--drawinglayer/source/dumper/EnhancedShapeDumper.cxx28
2 files changed, 31 insertions, 0 deletions
diff --git a/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx b/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx
index 5a5fbf8eeedd..ed35546bd042 100644
--- a/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx
+++ b/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx
@@ -33,6 +33,7 @@
#include <com/sun/star/drawing/Direction3D.hpp>
#include <com/sun/star/drawing/ShadeMode.hpp>
#include <com/sun/star/drawing/ProjectionMode.hpp>
+#include <com/sun/star/drawing/Position3D.hpp>
#ifndef EnhancedShapeDumper_hxx
#define EnhancedShapeDumper_hxx
@@ -73,6 +74,8 @@ public:
void dumpSkewAsElement(com::sun::star::drawing::EnhancedCustomShapeParameterPair aSkew);
void dumpSpecularityAsAttribute(double aSpecularity);
void dumpProjectionModeAsAttribute(com::sun::star::drawing::ProjectionMode eProjectionMode);
+ void dumpViewPointAsElement(com::sun::star::drawing::Position3D aViewPoint);
+ void dumpOriginAsElement(com::sun::star::drawing::EnhancedCustomShapeParameterPair aOrigin);
private:
xmlTextWriterPtr xmlWriter;
diff --git a/drawinglayer/source/dumper/EnhancedShapeDumper.cxx b/drawinglayer/source/dumper/EnhancedShapeDumper.cxx
index 5b9b5acd3da6..152e1faabe8f 100644
--- a/drawinglayer/source/dumper/EnhancedShapeDumper.cxx
+++ b/drawinglayer/source/dumper/EnhancedShapeDumper.cxx
@@ -158,6 +158,18 @@ void EnhancedShapeDumper::dumpEnhancedCustomShapeExtrusionService(uno::Reference
if(anotherAny >>= eProjectionMode)
dumpProjectionModeAsAttribute(eProjectionMode);
}
+ {
+ uno::Any anotherAny = xPropSet->getPropertyValue("ViewPoint");
+ drawing::Position3D aViewPoint;
+ if(anotherAny >>= aViewPoint)
+ dumpViewPointAsElement(aViewPoint);
+ }
+ {
+ uno::Any anotherAny = xPropSet->getPropertyValue("Origin");
+ drawing::EnhancedCustomShapeParameterPair aOrigin;
+ if(anotherAny >>= aOrigin)
+ dumpOriginAsElement(aOrigin);
+ }
}
void EnhancedShapeDumper::dumpExtrusionAsAttribute(sal_Bool bExtrusion)
{
@@ -347,4 +359,20 @@ void EnhancedShapeDumper::dumpProjectionModeAsAttribute(drawing::ProjectionMode
}
}
+void EnhancedShapeDumper::dumpViewPointAsElement(drawing::Position3D aViewPoint)
+{
+ xmlTextWriterStartElement(xmlWriter, BAD_CAST( "ViewPoint" ));
+ xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("positionX"), "%f", aViewPoint.PositionX);
+ xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("positionY"), "%f", aViewPoint.PositionY);
+ xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("positionZ"), "%f", aViewPoint.PositionZ);
+ xmlTextWriterEndElement( xmlWriter );
+}
+
+void EnhancedShapeDumper::dumpOriginAsElement(drawing::EnhancedCustomShapeParameterPair aOrigin)
+{
+ xmlTextWriterStartElement(xmlWriter, BAD_CAST( "Origin" ));
+ dumpEnhancedCustomShapeParameterPair(aOrigin);
+ xmlTextWriterEndElement( xmlWriter );
+}
+