summaryrefslogtreecommitdiff
path: root/oox
diff options
context:
space:
mode:
authorJacobo Aragunde Pérez <jaragunde@igalia.com>2014-04-30 19:00:43 +0200
committerJacobo Aragunde Pérez <jaragunde@igalia.com>2014-05-06 16:32:27 +0200
commit8d2a5c16c7e487b407aced891da17e5c2486f2ff (patch)
treee643c2073c2a073cded910039a611f47b4709390 /oox
parent9bb6956197c5caaa150fc8ed52233741749a4060 (diff)
oox: Integrate Shape3DProperties and Scene3DPropertiesContext
Code for these two classes was already present but it was commented out or left outside of the build system because it didn't even compile. I've brought it back and made it compile, but it has no use yet. The goal is using it to preserve 3D transformations. At scene3dcontext.cxx I removed the text chunks found in the middle of the source and corrected some mistakes; I also modified the conversion of "fov" attribute. At shape3dproperties.hxx I removed all the struct members because they seemed to have been copied&pasted from another file, and added only those members that made sense. Removed useless function definitions. Change-Id: I2c00ea638e1a4fb1a3820bc4c322488296d3e6d7
Diffstat (limited to 'oox')
-rw-r--r--oox/Library_oox.mk1
-rw-r--r--oox/source/drawingml/scene3dcontext.cxx123
-rw-r--r--oox/source/drawingml/shape.cxx1
-rw-r--r--oox/source/drawingml/shapepropertiescontext.cxx2
4 files changed, 11 insertions, 116 deletions
diff --git a/oox/Library_oox.mk b/oox/Library_oox.mk
index 791c2f0d543e..4df15bc223a4 100644
--- a/oox/Library_oox.mk
+++ b/oox/Library_oox.mk
@@ -153,6 +153,7 @@ $(eval $(call gb_Library_add_exception_objects,oox,\
oox/source/drawingml/linepropertiescontext \
oox/source/drawingml/lineproperties \
oox/source/drawingml/objectdefaultcontext \
+ oox/source/drawingml/scene3dcontext \
oox/source/drawingml/shapecontext \
oox/source/drawingml/shape \
oox/source/drawingml/shape3dproperties \
diff --git a/oox/source/drawingml/scene3dcontext.cxx b/oox/source/drawingml/scene3dcontext.cxx
index 24323ef37e50..bc0c1b96e27e 100644
--- a/oox/source/drawingml/scene3dcontext.cxx
+++ b/oox/source/drawingml/scene3dcontext.cxx
@@ -25,146 +25,39 @@
#include "oox/drawingml/colorchoicecontext.hxx"
#include "oox/drawingml/drawingmltypes.hxx"
#include "oox/drawingml/fillproperties.hxx"
-#include "oox/core/namespaces.hxx"
#include "oox/core/xmlfilterbase.hxx"
#include "oox/helper/attributelist.hxx"
-using ::oox::core::ContextHandler;
-using ::oox::core::XmlFilterBase;
+using namespace ::oox::core;
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::xml::sax;
namespace oox { namespace drawingml {
-Scene3DContext::Scene3DContext( ContextHandler2Helper& rParent, Shape3DProperties& r3DProperties ) throw()
+Scene3DPropertiesContext::Scene3DPropertiesContext( ContextHandler2Helper& rParent, Shape3DProperties& r3DProperties ) throw()
: ContextHandler2( rParent )
, mr3DProperties( r3DProperties )
{
}
-ContextHandlerRef Scene3DContext::onCreateContext( sal_Int32 aElementToken, const AttributeList& rAttribs )
+ContextHandlerRef Scene3DPropertiesContext::onCreateContext( sal_Int32 aElementToken, const AttributeList& rAttribs )
{
switch( aElementToken )
{
- case NMSP_DRAWINGML|XML_camera:
- mr3DProperties.mfFieldOfVision = rAttribs.getInteger( XML_fov, 0 ) / 36000000.0;
+ case A_TOKEN( camera ):
+ mr3DProperties.mfFieldOfVision = rAttribs.getInteger( XML_fov, 0 ) / 60000.0; // 60000ths of degree
mr3DProperties.mfZoom = rAttribs.getInteger( XML_zoom, 100000 ) / 100000.0;
mr3DProperties.mnPreset = rAttribs.getToken( XML_prst, XML_none );
-
-legacyObliqueTopLeft
-legacyObliqueTop
-legacyObliqueTopRight
-legacyObliqueLeft
-legacyObliqueFront
-legacyObliqueRight
-legacyObliqueBottomLeft
-legacyObliqueBottom
-legacyObliqueBottomRight
-legacyPerspectiveTopLeft
-legacyPerspectiveTop
-legacyPerspectiveTopRight
-legacyPerspectiveLeft
-legacyPerspectiveFront
-legacyPerspectiveRight
-legacyPerspectiveBottomLeft
-legacyPerspectiveBottom
-legacyPerspectiveBottomRight
-orthographicFront
-isometricTopUp
-isometricTopDown
-isometricBottomUp
-isometricBottomDown
-isometricLeftUp
-isometricLeftDown
-isometricRightUp
-isometricRightDown
-isometricOffAxis1Left
-isometricOffAxis1Right
-isometricOffAxis1Top
-isometricOffAxis2Left
-isometricOffAxis2Right
-isometricOffAxis2Top
-isometricOffAxis3Left
-isometricOffAxis3Right
-isometricOffAxis3Bottom
-isometricOffAxis4Left
-isometricOffAxis4Right
-isometricOffAxis4Bottom
-obliqueTopLeft
-obliqueTop
-obliqueTopRight
-obliqueLeft
-obliqueRight
-obliqueBottomLeft
-obliqueBottom
-obliqueBottomRight
-perspectiveFront
-perspectiveLeft
-perspectiveRight
-perspectiveAbove
-perspectiveBelow
-perspectiveAboveLeftFacing
-perspectiveAboveRightFacing
-perspectiveContrastingLeftFacing
-perspectiveContrastingRightFacing
-perspectiveHeroicLeftFacing
-perspectiveHeroicRightFacing
-perspectiveHeroicExtremeLeftFacing
-perspectiveHeroicExtremeRightFacing
-perspectiveRelaxed
-perspectiveRelaxedModerately
-
-
// TODO: nested element XML_rot
break;
- case NMSP_DRAWINGML|XML_lightRig:
+ case A_TOKEN( lightRig ):
mr3DProperties.mnLightRigDirection = rAttribs.getToken( XML_dir, XML_none );
-
-XML_tl
-XML_t
-XML_tr
-XML_l
-XML_r
-XML_bl
-XML_b
-XML_br
-
-
mr3DProperties.mnLightRigType = rAttribs.getToken( XML_rig, XML_none );
-
-XML_legacyFlat1
-XML_legacyFlat2
-XML_legacyFlat3
-XML_legacyFlat4
-XML_legacyNormal1
-XML_legacyNormal2
-XML_legacyNormal3
-XML_legacyNormal4
-XML_legacyHarsh1
-XML_legacyHarsh2
-XML_legacyHarsh3
-XML_legacyHarsh4
-XML_threePt
-XML_balanced
-XML_soft
-XML_harsh
-XML_flood
-XML_contrasting
-XML_morning
-XML_sunrise
-XML_sunset
-XML_chilly
-XML_freezing
-XML_flat
-XML_twoPt
-XML_glow
-XML_brightRoom
-
// TODO: nested element XML_rot
break;
- case NMSP_DRAWINGML|XML_backdrop:
- case NMSP_DRAWINGML|XML_extLst:
+ case A_TOKEN( backdrop ):
+ case A_TOKEN( extLst ):
return 0; // TODO: later (backdrop is not supported by core anyway)
}
return 0;
diff --git a/oox/source/drawingml/shape.cxx b/oox/source/drawingml/shape.cxx
index fd5cb40ea5c5..4e06de08b21c 100644
--- a/oox/source/drawingml/shape.cxx
+++ b/oox/source/drawingml/shape.cxx
@@ -93,6 +93,7 @@ Shape::Shape( const sal_Char* pServiceName, bool bDefaultHeight )
, mpFillPropertiesPtr( new FillProperties )
, mpGraphicPropertiesPtr( new GraphicProperties )
, mpCustomShapePropertiesPtr( new CustomShapeProperties )
+, mp3DPropertiesPtr( new Shape3DProperties )
, mpEffectPropertiesPtr( new EffectProperties )
, mpMasterTextListStyle( new TextListStyle )
, mnSubType( 0 )
diff --git a/oox/source/drawingml/shapepropertiescontext.cxx b/oox/source/drawingml/shapepropertiescontext.cxx
index 488f8a0dbe2f..10130d3e5eef 100644
--- a/oox/source/drawingml/shapepropertiescontext.cxx
+++ b/oox/source/drawingml/shapepropertiescontext.cxx
@@ -96,7 +96,7 @@ ContextHandlerRef ShapePropertiesContext::onCreateContext( sal_Int32 aElementTok
// todo
case A_TOKEN( scene3d ): // CT_Scene3D
-// return new Scene3DContext( *this, rAttribs, *(mrShape.get3DShapeProperties()) );
+ return new Scene3DPropertiesContext( *this, mrShape.get3DProperties() );
break;
// todo