summaryrefslogtreecommitdiff
path: root/include/oox
diff options
context:
space:
mode:
authorJacobo Aragunde Pérez <jaragunde@igalia.com>2014-05-06 12:45:54 +0200
committerJacobo Aragunde Pérez <jaragunde@igalia.com>2014-05-06 16:32:28 +0200
commit36e22e83a1ca3106d6ef3fbb6ba066a447a65601 (patch)
tree6c51dd7865be3f57dabe33412c87294c561a51af /include/oox
parent1b7773cb071c7bbf60ea023551f35375b6120d4a (diff)
oox: preserve camera rotation on shape 3D effects.
Camera options in shape 3D effects can have rotation settings like in the following example: <a:camera prst="perspectiveRelaxedModerately" zoom="150000"> <a:rot lat="19490639" lon="0" rev="12900001"/> </a:camera> This patch preserves the a:rot tag and its attributes using the shape grab bag. We created the class Scene3DRotationPropertiesContext to be piled on top of a Scene3DPropertiesContext and process the contents of the child item. It also adds a unit test for this case. Change-Id: Id6bf58ad05fe5b49061619b6750ed0658badc9af
Diffstat (limited to 'include/oox')
-rw-r--r--include/oox/drawingml/scene3dcontext.hxx11
-rw-r--r--include/oox/drawingml/shape3dproperties.hxx8
2 files changed, 19 insertions, 0 deletions
diff --git a/include/oox/drawingml/scene3dcontext.hxx b/include/oox/drawingml/scene3dcontext.hxx
index bbee4e677b9f..82af76eba44b 100644
--- a/include/oox/drawingml/scene3dcontext.hxx
+++ b/include/oox/drawingml/scene3dcontext.hxx
@@ -27,6 +27,17 @@ namespace oox { namespace drawingml {
struct Shape3DProperties;
+class Scene3DRotationPropertiesContext : public ::oox::core::ContextHandler2
+{
+public:
+ Scene3DRotationPropertiesContext( ::oox::core::ContextHandler2Helper& rParent, RotationProperties& rRotationProperties ) throw();
+
+ ::oox::core::ContextHandlerRef onCreateContext( ::sal_Int32 Element, const ::oox::AttributeList& rAttribs ) SAL_OVERRIDE;
+
+private:
+ RotationProperties& mrRotationProperties;
+};
+
class Scene3DPropertiesContext : public ::oox::core::ContextHandler2
{
public:
diff --git a/include/oox/drawingml/shape3dproperties.hxx b/include/oox/drawingml/shape3dproperties.hxx
index 9d89753867ab..efce9e0d0566 100644
--- a/include/oox/drawingml/shape3dproperties.hxx
+++ b/include/oox/drawingml/shape3dproperties.hxx
@@ -36,6 +36,13 @@ namespace drawingml {
+struct RotationProperties
+{
+ OptValue< sal_Int32 > mnLatitude;
+ OptValue< sal_Int32 > mnLongitude;
+ OptValue< sal_Int32 > mnRevolution;
+};
+
struct Shape3DProperties
{
OptValue< sal_Int32 > mnPreset;
@@ -43,6 +50,7 @@ struct Shape3DProperties
OptValue< float > mfZoom;
OptValue< sal_Int32 > mnLightRigDirection;
OptValue< sal_Int32 > mnLightRigType;
+ RotationProperties maCameraRotation;
/** Overwrites all members that are explicitly set in rSourceProps. */
void assignUsed( const Shape3DProperties& rSourceProps );