diff options
author | Daniel Rentz [dr] <daniel.rentz@oracle.com> | 2010-11-08 13:47:01 +0100 |
---|---|---|
committer | Daniel Rentz [dr] <daniel.rentz@oracle.com> | 2010-11-08 13:47:01 +0100 |
commit | 6cafb68322fa85a54a6fa1ca47239af459f519ce (patch) | |
tree | 41d02f348e9dd2c6791347563d7f5b9205a3b458 /oox/source/ppt | |
parent | 0b66e33ee50cd1c77bd9b1073ab298bac03bcfb7 (diff) |
dr77: optimizations in generation of XML tokens, XML namespaces, property names; code cleanup
Diffstat (limited to 'oox/source/ppt')
27 files changed, 230 insertions, 290 deletions
diff --git a/oox/source/ppt/animationspersist.cxx b/oox/source/ppt/animationspersist.cxx index 456b0616af1c..fdee865251af 100644 --- a/oox/source/ppt/animationspersist.cxx +++ b/oox/source/ppt/animationspersist.cxx @@ -25,8 +25,6 @@ * ************************************************************************/ - - #include "oox/ppt/animationspersist.hxx" #include <rtl/ustring.hxx> @@ -38,8 +36,6 @@ #include "oox/drawingml/shape.hxx" -#include "tokens.hxx" - using rtl::OUString; using namespace ::com::sun::star::uno; using namespace ::com::sun::star::presentation; diff --git a/oox/source/ppt/animationtypes.cxx b/oox/source/ppt/animationtypes.cxx index 80d87dd49ad2..6346a8058c5d 100644 --- a/oox/source/ppt/animationtypes.cxx +++ b/oox/source/ppt/animationtypes.cxx @@ -32,8 +32,6 @@ #include "oox/helper/attributelist.hxx" -#include "tokens.hxx" - using namespace ::com::sun::star::uno; using namespace ::com::sun::star::animations; using namespace ::com::sun::star::xml::sax; diff --git a/oox/source/ppt/animvariantcontext.cxx b/oox/source/ppt/animvariantcontext.cxx index e2eca9a36dca..449c4ef73d11 100644 --- a/oox/source/ppt/animvariantcontext.cxx +++ b/oox/source/ppt/animvariantcontext.cxx @@ -35,12 +35,10 @@ #include <rtl/ustring.hxx> #include "oox/helper/attributelist.hxx" -#include "oox/core/namespaces.hxx" #include "oox/core/fragmenthandler.hxx" #include "oox/core/xmlfilterbase.hxx" #include "oox/drawingml/colorchoicecontext.hxx" #include "pptfilterhelpers.hxx" -#include "tokens.hxx" using ::rtl::OUString; using namespace ::oox::core; @@ -80,29 +78,29 @@ namespace oox { namespace ppt { switch( aElementToken ) { - case NMSP_PPT|XML_boolVal: + case PPT_TOKEN( boolVal ): { bool val = attribs.getBool( XML_val, false ); maValue = makeAny( val ); break; } - case NMSP_PPT|XML_clrVal: + case PPT_TOKEN( clrVal ): xRet.set( new ::oox::drawingml::ColorContext( *this, maColor ) ); // we'll defer setting the Any until the end. break; - case NMSP_PPT|XML_fltVal: + case PPT_TOKEN( fltVal ): { double val = attribs.getDouble( XML_val, 0.0 ); maValue = makeAny( val ); break; } - case NMSP_PPT|XML_intVal: + case PPT_TOKEN( intVal ): { sal_Int32 val = attribs.getInteger( XML_val, 0 ); maValue = makeAny( val ); break; } - case NMSP_PPT|XML_strVal: + case PPT_TOKEN( strVal ): { OUString val = attribs.getString( XML_val, OUString() ); convertMeasure( val ); // ignore success or failure if it fails, use as is diff --git a/oox/source/ppt/backgroundproperties.cxx b/oox/source/ppt/backgroundproperties.cxx index 5b6fc4076a80..65664bdd3691 100644 --- a/oox/source/ppt/backgroundproperties.cxx +++ b/oox/source/ppt/backgroundproperties.cxx @@ -28,8 +28,6 @@ #include "oox/ppt/backgroundproperties.hxx" #include "oox/drawingml/fillpropertiesgroupcontext.hxx" #include "oox/drawingml/drawingmltypes.hxx" -#include "oox/core/namespaces.hxx" -#include "tokens.hxx" using ::rtl::OUString; using namespace ::oox::core; @@ -51,7 +49,7 @@ Reference< XFastContextHandler > BackgroundPropertiesContext::createFastChildCon switch( aElementToken ) { - case NMSP_PPT|XML_fill: // a:CT_FillEffect + case PPT_TOKEN( fill ): // a:CT_FillEffect break; } diff --git a/oox/source/ppt/buildlistcontext.cxx b/oox/source/ppt/buildlistcontext.cxx index 61148265dfbe..3352e202e057 100644 --- a/oox/source/ppt/buildlistcontext.cxx +++ b/oox/source/ppt/buildlistcontext.cxx @@ -28,7 +28,6 @@ #include "buildlistcontext.hxx" #include <rtl/ustring.hxx> #include "oox/helper/attributelist.hxx" -#include "oox/core/namespaces.hxx" using namespace ::oox::core; @@ -56,7 +55,7 @@ namespace oox { namespace ppt { { switch( aElement ) { - case NMSP_PPT|XML_bldGraphic: + case PPT_TOKEN( bldGraphic ): mbInBldGraphic = false; break; default: @@ -72,18 +71,18 @@ namespace oox { namespace ppt { switch( aElementToken ) { - case NMSP_PPT|XML_bldAsOne: + case PPT_TOKEN( bldAsOne ): if( mbInBldGraphic ) { mbBuildAsOne = true; } break; - case NMSP_PPT|XML_bldSub: + case PPT_TOKEN( bldSub ): if( mbInBldGraphic ) { } break; - case NMSP_PPT|XML_bldGraphic: + case PPT_TOKEN( bldGraphic ): { mbInBldGraphic = true; AttributeList attribs( xAttribs ); @@ -94,9 +93,9 @@ namespace oox { namespace ppt { // sal_uInt32 nGroupId = attribs.getUnsignedInteger( XML_grpId, 0 ); break; } - case NMSP_DRAWINGML|XML_bldDgm: - case NMSP_DRAWINGML|XML_bldOleChart: - case NMSP_DRAWINGML|XML_bldP: + case A_TOKEN( bldDgm ): + case A_TOKEN( bldOleChart ): + case A_TOKEN( bldP ): break; default: diff --git a/oox/source/ppt/commonbehaviorcontext.cxx b/oox/source/ppt/commonbehaviorcontext.cxx index 36841bab5aae..a4e3951228ae 100644 --- a/oox/source/ppt/commonbehaviorcontext.cxx +++ b/oox/source/ppt/commonbehaviorcontext.cxx @@ -34,14 +34,12 @@ #include <com/sun/star/animations/XAnimationNode.hpp> #include <com/sun/star/animations/XAnimate.hpp> -#include "oox/core/namespaces.hxx" #include "oox/core/fragmenthandler.hxx" #include "commonbehaviorcontext.hxx" #include "commontimenodecontext.hxx" #include "timetargetelementcontext.hxx" #include "pptfilterhelpers.hxx" -#include "tokens.hxx" #include <string.h> @@ -57,7 +55,7 @@ namespace oox { namespace ppt { CommonBehaviorContext::CommonBehaviorContext( ContextHandler& rParent, const Reference< XFastAttributeList >& xAttribs, const TimeNodePtr & pNode ) - : TimeNodeContext( rParent, NMSP_PPT|XML_cBhvr, xAttribs, pNode ) + : TimeNodeContext( rParent, PPT_TOKEN( cBhvr ), xAttribs, pNode ) , mbInAttrList( false ) , mbIsInAttrName( false ) { @@ -75,7 +73,7 @@ namespace oox { namespace ppt { { switch( aElement ) { - case NMSP_PPT|XML_cBhvr: + case PPT_TOKEN( cBhvr ): { if( !maAttributes.empty() ) { @@ -94,10 +92,10 @@ namespace oox { namespace ppt { } break; } - case NMSP_PPT|XML_attrNameLst: + case PPT_TOKEN( attrNameLst ): mbInAttrList = false; break; - case NMSP_PPT|XML_attrName: + case PPT_TOKEN( attrName ): if( mbIsInAttrName ) { const ImplAttributeNameConversion *attrConv = gImplConversionList; @@ -145,16 +143,16 @@ namespace oox { namespace ppt { switch ( aElementToken ) { - case NMSP_PPT|XML_cTn: + case PPT_TOKEN( cTn ): xRet.set( new CommonTimeNodeContext( *this, aElementToken, xAttribs, mpNode ) ); break; - case NMSP_PPT|XML_tgtEl: + case PPT_TOKEN( tgtEl ): xRet.set( new TimeTargetElementContext( *this, mpNode->getTarget() ) ); break; - case NMSP_PPT|XML_attrNameLst: + case PPT_TOKEN( attrNameLst ): mbInAttrList = true; break; - case NMSP_PPT|XML_attrName: + case PPT_TOKEN( attrName ): { if( mbInAttrList ) { diff --git a/oox/source/ppt/commontimenodecontext.cxx b/oox/source/ppt/commontimenodecontext.cxx index d7de40255298..1057deb70c5d 100644 --- a/oox/source/ppt/commontimenodecontext.cxx +++ b/oox/source/ppt/commontimenodecontext.cxx @@ -42,13 +42,11 @@ #include <com/sun/star/presentation/EffectNodeType.hpp> #include "oox/helper/attributelist.hxx" -#include "oox/core/namespaces.hxx" #include "oox/core/fragmenthandler.hxx" #include "oox/ppt/pptimport.hxx" #include "oox/drawingml/drawingmltypes.hxx" #include "animationtypes.hxx" -#include "tokens.hxx" using namespace ::oox::core; using namespace ::com::sun::star::uno; @@ -619,7 +617,7 @@ static OUString getConvertedSubType( sal_Int16 nPresetClass, sal_Int32 nPresetId void SAL_CALL CommonTimeNodeContext::endFastElement( sal_Int32 aElement ) throw ( SAXException, RuntimeException) { - if( aElement == ( NMSP_PPT|XML_iterate ) ) + if( aElement == ( PPT_TOKEN( iterate ) ) ) { mbIterate = false; } @@ -632,22 +630,22 @@ static OUString getConvertedSubType( sal_Int16 nPresetClass, sal_Int32 nPresetId switch ( aElementToken ) { - case NMSP_PPT|XML_childTnLst: - case NMSP_PPT|XML_subTnLst: + case PPT_TOKEN( childTnLst ): + case PPT_TOKEN( subTnLst ): xRet.set( new TimeNodeListContext( *this, mpNode->getChildren() ) ); break; - case NMSP_PPT|XML_stCondLst: + case PPT_TOKEN( stCondLst ): xRet.set( new CondListContext( *this, aElementToken, xAttribs, mpNode, mpNode->getStartCondition() ) ); break; - case NMSP_PPT|XML_endCondLst: + case PPT_TOKEN( endCondLst ): xRet.set( new CondListContext( *this, aElementToken, xAttribs, mpNode, mpNode->getEndCondition() ) ); break; - case NMSP_PPT|XML_endSync: + case PPT_TOKEN( endSync ): xRet.set( new CondContext( *this, xAttribs, mpNode, mpNode->getEndSyncValue() ) ); break; - case NMSP_PPT|XML_iterate: + case PPT_TOKEN( iterate ): { sal_Int32 nVal = xAttribs->getOptionalValueToken( XML_type, XML_el ); if( nVal != 0 ) @@ -680,7 +678,7 @@ static OUString getConvertedSubType( sal_Int16 nPresetClass, sal_Int32 nPresetId mbIterate = true; break; } - case NMSP_PPT|XML_tmAbs: + case PPT_TOKEN( tmAbs ): if( mbIterate ) { AttributeList attribs( xAttribs ); @@ -689,7 +687,7 @@ static OUString getConvertedSubType( sal_Int16 nPresetClass, sal_Int32 nPresetId mpNode->getNodeProperties()[ NP_ITERATEINTERVAL ] <<= fTime; } break; - case NMSP_PPT|XML_tmPct: + case PPT_TOKEN( tmPct ): if( mbIterate ) { AttributeList attribs( xAttribs ); diff --git a/oox/source/ppt/conditioncontext.cxx b/oox/source/ppt/conditioncontext.cxx index e52d8b27a464..5b622b6ef602 100644 --- a/oox/source/ppt/conditioncontext.cxx +++ b/oox/source/ppt/conditioncontext.cxx @@ -37,13 +37,11 @@ #include <com/sun/star/animations/EventTrigger.hpp> #include "oox/helper/attributelist.hxx" -#include "oox/core/namespaces.hxx" #include "oox/core/contexthandler.hxx" #include "oox/ppt/animationspersist.hxx" #include "animationtypes.hxx" #include "timetargetelementcontext.hxx" -#include "tokens.hxx" using namespace ::oox::core; using namespace ::com::sun::star::uno; @@ -54,7 +52,7 @@ namespace oox { namespace ppt { CondContext::CondContext( ContextHandler& rParent, const Reference< XFastAttributeList >& xAttribs, const TimeNodePtr & pNode, AnimationCondition & aValue ) - : TimeNodeContext( rParent, NMSP_PPT|XML_cond, xAttribs, pNode ) + : TimeNodeContext( rParent, PPT_TOKEN( cond ), xAttribs, pNode ) , maCond( aValue ) { maEvent.Trigger = EventTrigger::NONE; @@ -123,7 +121,7 @@ namespace oox { namespace ppt { switch( aElementToken ) { - case NMSP_PPT|XML_rtn: + case PPT_TOKEN( rtn ): { // ST_TLTriggerRuntimeNode { first, last, all } sal_Int32 aTok; @@ -147,7 +145,7 @@ namespace oox { namespace ppt { maCond.maValue = makeAny( nEnum ); break; } - case NMSP_PPT|XML_tn: + case PPT_TOKEN( tn ): { maCond.mnType = aElementToken; AttributeList attribs( xAttribs ); @@ -155,7 +153,7 @@ namespace oox { namespace ppt { maCond.maValue = makeAny( nId ); break; } - case NMSP_PPT|XML_tgtEl: + case PPT_TOKEN( tgtEl ): // CT_TLTimeTargetElement xRet.set( new TimeTargetElementContext( *this, maCond.getTarget() ) ); break; @@ -194,7 +192,7 @@ namespace oox { namespace ppt { switch( aElement ) { - case NMSP_PPT|XML_cond: + case PPT_TOKEN( cond ): // add a condition to the list maConditions.push_back( AnimationCondition() ); xRet.set( new CondContext( *this, xAttribs, mpNode, maConditions.back() ) ); diff --git a/oox/source/ppt/customshowlistcontext.cxx b/oox/source/ppt/customshowlistcontext.cxx index 613000d07d41..f66ccb0f6084 100644 --- a/oox/source/ppt/customshowlistcontext.cxx +++ b/oox/source/ppt/customshowlistcontext.cxx @@ -26,9 +26,6 @@ ************************************************************************/ #include "customshowlistcontext.hxx" -#include "oox/core/namespaces.hxx" -#include "tokens.hxx" - using namespace ::oox::core; using namespace ::com::sun::star::uno; @@ -71,8 +68,8 @@ Reference< XFastContextHandler > SAL_CALL CustomShowContext::createFastChildCont Reference< XFastContextHandler > xRet; switch( aElementToken ) { - case NMSP_PPT|XML_sld : - mrCustomShow.maSldLst.push_back( xAttribs->getOptionalValue( NMSP_RELATIONSHIPS | XML_id ) ); + case PPT_TOKEN( sld ) : + mrCustomShow.maSldLst.push_back( xAttribs->getOptionalValue( R_TOKEN( id ) ) ); default: break; } @@ -102,7 +99,7 @@ Reference< XFastContextHandler > SAL_CALL CustomShowListContext::createFastChild Reference< XFastContextHandler > xRet; switch( aElementToken ) { - case NMSP_PPT|XML_custShow : + case PPT_TOKEN( custShow ) : { CustomShow aCustomShow; mrCustomShowList.push_back( aCustomShow ); diff --git a/oox/source/ppt/headerfootercontext.cxx b/oox/source/ppt/headerfootercontext.cxx index 69f23b77c0da..2089b019c58c 100644 --- a/oox/source/ppt/headerfootercontext.cxx +++ b/oox/source/ppt/headerfootercontext.cxx @@ -26,9 +26,7 @@ ************************************************************************/ #include "headerfootercontext.hxx" -#include "oox/core/namespaces.hxx" #include "oox/helper/attributelist.hxx" -#include "tokens.hxx" using namespace ::oox::core; using namespace ::com::sun::star::uno; diff --git a/oox/source/ppt/layoutfragmenthandler.cxx b/oox/source/ppt/layoutfragmenthandler.cxx index d291550ac321..152beb280bd7 100644 --- a/oox/source/ppt/layoutfragmenthandler.cxx +++ b/oox/source/ppt/layoutfragmenthandler.cxx @@ -34,8 +34,6 @@ #include "headerfootercontext.hxx" #include "oox/ppt/layoutfragmenthandler.hxx" #include "oox/drawingml/shapegroupcontext.hxx" -#include "oox/core/namespaces.hxx" -#include "tokens.hxx" using rtl::OUString; using namespace ::com::sun::star; @@ -67,10 +65,10 @@ Reference< XFastContextHandler > LayoutFragmentHandler::createFastChildContext( Reference< XFastContextHandler > xRet = getFastContextHandler(); switch( aElementToken ) { - case NMSP_PPT|XML_sldLayout: // CT_SlideLayout + case PPT_TOKEN( sldLayout ): // CT_SlideLayout mpSlidePersistPtr->setLayoutValueToken( xAttribs->getOptionalValueToken( XML_type, 0 ) ); // CT_SlideLayoutType break; - case NMSP_PPT|XML_hf: // CT_HeaderFooter + case PPT_TOKEN( hf ): // CT_HeaderFooter xRet.set( new HeaderFooterContext( *this, xAttribs, mpSlidePersistPtr->getHeaderFooter() ) ); break; default: diff --git a/oox/source/ppt/pptimport.cxx b/oox/source/ppt/pptimport.cxx index 249db6c09426..625e4e662e3c 100644 --- a/oox/source/ppt/pptimport.cxx +++ b/oox/source/ppt/pptimport.cxx @@ -75,9 +75,9 @@ bool PowerPointImport::importDocument() throw() file:///<path-to-oox-module>/source/dump/pptxdumper.ini. */ OOX_DUMP_FILE( ::oox::dump::pptx::Dumper ); - OUString aFragmentPath = getFragmentPathFromFirstType( CREATE_OFFICEDOC_RELATIONSTYPE( "officeDocument" ) ); + OUString aFragmentPath = getFragmentPathFromFirstType( CREATE_OFFICEDOC_RELATION_TYPE( "officeDocument" ) ); FragmentHandlerRef xPresentationFragmentHandler( new PresentationFragmentHandler( *this, aFragmentPath ) ); - maTableStyleListPath = xPresentationFragmentHandler->getFragmentPathFromFirstType( CREATE_OFFICEDOC_RELATIONSTYPE( "tableStyles" ) ); + maTableStyleListPath = xPresentationFragmentHandler->getFragmentPathFromFirstType( CREATE_OFFICEDOC_RELATION_TYPE( "tableStyles" ) ); return importFragment( xPresentationFragmentHandler ); diff --git a/oox/source/ppt/pptshape.cxx b/oox/source/ppt/pptshape.cxx index 60144bbbe79d..7437b378b324 100644 --- a/oox/source/ppt/pptshape.cxx +++ b/oox/source/ppt/pptshape.cxx @@ -26,10 +26,8 @@ ************************************************************************/ #include "oox/ppt/pptshape.hxx" -#include "oox/core/namespaces.hxx" #include "oox/core/xmlfilterbase.hxx" #include "oox/drawingml/textbody.hxx" -#include "tokens.hxx" #include <com/sun/star/container/XNamed.hpp> #include <com/sun/star/beans/XMultiPropertySet.hpp> diff --git a/oox/source/ppt/pptshapecontext.cxx b/oox/source/ppt/pptshapecontext.cxx index c59638553018..7df41ac3d714 100644 --- a/oox/source/ppt/pptshapecontext.cxx +++ b/oox/source/ppt/pptshapecontext.cxx @@ -37,14 +37,11 @@ #include "oox/ppt/pptshapepropertiescontext.hxx" #include "oox/ppt/slidepersist.hxx" #include "oox/drawingml/shapestylecontext.hxx" -#include "oox/core/namespaces.hxx" #include "oox/drawingml/fillpropertiesgroupcontext.hxx" #include "oox/drawingml/lineproperties.hxx" #include "oox/drawingml/drawingmltypes.hxx" #include "oox/drawingml/customshapegeometry.hxx" #include "oox/drawingml/textbodycontext.hxx" -#include "tokens.hxx" -#include "properties.hxx" using rtl::OUString; using namespace oox::core; @@ -102,9 +99,9 @@ Reference< XFastContextHandler > PPTShapeContext::createFastChildContext( sal_In switch( aElementToken ) { // nvSpPr CT_ShapeNonVisual begin - // case NMSP_PPT|XML_drElemPr: + // case PPT_TOKEN( drElemPr ): // break; - case NMSP_PPT|XML_cNvPr: + case PPT_TOKEN( cNvPr ): { AttributeList aAttribs( xAttribs ); mpShapePtr->setHidden( aAttribs.getBool( XML_hidden, false ) ); @@ -112,7 +109,7 @@ Reference< XFastContextHandler > PPTShapeContext::createFastChildContext( sal_In mpShapePtr->setName( xAttribs->getOptionalValue( XML_name ) ); break; } - case NMSP_PPT|XML_ph: + case PPT_TOKEN( ph ): { sal_Int32 nSubType( xAttribs->getOptionalValueToken( XML_type, XML_obj ) ); mpShapePtr->setSubType( nSubType ); @@ -191,15 +188,15 @@ Reference< XFastContextHandler > PPTShapeContext::createFastChildContext( sal_In // nvSpPr CT_ShapeNonVisual end - case NMSP_PPT|XML_spPr: + case PPT_TOKEN( spPr ): xRet = new PPTShapePropertiesContext( *this, *mpShapePtr ); break; - case NMSP_PPT|XML_style: + case PPT_TOKEN( style ): xRet = new oox::drawingml::ShapeStyleContext( *this, *mpShapePtr ); break; - case NMSP_PPT|XML_txBody: + case PPT_TOKEN( txBody ): { oox::drawingml::TextBodyPtr xTextBody( new oox::drawingml::TextBody ); xTextBody->getTextProperties().maPropertyMap[ PROP_FontIndependentLineSpacing ] <<= static_cast< sal_Bool >( sal_True ); diff --git a/oox/source/ppt/pptshapegroupcontext.cxx b/oox/source/ppt/pptshapegroupcontext.cxx index 074393874264..0ba36ee99417 100644 --- a/oox/source/ppt/pptshapegroupcontext.cxx +++ b/oox/source/ppt/pptshapegroupcontext.cxx @@ -39,8 +39,6 @@ #include "oox/drawingml/customshapegeometry.hxx" #include "oox/drawingml/textbodycontext.hxx" #include "oox/drawingml/connectorshapecontext.hxx" -#include "oox/core/namespaces.hxx" -#include "tokens.hxx" using rtl::OUString; using namespace oox::core; @@ -71,7 +69,7 @@ Reference< XFastContextHandler > PPTShapeGroupContext::createFastChildContext( s switch( aElementToken ) { - case NMSP_PPT|XML_cNvPr: + case PPT_TOKEN( cNvPr ): { AttributeList aAttribs( xAttribs ); mpGroupShapePtr->setHidden( aAttribs.getBool( XML_hidden, false ) ); @@ -79,36 +77,36 @@ Reference< XFastContextHandler > PPTShapeGroupContext::createFastChildContext( s mpGroupShapePtr->setName( xAttribs->getOptionalValue( XML_name ) ); break; } - case NMSP_PPT|XML_ph: + case PPT_TOKEN( ph ): mpGroupShapePtr->setSubType( xAttribs->getOptionalValueToken( XML_type, FastToken::DONTKNOW ) ); mpGroupShapePtr->setSubTypeIndex( xAttribs->getOptionalValue( XML_idx ).toInt32() ); break; // nvSpPr CT_ShapeNonVisual end - case NMSP_PPT|XML_grpSpPr: + case PPT_TOKEN( grpSpPr ): xRet = new oox::drawingml::ShapePropertiesContext( *this, *mpGroupShapePtr ); break; - case NMSP_PPT|XML_spPr: + case PPT_TOKEN( spPr ): xRet = new oox::drawingml::ShapePropertiesContext( *this, *mpGroupShapePtr ); break; /* - case NMSP_PPT|XML_style: + case PPT_TOKEN( style ): xRet = new ShapeStyleContext( getParser() ); break; */ - case NMSP_PPT|XML_cxnSp: // connector shape + case PPT_TOKEN( cxnSp ): // connector shape xRet.set( new oox::drawingml::ConnectorShapeContext( *this, mpGroupShapePtr, oox::drawingml::ShapePtr( new PPTShape( meShapeLocation, "com.sun.star.drawing.ConnectorShape" ) ) ) ); break; - case NMSP_PPT|XML_grpSp: // group shape + case PPT_TOKEN( grpSp ): // group shape xRet.set( new PPTShapeGroupContext( *this, mpSlidePersistPtr, meShapeLocation, mpGroupShapePtr, oox::drawingml::ShapePtr( new PPTShape( meShapeLocation, "com.sun.star.drawing.GroupShape" ) ) ) ); break; - case NMSP_PPT|XML_sp: // Shape + case PPT_TOKEN( sp ): // Shape xRet.set( new PPTShapeContext( *this, mpSlidePersistPtr, mpGroupShapePtr, oox::drawingml::ShapePtr( new PPTShape( meShapeLocation, "com.sun.star.drawing.CustomShape" ) ) ) ); break; - case NMSP_PPT|XML_pic: // CT_Picture + case PPT_TOKEN( pic ): // CT_Picture xRet.set( new oox::drawingml::GraphicShapeContext( *this, mpGroupShapePtr, oox::drawingml::ShapePtr( new PPTShape( meShapeLocation, "com.sun.star.drawing.GraphicObjectShape" ) ) ) ); break; - case NMSP_PPT|XML_graphicFrame: // CT_GraphicalObjectFrame + case PPT_TOKEN( graphicFrame ): // CT_GraphicalObjectFrame xRet.set( new oox::drawingml::GraphicalObjectFrameContext( *this, mpGroupShapePtr, oox::drawingml::ShapePtr( new PPTShape( meShapeLocation, "com.sun.star.drawing.OLE2Shape" ) ), true ) ); break; diff --git a/oox/source/ppt/pptshapepropertiescontext.cxx b/oox/source/ppt/pptshapepropertiescontext.cxx index b4af0f08a555..bddd74f4837a 100644 --- a/oox/source/ppt/pptshapepropertiescontext.cxx +++ b/oox/source/ppt/pptshapepropertiescontext.cxx @@ -35,14 +35,11 @@ #include "oox/ppt/pptshapepropertiescontext.hxx" #include "oox/ppt/slidepersist.hxx" #include "oox/drawingml/shapestylecontext.hxx" -#include "oox/core/namespaces.hxx" #include "oox/drawingml/fillpropertiesgroupcontext.hxx" #include "oox/drawingml/lineproperties.hxx" #include "oox/drawingml/drawingmltypes.hxx" #include "oox/drawingml/customshapegeometry.hxx" #include "oox/drawingml/textbodycontext.hxx" -#include "properties.hxx" -#include "tokens.hxx" using rtl::OUString; using namespace oox::core; @@ -68,7 +65,7 @@ Reference< XFastContextHandler > PPTShapePropertiesContext::createFastChildConte switch( aElementToken ) { - case NMSP_DRAWINGML | XML_xfrm: + case A_TOKEN( xfrm ): { mrShape.getShapeProperties()[ PROP_IsPlaceholderDependent ] <<= sal_False; diff --git a/oox/source/ppt/presentationfragmenthandler.cxx b/oox/source/ppt/presentationfragmenthandler.cxx index 786836fbc554..6976c965ad83 100644 --- a/oox/source/ppt/presentationfragmenthandler.cxx +++ b/oox/source/ppt/presentationfragmenthandler.cxx @@ -46,8 +46,6 @@ #include "oox/ppt/slidefragmenthandler.hxx" #include "oox/ppt/layoutfragmenthandler.hxx" #include "oox/ppt/pptimport.hxx" -#include "oox/core/namespaces.hxx" -#include "tokens.hxx" using rtl::OUString; using namespace ::com::sun::star; @@ -182,12 +180,12 @@ void PresentationFragmentHandler::endDocument() throw (SAXException, RuntimeExce FragmentHandlerRef xSlideFragmentHandler( new SlideFragmentHandler( rFilter, aSlideFragmentPath, pSlidePersistPtr, Slide ) ); // importing the corresponding masterpage/layout - OUString aLayoutFragmentPath = xSlideFragmentHandler->getFragmentPathFromFirstType( CREATE_OFFICEDOC_RELATIONSTYPE( "slideLayout" ) ); + OUString aLayoutFragmentPath = xSlideFragmentHandler->getFragmentPathFromFirstType( CREATE_OFFICEDOC_RELATION_TYPE( "slideLayout" ) ); if ( aLayoutFragmentPath.getLength() > 0 ) { // importing layout RelationsRef xLayoutRelations = rFilter.importRelations( aLayoutFragmentPath ); - OUString aMasterFragmentPath = xLayoutRelations->getFragmentPathFromFirstType( CREATE_OFFICEDOC_RELATIONSTYPE( "slideMaster" ) ); + OUString aMasterFragmentPath = xLayoutRelations->getFragmentPathFromFirstType( CREATE_OFFICEDOC_RELATION_TYPE( "slideMaster" ) ); if( aMasterFragmentPath.getLength() ) { // check if the corresponding masterpage+layout has already been imported @@ -221,7 +219,7 @@ void PresentationFragmentHandler::endDocument() throw (SAXException, RuntimeExce FragmentHandlerRef xMasterFragmentHandler( new SlideFragmentHandler( rFilter, aMasterFragmentPath, pMasterPersistPtr, Master ) ); // set the correct theme - OUString aThemeFragmentPath = xMasterFragmentHandler->getFragmentPathFromFirstType( CREATE_OFFICEDOC_RELATIONSTYPE( "theme" ) ); + OUString aThemeFragmentPath = xMasterFragmentHandler->getFragmentPathFromFirstType( CREATE_OFFICEDOC_RELATION_TYPE( "theme" ) ); if( aThemeFragmentPath.getLength() > 0 ) { std::map< OUString, oox::drawingml::ThemePtr >& rThemes( rFilter.getThemes() ); @@ -259,7 +257,7 @@ void PresentationFragmentHandler::endDocument() throw (SAXException, RuntimeExce pSlidePersistPtr->createXShapes( rFilter ); // now importing the notes page - OUString aNotesFragmentPath = xSlideFragmentHandler->getFragmentPathFromFirstType( CREATE_OFFICEDOC_RELATIONSTYPE( "notesSlide" ) ); + OUString aNotesFragmentPath = xSlideFragmentHandler->getFragmentPathFromFirstType( CREATE_OFFICEDOC_RELATION_TYPE( "notesSlide" ) ); if( aNotesFragmentPath.getLength() > 0 ) { Reference< XPresentationPage > xPresentationPage( xSlide, UNO_QUERY ); @@ -305,30 +303,30 @@ Reference< XFastContextHandler > PresentationFragmentHandler::createFastChildCon Reference< XFastContextHandler > xRet; switch( aElementToken ) { - case NMSP_PPT|XML_presentation: - case NMSP_PPT|XML_sldMasterIdLst: - case NMSP_PPT|XML_notesMasterIdLst: - case NMSP_PPT|XML_sldIdLst: + case PPT_TOKEN( presentation ): + case PPT_TOKEN( sldMasterIdLst ): + case PPT_TOKEN( notesMasterIdLst ): + case PPT_TOKEN( sldIdLst ): break; - case NMSP_PPT|XML_sldMasterId: - maSlideMasterVector.push_back( xAttribs->getOptionalValue( NMSP_RELATIONSHIPS|XML_id ) ); + case PPT_TOKEN( sldMasterId ): + maSlideMasterVector.push_back( xAttribs->getOptionalValue( R_TOKEN( id ) ) ); break; - case NMSP_PPT|XML_sldId: - maSlidesVector.push_back( xAttribs->getOptionalValue( NMSP_RELATIONSHIPS|XML_id ) ); + case PPT_TOKEN( sldId ): + maSlidesVector.push_back( xAttribs->getOptionalValue( R_TOKEN( id ) ) ); break; - case NMSP_PPT|XML_notesMasterId: - maNotesMasterVector.push_back( xAttribs->getOptionalValue(NMSP_RELATIONSHIPS|XML_id ) ); + case PPT_TOKEN( notesMasterId ): + maNotesMasterVector.push_back( xAttribs->getOptionalValue(R_TOKEN( id ) ) ); break; - case NMSP_PPT|XML_sldSz: + case PPT_TOKEN( sldSz ): maSlideSize = GetSize2D( xAttribs ); break; - case NMSP_PPT|XML_notesSz: + case PPT_TOKEN( notesSz ): maNotesSize = GetSize2D( xAttribs ); break; - case NMSP_PPT|XML_custShowLst: + case PPT_TOKEN( custShowLst ): xRet.set( new CustomShowListContext( *this, maCustomShowList ) ); break; - case NMSP_PPT|XML_defaultTextStyle: + case PPT_TOKEN( defaultTextStyle ): xRet.set( new TextListStyleContext( *this, *mpTextListStyle ) ); break; } diff --git a/oox/source/ppt/slidefragmenthandler.cxx b/oox/source/ppt/slidefragmenthandler.cxx index 69f32e01e7eb..cfbb2db2bece 100644 --- a/oox/source/ppt/slidefragmenthandler.cxx +++ b/oox/source/ppt/slidefragmenthandler.cxx @@ -31,10 +31,7 @@ #include <com/sun/star/beans/XMultiPropertySet.hpp> #include <com/sun/star/container/XNamed.hpp> -#include "tokens.hxx" -#include "properties.hxx" #include "oox/helper/propertyset.hxx" -#include "oox/core/namespaces.hxx" #include "oox/core/xmlfilterbase.hxx" #include "headerfootercontext.hxx" #include "oox/ppt/backgroundproperties.hxx" @@ -65,7 +62,7 @@ SlideFragmentHandler::SlideFragmentHandler( XmlFilterBase& rFilter, const OUStri , mpSlidePersistPtr( pPersistPtr ) , meShapeLocation( eShapeLocation ) { - OUString aVMLDrawingFragmentPath = getFragmentPathFromFirstType( CREATE_OFFICEDOC_RELATIONSTYPE( "vmlDrawing" ) ); + OUString aVMLDrawingFragmentPath = getFragmentPathFromFirstType( CREATE_OFFICEDOC_RELATION_TYPE( "vmlDrawing" ) ); if( aVMLDrawingFragmentPath.getLength() > 0 ) getFilter().importFragment( new oox::vml::DrawingFragment( getFilter(), aVMLDrawingFragmentPath, *pPersistPtr->getDrawing() ) ); @@ -84,9 +81,9 @@ Reference< XFastContextHandler > SlideFragmentHandler::createFastChildContext( s switch( aElementToken ) { - case NMSP_PPT|XML_sldMaster: // CT_SlideMaster - case NMSP_PPT|XML_handoutMaster: // CT_HandoutMaster - case NMSP_PPT|XML_sld: // CT_CommonSlideData + case PPT_TOKEN( sldMaster ): // CT_SlideMaster + case PPT_TOKEN( handoutMaster ): // CT_HandoutMaster + case PPT_TOKEN( sld ): // CT_CommonSlideData { AttributeList attribs( xAttribs ); @@ -99,14 +96,14 @@ Reference< XFastContextHandler > SlideFragmentHandler::createFastChildContext( s break; } - case NMSP_PPT|XML_notes: // CT_NotesSlide - case NMSP_PPT|XML_notesMaster: // CT_NotesMaster + case PPT_TOKEN( notes ): // CT_NotesSlide + case PPT_TOKEN( notesMaster ): // CT_NotesMaster break; - case NMSP_PPT|XML_cSld: // CT_CommonSlideData + case PPT_TOKEN( cSld ): // CT_CommonSlideData maSlideName = xAttribs->getOptionalValue(XML_name); break; - case NMSP_PPT|XML_spTree: // CT_GroupShape + case PPT_TOKEN( spTree ): // CT_GroupShape { xRet.set( new PPTShapeGroupContext( *this, mpSlidePersistPtr, meShapeLocation, mpSlidePersistPtr->getShapes(), @@ -114,10 +111,10 @@ Reference< XFastContextHandler > SlideFragmentHandler::createFastChildContext( s } break; - case NMSP_PPT|XML_controls: + case PPT_TOKEN( controls ): xRet = getFastContextHandler(); break; - case NMSP_PPT|XML_control: + case PPT_TOKEN( control ): { ::oox::vml::ControlInfo aInfo; aInfo.setShapeId( aAttribs.getInteger( XML_spid, 0 ) ); @@ -127,42 +124,42 @@ Reference< XFastContextHandler > SlideFragmentHandler::createFastChildContext( s } return xRet; - case NMSP_PPT|XML_timing: // CT_SlideTiming + case PPT_TOKEN( timing ): // CT_SlideTiming xRet.set( new SlideTimingContext( *this, mpSlidePersistPtr->getTimeNodeList() ) ); break; - case NMSP_PPT|XML_transition: // CT_SlideTransition + case PPT_TOKEN( transition ): // CT_SlideTransition xRet.set( new SlideTransitionContext( *this, xAttribs, maSlideProperties ) ); break; - case NMSP_PPT|XML_hf: + case PPT_TOKEN( hf ): xRet.set( new HeaderFooterContext( *this, xAttribs, mpSlidePersistPtr->getHeaderFooter() ) ); break; // BackgroundGroup - case NMSP_PPT|XML_bgPr: // CT_BackgroundProperties + case PPT_TOKEN( bgPr ): // CT_BackgroundProperties { FillPropertiesPtr pFillPropertiesPtr( new FillProperties ); xRet.set( new BackgroundPropertiesContext( *this, *pFillPropertiesPtr ) ); mpSlidePersistPtr->setBackgroundProperties( pFillPropertiesPtr ); } break; - case NMSP_PPT|XML_bgRef: // a:CT_StyleMatrixReference + case PPT_TOKEN( bgRef ): // a:CT_StyleMatrixReference break; - case NMSP_PPT|XML_clrMap: // CT_ColorMapping + case PPT_TOKEN( clrMap ): // CT_ColorMapping { oox::drawingml::ClrMapPtr pClrMapPtr( new oox::drawingml::ClrMap() ); xRet.set( new oox::drawingml::clrMapContext( *this, xAttribs, *pClrMapPtr ) ); mpSlidePersistPtr->setClrMap( pClrMapPtr ); } break; - case NMSP_PPT|XML_clrMapOvr: // CT_ColorMappingOverride - case NMSP_PPT|XML_sldLayoutIdLst: // CT_SlideLayoutIdList + case PPT_TOKEN( clrMapOvr ): // CT_ColorMappingOverride + case PPT_TOKEN( sldLayoutIdLst ): // CT_SlideLayoutIdList break; - case NMSP_PPT|XML_txStyles: // CT_SlideMasterTextStyles + case PPT_TOKEN( txStyles ): // CT_SlideMasterTextStyles xRet.set( new SlideMasterTextStylesContext( *this, mpSlidePersistPtr ) ); break; - case NMSP_PPT|XML_custDataLst: // CT_CustomerDataList - case NMSP_PPT|XML_tagLst: // CT_TagList + case PPT_TOKEN( custDataLst ): // CT_CustomerDataList + case PPT_TOKEN( tagLst ): // CT_TagList break; } diff --git a/oox/source/ppt/slidemastertextstylescontext.cxx b/oox/source/ppt/slidemastertextstylescontext.cxx index 773730417a27..d4c777102a0a 100644 --- a/oox/source/ppt/slidemastertextstylescontext.cxx +++ b/oox/source/ppt/slidemastertextstylescontext.cxx @@ -28,8 +28,6 @@ #include "oox/drawingml/textliststyle.hxx" #include "oox/drawingml/textliststylecontext.hxx" #include "oox/ppt/slidemastertextstylescontext.hxx" -#include "oox/core/namespaces.hxx" -#include "tokens.hxx" using rtl::OUString; using namespace ::oox::core; @@ -54,22 +52,22 @@ Reference< XFastContextHandler > SlideMasterTextStylesContext::createFastChildCo Reference< XFastContextHandler > xRet; switch( aElementToken ) { - case NMSP_PPT|XML_titleStyle: + case PPT_TOKEN( titleStyle ): { aTextListStylePtr = mpSlidePersistPtr->getTitleTextStyle(); break; } - case NMSP_PPT|XML_bodyStyle: + case PPT_TOKEN( bodyStyle ): { aTextListStylePtr = mpSlidePersistPtr->getBodyTextStyle(); break; } - case NMSP_PPT|XML_notesStyle: + case PPT_TOKEN( notesStyle ): { aTextListStylePtr = mpSlidePersistPtr->getNotesTextStyle(); break; } - case NMSP_PPT|XML_otherStyle: + case PPT_TOKEN( otherStyle ): { aTextListStylePtr = mpSlidePersistPtr->getOtherTextStyle(); break; diff --git a/oox/source/ppt/slidepersist.cxx b/oox/source/ppt/slidepersist.cxx index f4dee1216937..6f1ba8757d21 100644 --- a/oox/source/ppt/slidepersist.cxx +++ b/oox/source/ppt/slidepersist.cxx @@ -31,9 +31,7 @@ #include "oox/ppt/slidepersist.hxx" #include "oox/drawingml/fillproperties.hxx" #include "oox/vml/vmldrawing.hxx" -#include "oox/core/namespaces.hxx" #include "oox/core/xmlfilterbase.hxx" -#include "tokens.hxx" #include <com/sun/star/style/XStyle.hpp> #include <com/sun/star/style/XStyleFamiliesSupplier.hpp> diff --git a/oox/source/ppt/slidetimingcontext.cxx b/oox/source/ppt/slidetimingcontext.cxx index b64d79c949cf..4357e14ea08e 100644 --- a/oox/source/ppt/slidetimingcontext.cxx +++ b/oox/source/ppt/slidetimingcontext.cxx @@ -34,10 +34,8 @@ #include "oox/ppt/slidefragmenthandler.hxx" #include "oox/drawingml/shapegroupcontext.hxx" #include "oox/helper/attributelist.hxx" -#include "oox/core/namespaces.hxx" #include "oox/ppt/timenodelistcontext.hxx" #include "buildlistcontext.hxx" -#include "tokens.hxx" using rtl::OUString; using namespace ::com::sun::star; @@ -72,12 +70,12 @@ Reference< XFastContextHandler > SlideTimingContext::createFastChildContext( sal switch( aElementToken ) { - case NMSP_PPT|XML_bldLst: + case PPT_TOKEN( bldLst ): xRet.set( new BuildListContext( *this, xAttribs, maTimeNodeList ) ); break; - case NMSP_PPT|XML_extLst: + case PPT_TOKEN( extLst ): return xRet; - case NMSP_PPT|XML_tnLst: + case PPT_TOKEN( tnLst ): // timing nodes { xRet.set( new TimeNodeListContext( *this, maTimeNodeList ) ); diff --git a/oox/source/ppt/slidetransition.cxx b/oox/source/ppt/slidetransition.cxx index ee889e13d840..a380a4d945e1 100644 --- a/oox/source/ppt/slidetransition.cxx +++ b/oox/source/ppt/slidetransition.cxx @@ -35,10 +35,9 @@ #include "oox/helper/helper.hxx" #include "oox/helper/propertymap.hxx" -#include "oox/core/namespaces.hxx" +#include "oox/token/namespaces.hxx" +#include "oox/token/tokens.hxx" #include "pptfilterhelpers.hxx" -#include "properties.hxx" -#include "tokens.hxx" using rtl::OUString; using namespace ::com::sun::star::uno; @@ -256,11 +255,11 @@ namespace oox { namespace ppt { { switch( OoxType ) { - case NMSP_PPT|XML_blinds: + case PPT_TOKEN( blinds ): mnTransitionType = TransitionType::BLINDSWIPE; mnTransitionSubType = ooxToOdpDirection( param1 ); break; - case NMSP_PPT|XML_checker: + case PPT_TOKEN( checker ): mnTransitionType = TransitionType::CHECKERBOARDWIPE; switch ( param1 ) { @@ -274,7 +273,7 @@ namespace oox { namespace ppt { break; } break; - case NMSP_PPT|XML_comb: + case PPT_TOKEN( comb ): mnTransitionType = TransitionType::PUSHWIPE; switch( param1 ) { @@ -288,16 +287,16 @@ namespace oox { namespace ppt { break; } break; - case NMSP_PPT|XML_cover: + case PPT_TOKEN( cover ): mnTransitionType = TransitionType::SLIDEWIPE; mnTransitionSubType = ooxToOdpEightDirections( param1 ); break; - case NMSP_PPT|XML_pull: // uncover + case PPT_TOKEN( pull ): // uncover mnTransitionType = TransitionType::SLIDEWIPE; mnTransitionSubType = ooxToOdpEightDirections( param1 ); mbTransitionDirectionNormal = false; break; - case NMSP_PPT|XML_cut: + case PPT_TOKEN( cut ): // The binfilter seems to ignore this transition. // Fade to black instead if thrBlk is true. if( param1 ) @@ -307,7 +306,7 @@ namespace oox { namespace ppt { } OSL_TRACE( "OOX: cut transition fallback." ); break; - case NMSP_PPT|XML_fade: + case PPT_TOKEN( fade ): mnTransitionType = TransitionType::FADE; if( param1 ) { @@ -318,16 +317,16 @@ namespace oox { namespace ppt { mnTransitionSubType = TransitionSubType::CROSSFADE; } break; - case NMSP_PPT|XML_push: + case PPT_TOKEN( push ): mnTransitionType = TransitionType::PUSHWIPE; mnTransitionSubType = ooxToOdpBorderDirections( param1 ); break; - case NMSP_PPT|XML_wipe: + case PPT_TOKEN( wipe ): mnTransitionType = TransitionType::BARWIPE; mnTransitionSubType = ooxToOdpSideDirections( param1 ); mbTransitionDirectionNormal = ooxToOdpSideDirectionsDirectionNormal( param1 ); break; - case NMSP_PPT|XML_split: + case PPT_TOKEN( split ): mnTransitionType = TransitionType::BARNDOORWIPE; mnTransitionSubType = ooxToOdpDirection( param1 ); if( param2 == XML_in ) @@ -336,7 +335,7 @@ namespace oox { namespace ppt { mbTransitionDirectionNormal = false; } break; - case NMSP_PPT|XML_wheel: + case PPT_TOKEN( wheel ): mnTransitionType = TransitionType::PINWHEELWIPE; switch( param1 ) { @@ -372,40 +371,40 @@ namespace oox { namespace ppt { break; } break; - case NMSP_PPT|XML_randomBar: + case PPT_TOKEN( randomBar ): mnTransitionType = TransitionType::RANDOMBARWIPE; mnTransitionSubType = ooxToOdpDirection( param1 ); break; - case NMSP_PPT|XML_circle: + case PPT_TOKEN( circle ): mnTransitionType = TransitionType::ELLIPSEWIPE; mnTransitionSubType = TransitionSubType::CIRCLE; break; - case NMSP_PPT|XML_diamond: + case PPT_TOKEN( diamond ): mnTransitionType = TransitionType::IRISWIPE; mnTransitionSubType = TransitionSubType::DIAMOND; break; - case NMSP_PPT|XML_dissolve: + case PPT_TOKEN( dissolve ): mnTransitionType = TransitionType::DISSOLVE; mnTransitionSubType = TransitionSubType::DEFAULT; break; - case NMSP_PPT|XML_newsflash: + case PPT_TOKEN( newsflash ): // this is what the PPT binary filter does.... not sure I agree. mnTransitionType = TransitionType::FOURBOXWIPE; mnTransitionSubType = TransitionSubType::CORNERSOUT; break; - case NMSP_PPT|XML_plus: + case PPT_TOKEN( plus ): mnTransitionType = TransitionType::FOURBOXWIPE; mnTransitionSubType = TransitionSubType::CORNERSOUT; break; - case NMSP_PPT|XML_random: + case PPT_TOKEN( random ): mnTransitionType = TransitionType::RANDOM; mnTransitionSubType = TransitionSubType::DEFAULT; break; - case NMSP_PPT|XML_wedge: + case PPT_TOKEN( wedge ): mnTransitionType = TransitionType::FANWIPE; mnTransitionSubType = TransitionSubType::CENTERTOP; break; - case NMSP_PPT|XML_zoom: + case PPT_TOKEN( zoom ): mnTransitionType = TransitionType::ZOOM; mnTransitionSubType = TransitionSubType::DEFAULT; break; diff --git a/oox/source/ppt/slidetransitioncontext.cxx b/oox/source/ppt/slidetransitioncontext.cxx index 92993d754ada..4c5ae7dcc65f 100644 --- a/oox/source/ppt/slidetransitioncontext.cxx +++ b/oox/source/ppt/slidetransitioncontext.cxx @@ -38,9 +38,6 @@ #include "oox/ppt/soundactioncontext.hxx" #include "oox/drawingml/shapegroupcontext.hxx" #include "oox/helper/attributelist.hxx" -#include "oox/core/namespaces.hxx" - -#include "tokens.hxx" using rtl::OUString; using namespace ::com::sun::star; @@ -86,10 +83,10 @@ Reference< XFastContextHandler > SlideTransitionContext::createFastChildContext( switch( aElementToken ) { - case NMSP_PPT|XML_blinds: - case NMSP_PPT|XML_checker: - case NMSP_PPT|XML_comb: - case NMSP_PPT|XML_randomBar: + case PPT_TOKEN( blinds ): + case PPT_TOKEN( checker ): + case PPT_TOKEN( comb ): + case PPT_TOKEN( randomBar ): if (!mbHasTransition) { mbHasTransition = true; @@ -97,8 +94,8 @@ Reference< XFastContextHandler > SlideTransitionContext::createFastChildContext( // ST_Direction { XML_horz, XML_vert } } break; - case NMSP_PPT|XML_cover: - case NMSP_PPT|XML_pull: + case PPT_TOKEN( cover ): + case PPT_TOKEN( pull ): if (!mbHasTransition) { mbHasTransition = true; @@ -109,8 +106,8 @@ Reference< XFastContextHandler > SlideTransitionContext::createFastChildContext( // XML_ld, XML_lu, XML_rd, XML_ru } } break; - case NMSP_PPT|XML_cut: - case NMSP_PPT|XML_fade: + case PPT_TOKEN( cut ): + case PPT_TOKEN( fade ): if (!mbHasTransition) { mbHasTransition = true; @@ -119,8 +116,8 @@ Reference< XFastContextHandler > SlideTransitionContext::createFastChildContext( maTransition.setOoxTransitionType( aElementToken, attribs.getBool( XML_thruBlk, false ), 0); } break; - case NMSP_PPT|XML_push: - case NMSP_PPT|XML_wipe: + case PPT_TOKEN( push ): + case PPT_TOKEN( wipe ): if (!mbHasTransition) { mbHasTransition = true; @@ -128,7 +125,7 @@ Reference< XFastContextHandler > SlideTransitionContext::createFastChildContext( // ST_TransitionSideDirectionType { XML_d, XML_l, XML_r, XML_u } } break; - case NMSP_PPT|XML_split: + case PPT_TOKEN( split ): if (!mbHasTransition) { mbHasTransition = true; @@ -137,7 +134,7 @@ Reference< XFastContextHandler > SlideTransitionContext::createFastChildContext( // ST_TransitionInOutDirectionType { XML_out, XML_in } } break; - case NMSP_PPT|XML_zoom: + case PPT_TOKEN( zoom ): if (!mbHasTransition) { mbHasTransition = true; @@ -145,7 +142,7 @@ Reference< XFastContextHandler > SlideTransitionContext::createFastChildContext( // ST_TransitionInOutDirectionType { XML_out, XML_in } } break; - case NMSP_PPT|XML_wheel: + case PPT_TOKEN( wheel ): if (!mbHasTransition) { mbHasTransition = true; @@ -154,13 +151,13 @@ Reference< XFastContextHandler > SlideTransitionContext::createFastChildContext( // unsignedInt } break; - case NMSP_PPT|XML_circle: - case NMSP_PPT|XML_diamond: - case NMSP_PPT|XML_dissolve: - case NMSP_PPT|XML_newsflash: - case NMSP_PPT|XML_plus: - case NMSP_PPT|XML_random: - case NMSP_PPT|XML_wedge: + case PPT_TOKEN( circle ): + case PPT_TOKEN( diamond ): + case PPT_TOKEN( dissolve ): + case PPT_TOKEN( newsflash ): + case PPT_TOKEN( plus ): + case PPT_TOKEN( random ): + case PPT_TOKEN( wedge ): // CT_Empty if (!mbHasTransition) { @@ -170,11 +167,11 @@ Reference< XFastContextHandler > SlideTransitionContext::createFastChildContext( break; - case NMSP_PPT|XML_sndAc: // CT_TransitionSoundAction + case PPT_TOKEN( sndAc ): // CT_TransitionSoundAction //"Sound" xRet.set( new SoundActionContext ( *this, maSlideProperties ) ); break; - case NMSP_PPT|XML_extLst: // CT_OfficeArtExtensionList + case PPT_TOKEN( extLst ): // CT_OfficeArtExtensionList return xRet; default: break; @@ -188,7 +185,7 @@ Reference< XFastContextHandler > SlideTransitionContext::createFastChildContext( void SlideTransitionContext::endFastElement( sal_Int32 aElement ) throw (::com::sun::star::xml::sax::SAXException, RuntimeException) { - if( aElement == (NMSP_PPT|XML_transition) ) + if( aElement == (PPT_TOKEN( transition )) ) { if( mbHasTransition ) { diff --git a/oox/source/ppt/soundactioncontext.cxx b/oox/source/ppt/soundactioncontext.cxx index 281eb848629c..e9b955a73e15 100644 --- a/oox/source/ppt/soundactioncontext.cxx +++ b/oox/source/ppt/soundactioncontext.cxx @@ -32,10 +32,7 @@ #include "oox/helper/attributelist.hxx" #include "oox/helper/propertymap.hxx" -#include "oox/core/namespaces.hxx" #include "oox/drawingml/embeddedwavaudiofile.hxx" -#include "properties.hxx" -#include "tokens.hxx" using rtl::OUString; using namespace ::oox::core; @@ -63,7 +60,7 @@ namespace oox { namespace ppt { void SoundActionContext::endFastElement( sal_Int32 aElement ) throw (SAXException, RuntimeException) { - if ( aElement == ( NMSP_PPT|XML_sndAc ) ) + if ( aElement == PPT_TOKEN( sndAc ) ) { if( mbHasStartSound ) { @@ -106,7 +103,7 @@ namespace oox { namespace ppt { switch( aElement ) { - case NMSP_PPT|XML_snd: + case PPT_TOKEN( snd ): if( mbHasStartSound ) { drawingml::EmbeddedWAVAudioFile aAudio; @@ -115,11 +112,11 @@ namespace oox { namespace ppt { msSndName = ( aAudio.mbBuiltIn ? aAudio.msName : aAudio.msEmbed ); } break; - case NMSP_PPT|XML_endSnd: + case PPT_TOKEN( endSnd ): // CT_Empty mbStopSound = true; break; - case NMSP_PPT|XML_stSnd: + case PPT_TOKEN( stSnd ): mbHasStartSound = true; mbLoopSound = attribs.getBool( XML_loop, false ); default: diff --git a/oox/source/ppt/timeanimvaluecontext.cxx b/oox/source/ppt/timeanimvaluecontext.cxx index 5699d8a44cc3..185897f2e101 100644 --- a/oox/source/ppt/timeanimvaluecontext.cxx +++ b/oox/source/ppt/timeanimvaluecontext.cxx @@ -27,12 +27,8 @@ #include "timeanimvaluecontext.hxx" -#include "oox/core/namespaces.hxx" #include "animvariantcontext.hxx" -#include "tokens.hxx" - - using namespace ::oox::core; using namespace ::com::sun::star::uno; using namespace ::com::sun::star::xml::sax; @@ -57,7 +53,7 @@ namespace oox { namespace ppt { void SAL_CALL TimeAnimValueListContext::endFastElement( sal_Int32 aElement ) throw ( SAXException, RuntimeException) { - if( aElement == ( NMSP_PPT|XML_tav ) ) + if( aElement == PPT_TOKEN( tav ) ) { mbInValue = false; } @@ -72,7 +68,7 @@ namespace oox { namespace ppt { switch ( aElementToken ) { - case NMSP_PPT|XML_tav: + case PPT_TOKEN( tav ): { mbInValue = true; TimeAnimationValue val; @@ -81,7 +77,7 @@ namespace oox { namespace ppt { maTavList.push_back( val ); break; } - case NMSP_PPT|XML_val: + case PPT_TOKEN( val ): if( mbInValue ) { // CT_TLAnimVariant diff --git a/oox/source/ppt/timenodelistcontext.cxx b/oox/source/ppt/timenodelistcontext.cxx index 7e40e3be4db4..6a82dc29c1de 100644 --- a/oox/source/ppt/timenodelistcontext.cxx +++ b/oox/source/ppt/timenodelistcontext.cxx @@ -47,12 +47,10 @@ #include <com/sun/star/beans/NamedValue.hpp> #include "oox/helper/attributelist.hxx" -#include "oox/core/namespaces.hxx" #include "oox/core/xmlfilterbase.hxx" #include "oox/drawingml/drawingmltypes.hxx" #include "oox/drawingml/colorchoicecontext.hxx" #include "oox/ppt/slidetransition.hxx" -#include "tokens.hxx" #include "animvariantcontext.hxx" #include "commonbehaviorcontext.hxx" @@ -129,10 +127,10 @@ namespace oox { namespace ppt { switch( aElement ) { - case NMSP_PPT|XML_audio: + case PPT_TOKEN( audio ): mbIsNarration = attribs.getBool( XML_isNarration, false ); break; - case NMSP_PPT|XML_video: + case PPT_TOKEN( video ): mbFullScrn = attribs.getBool( XML_fullScrn, false ); break; default: @@ -143,11 +141,11 @@ namespace oox { namespace ppt { virtual void SAL_CALL endFastElement( sal_Int32 aElement ) throw ( SAXException, RuntimeException) { - if( aElement == ( NMSP_PPT|XML_audio ) ) + if( aElement == PPT_TOKEN( audio ) ) { // TODO deal with mbIsNarration } - else if( aElement == ( NMSP_PPT|XML_video ) ) + else if( aElement == PPT_TOKEN( video ) ) { // TODO deal with mbFullScrn } @@ -161,7 +159,7 @@ namespace oox { namespace ppt { switch ( aElementToken ) { - case NMSP_PPT|XML_cBhvr: + case PPT_TOKEN( cBhvr ): xRet.set( new CommonBehaviorContext ( *this, xAttribs, mpNode ) ); break; default: @@ -227,10 +225,10 @@ namespace oox { namespace ppt { switch ( aElementToken ) { - case NMSP_PPT|XML_cBhvr: + case PPT_TOKEN( cBhvr ): xRet.set( new CommonBehaviorContext ( *this, xAttribs, mpNode ) ); break; - case NMSP_PPT|XML_to: + case PPT_TOKEN( to ): // CT_TLAnimVariant xRet.set( new AnimVariantContext( *this, aElementToken, maTo ) ); break; @@ -261,7 +259,7 @@ namespace oox { namespace ppt { { switch ( aElement ) { - case NMSP_PPT|XML_cmd: + case PPT_TOKEN( cmd ): msCommand = xAttribs->getOptionalValue( XML_cmd ); maType = xAttribs->getOptionalValueToken( XML_type, 0 ); break; @@ -277,7 +275,7 @@ namespace oox { namespace ppt { virtual void SAL_CALL endFastElement( sal_Int32 aElement ) throw ( SAXException, RuntimeException) { - if( aElement == ( NMSP_PPT|XML_cmd ) ) + if( aElement == PPT_TOKEN( cmd ) ) { try { // see sd/source/filter/ppt/pptinanimations.cxx @@ -356,7 +354,7 @@ namespace oox { namespace ppt { switch ( aElementToken ) { - case NMSP_PPT|XML_cBhvr: + case PPT_TOKEN( cBhvr ): xRet.set( new CommonBehaviorContext ( *this, xAttribs, mpNode ) ); break; default: @@ -409,14 +407,14 @@ namespace oox { namespace ppt { switch ( aElementToken ) { - case NMSP_PPT|XML_cTn: + case PPT_TOKEN( cTn ): xRet.set( new CommonTimeNodeContext( *this, aElementToken, xAttribs, mpNode ) ); break; - case NMSP_PPT|XML_nextCondLst: + case PPT_TOKEN( nextCondLst ): xRet.set( new CondListContext( *this, aElementToken, xAttribs, mpNode, mpNode->getNextCondition() ) ); break; - case NMSP_PPT|XML_prevCondLst: + case PPT_TOKEN( prevCondLst ): xRet.set( new CondListContext( *this, aElementToken, xAttribs, mpNode, mpNode->getPrevCondition() ) ); break; @@ -457,7 +455,7 @@ namespace oox { namespace ppt { switch ( aElementToken ) { - case NMSP_PPT|XML_cTn: + case PPT_TOKEN( cTn ): xRet.set( new CommonTimeNodeContext( *this, aElementToken, xAttribs, mpNode ) ); break; default: @@ -521,7 +519,7 @@ namespace oox { namespace ppt { switch ( aElementToken ) { - case NMSP_PPT|XML_hsl: + case PPT_TOKEN( hsl ): // CT_TLByHslColorTransform { if( mbHasByColor ) @@ -534,7 +532,7 @@ namespace oox { namespace ppt { xRet.set(this); break; } - case NMSP_PPT|XML_rgb: + case PPT_TOKEN( rgb ): { if( mbHasByColor ) { @@ -547,19 +545,19 @@ namespace oox { namespace ppt { xRet.set(this); break; } - case NMSP_PPT|XML_by: + case PPT_TOKEN( by ): // CT_TLByAnimateColorTransform mbHasByColor = true; xRet.set(this); break; - case NMSP_PPT|XML_cBhvr: + case PPT_TOKEN( cBhvr ): xRet.set( new CommonBehaviorContext ( *this, xAttribs, mpNode ) ); break; - case NMSP_PPT|XML_to: + case PPT_TOKEN( to ): // CT_Color xRet.set( new ColorContext( *this, maToClr ) ); break; - case NMSP_PPT|XML_from: + case PPT_TOKEN( from ): // CT_Color xRet.set( new ColorContext( *this, maFromClr ) ); break; @@ -678,10 +676,10 @@ namespace oox { namespace ppt { switch ( aElementToken ) { - case NMSP_PPT|XML_cBhvr: + case PPT_TOKEN( cBhvr ): xRet.set( new CommonBehaviorContext ( *this, xAttribs, mpNode ) ); break; - case NMSP_PPT|XML_tavLst: + case PPT_TOKEN( tavLst ): xRet.set( new TimeAnimValueListContext ( *this, xAttribs, maTavList ) ); break; default: @@ -748,10 +746,10 @@ namespace oox { namespace ppt { switch ( aElementToken ) { - case NMSP_PPT|XML_cBhvr: + case PPT_TOKEN( cBhvr ): xRet.set( new CommonBehaviorContext ( *this, xAttribs, mpNode ) ); break; - case NMSP_PPT|XML_to: + case PPT_TOKEN( to ): { // CT_TLPoint Point p = GetPointPercent( xAttribs ); @@ -759,7 +757,7 @@ namespace oox { namespace ppt { maTo <<= p.Y; break; } - case NMSP_PPT|XML_from: + case PPT_TOKEN( from ): { // CT_TLPoint Point p = GetPointPercent( xAttribs ); @@ -767,7 +765,7 @@ namespace oox { namespace ppt { maFrom <<= p.Y; break; } - case NMSP_PPT|XML_by: + case PPT_TOKEN( by ): { // CT_TLPoint Point p = GetPointPercent( xAttribs ); @@ -834,7 +832,7 @@ namespace oox { namespace ppt { switch ( aElementToken ) { - case NMSP_PPT|XML_cBhvr: + case PPT_TOKEN( cBhvr ): xRet.set( new CommonBehaviorContext ( *this, xAttribs, mpNode ) ); break; default: @@ -902,10 +900,10 @@ namespace oox { namespace ppt { switch ( aElementToken ) { - case NMSP_PPT|XML_cBhvr: + case PPT_TOKEN( cBhvr ): xRet.set( new CommonBehaviorContext ( *this, xAttribs, mpNode ) ); break; - case NMSP_PPT|XML_to: + case PPT_TOKEN( to ): { // CT_TLPoint Point p = GetPointPercent( xAttribs ); @@ -915,7 +913,7 @@ namespace oox { namespace ppt { mpNode->setTo( rAny ); break; } - case NMSP_PPT|XML_from: + case PPT_TOKEN( from ): { // CT_TLPoint Point p = GetPointPercent( xAttribs ); @@ -925,7 +923,7 @@ namespace oox { namespace ppt { mpNode->setFrom( rAny ); break; } - case NMSP_PPT|XML_by: + case PPT_TOKEN( by ): { // CT_TLPoint Point p = GetPointPercent( xAttribs ); @@ -935,7 +933,7 @@ namespace oox { namespace ppt { mpNode->setBy( rAny ); break; } - case NMSP_PPT|XML_rCtr: + case PPT_TOKEN( rCtr ): { // CT_TLPoint Point p = GetPointPercent( xAttribs ); @@ -993,10 +991,10 @@ namespace oox { namespace ppt { switch ( aElementToken ) { - case NMSP_PPT|XML_cBhvr: + case PPT_TOKEN( cBhvr ): xRet.set( new CommonBehaviorContext ( *this, xAttribs, mpNode ) ); break; - case NMSP_PPT|XML_progress: + case PPT_TOKEN( progress ): xRet.set( new AnimVariantContext( *this, aElementToken, maProgress ) ); // TODO handle it. break; @@ -1025,41 +1023,41 @@ namespace oox { namespace ppt { TimeNodeContext *pCtx = NULL; switch( aElement ) { - case NMSP_PPT|XML_animClr: + case PPT_TOKEN( animClr ): pCtx = new AnimColorContext( rParent, aElement, xAttribs, pNode ); break; - case NMSP_PPT|XML_par: + case PPT_TOKEN( par ): pCtx = new ParallelExclTimeNodeContext( rParent, aElement, xAttribs, pNode ); break; - case NMSP_PPT|XML_seq: + case PPT_TOKEN( seq ): pCtx = new SequenceTimeNodeContext( rParent, aElement, xAttribs, pNode ); break; - case NMSP_PPT|XML_excl: + case PPT_TOKEN( excl ): pCtx = new ParallelExclTimeNodeContext( rParent, aElement, xAttribs, pNode ); break; - case NMSP_PPT|XML_anim: + case PPT_TOKEN( anim ): pCtx = new AnimContext ( rParent, aElement, xAttribs, pNode ); break; - case NMSP_PPT|XML_animEffect: + case PPT_TOKEN( animEffect ): pCtx = new AnimEffectContext( rParent, aElement, xAttribs, pNode ); break; - case NMSP_PPT|XML_animMotion: + case PPT_TOKEN( animMotion ): pCtx = new AnimMotionContext( rParent, aElement, xAttribs, pNode ); break; - case NMSP_PPT|XML_animRot: + case PPT_TOKEN( animRot ): pCtx = new AnimRotContext( rParent, aElement, xAttribs, pNode ); break; - case NMSP_PPT|XML_animScale: + case PPT_TOKEN( animScale ): pCtx = new AnimScaleContext( rParent, aElement, xAttribs, pNode ); break; - case NMSP_PPT|XML_cmd: + case PPT_TOKEN( cmd ): pCtx = new CmdTimeNodeContext( rParent, aElement, xAttribs, pNode ); break; - case NMSP_PPT|XML_set: + case PPT_TOKEN( set ): pCtx = new SetTimeNodeContext( rParent, aElement, xAttribs, pNode ); break; - case NMSP_PPT|XML_audio: - case NMSP_PPT|XML_video: + case PPT_TOKEN( audio ): + case PPT_TOKEN( video ): pCtx = new MediaNodeContext( rParent, aElement, xAttribs, pNode ); break; default: @@ -1106,43 +1104,43 @@ namespace oox { namespace ppt { switch( aElementToken ) { - case NMSP_PPT|XML_par: + case PPT_TOKEN( par ): nNodeType = AnimationNodeType::PAR; break; - case NMSP_PPT|XML_seq: + case PPT_TOKEN( seq ): nNodeType = AnimationNodeType::SEQ; break; - case NMSP_PPT|XML_excl: + case PPT_TOKEN( excl ): // TODO pick the right type. We choose parallel for now as // there does not seem to be an "Exclusive" nNodeType = AnimationNodeType::PAR; break; - case NMSP_PPT|XML_anim: + case PPT_TOKEN( anim ): nNodeType = AnimationNodeType::ANIMATE; break; - case NMSP_PPT|XML_animClr: + case PPT_TOKEN( animClr ): nNodeType = AnimationNodeType::ANIMATECOLOR; break; - case NMSP_PPT|XML_animEffect: + case PPT_TOKEN( animEffect ): nNodeType = AnimationNodeType::TRANSITIONFILTER; break; - case NMSP_PPT|XML_animMotion: + case PPT_TOKEN( animMotion ): nNodeType = AnimationNodeType::ANIMATEMOTION; break; - case NMSP_PPT|XML_animRot: - case NMSP_PPT|XML_animScale: + case PPT_TOKEN( animRot ): + case PPT_TOKEN( animScale ): nNodeType = AnimationNodeType::ANIMATETRANSFORM; break; - case NMSP_PPT|XML_cmd: + case PPT_TOKEN( cmd ): nNodeType = AnimationNodeType::COMMAND; break; - case NMSP_PPT|XML_set: + case PPT_TOKEN( set ): nNodeType = AnimationNodeType::SET; break; - case NMSP_PPT|XML_audio: + case PPT_TOKEN( audio ): nNodeType = AnimationNodeType::AUDIO; break; - case NMSP_PPT|XML_video: + case PPT_TOKEN( video ): nNodeType = AnimationNodeType::AUDIO; OSL_TRACE( "OOX: video requested, gave Audio instead" ); break; diff --git a/oox/source/ppt/timetargetelementcontext.cxx b/oox/source/ppt/timetargetelementcontext.cxx index 884b6d30fa61..81320bef5e89 100644 --- a/oox/source/ppt/timetargetelementcontext.cxx +++ b/oox/source/ppt/timetargetelementcontext.cxx @@ -34,9 +34,7 @@ #include <com/sun/star/uno/Any.hxx> #include "oox/helper/attributelist.hxx" -#include "oox/core/namespaces.hxx" #include "oox/drawingml/embeddedwavaudiofile.hxx" -#include "tokens.hxx" using namespace ::com::sun::star::uno; using namespace ::com::sun::star::xml::sax; @@ -67,29 +65,29 @@ namespace oox { namespace ppt { switch( aElementToken ) { - case NMSP_PPT|XML_bg: + case PPT_TOKEN( bg ): bTargetSet = true; maShapeTarget.mnType = XML_bg; break; - case NMSP_PPT|XML_txEl: + case PPT_TOKEN( txEl ): bTargetSet = true; maShapeTarget.mnType = XML_txEl; break; - case NMSP_PPT|XML_subSp: + case PPT_TOKEN( subSp ): bTargetSet = true; maShapeTarget.mnType = XML_subSp; maShapeTarget.msSubShapeId = xAttribs->getOptionalValue( XML_spid ); break; - case NMSP_PPT|XML_graphicEl: - case NMSP_PPT|XML_oleChartEl: + case PPT_TOKEN( graphicEl ): + case PPT_TOKEN( oleChartEl ): bTargetSet = true; // TODO break; - case NMSP_PPT|XML_charRg: - case NMSP_PPT|XML_pRg: + case PPT_TOKEN( charRg ): + case PPT_TOKEN( pRg ): if( bTargetSet && maShapeTarget.mnType == XML_txEl ) { - maShapeTarget.mnRangeType = getToken( aElementToken ); + maShapeTarget.mnRangeType = getBaseToken( aElementToken ); maShapeTarget.maRange = drawingml::GetIndexRange( xAttribs ); } break; @@ -130,7 +128,7 @@ namespace oox { namespace ppt { switch( aElementToken ) { - case NMSP_PPT|XML_inkTgt: + case PPT_TOKEN( inkTgt ): { mpTarget->mnType = XML_inkTgt; OUString aId = xAttribs->getOptionalValue( XML_spid ); @@ -140,10 +138,10 @@ namespace oox { namespace ppt { } break; } - case NMSP_PPT|XML_sldTgt: + case PPT_TOKEN( sldTgt ): mpTarget->mnType = XML_sldTgt; break; - case NMSP_PPT|XML_sndTgt: + case PPT_TOKEN( sndTgt ): { mpTarget->mnType = XML_sndTgt; drawingml::EmbeddedWAVAudioFile aAudio; @@ -153,7 +151,7 @@ namespace oox { namespace ppt { mpTarget->msValue = sSndName; break; } - case NMSP_PPT|XML_spTgt: + case PPT_TOKEN( spTgt ): { mpTarget->mnType = XML_spTgt; OUString aId = xAttribs->getOptionalValue( XML_spid ); @@ -162,7 +160,7 @@ namespace oox { namespace ppt { break; } default: - OSL_TRACE( "OOX: unhandled tag %ld in TL_TimeTargetElement.", getToken( aElementToken ) ); + OSL_TRACE( "OOX: unhandled tag %ld in TL_TimeTargetElement.", getBaseToken( aElementToken ) ); break; } |