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/drawingml | |
parent | 0b66e33ee50cd1c77bd9b1073ab298bac03bcfb7 (diff) |
dr77: optimizations in generation of XML tokens, XML namespaces, property names; code cleanup
Diffstat (limited to 'oox/source/drawingml')
69 files changed, 325 insertions, 441 deletions
diff --git a/oox/source/drawingml/chart/axisconverter.cxx b/oox/source/drawingml/chart/axisconverter.cxx index 4c214aed857b..028fc3d19eb1 100644 --- a/oox/source/drawingml/chart/axisconverter.cxx +++ b/oox/source/drawingml/chart/axisconverter.cxx @@ -40,7 +40,6 @@ #include "oox/drawingml/chart/titleconverter.hxx" #include "oox/drawingml/chart/typegroupconverter.hxx" #include "oox/drawingml/lineproperties.hxx" -#include "properties.hxx" namespace oox { namespace drawingml { diff --git a/oox/source/drawingml/chart/chartdrawingfragment.cxx b/oox/source/drawingml/chart/chartdrawingfragment.cxx index 5342f3535e51..03c634453e8b 100644 --- a/oox/source/drawingml/chart/chartdrawingfragment.cxx +++ b/oox/source/drawingml/chart/chartdrawingfragment.cxx @@ -42,10 +42,8 @@ namespace chart { using namespace ::com::sun::star::awt; using namespace ::com::sun::star::drawing; using namespace ::com::sun::star::uno; +using namespace ::oox::core; -using ::oox::core::ContextHandlerRef; -using ::oox::core::FragmentHandler2; -using ::oox::core::XmlFilterBase; using ::rtl::OUString; // ============================================================================ diff --git a/oox/source/drawingml/chart/chartspaceconverter.cxx b/oox/source/drawingml/chart/chartspaceconverter.cxx index 8c05b0c8a53f..b16ac91e09c9 100644 --- a/oox/source/drawingml/chart/chartspaceconverter.cxx +++ b/oox/source/drawingml/chart/chartspaceconverter.cxx @@ -39,7 +39,6 @@ #include "oox/drawingml/chart/chartspacemodel.hxx" #include "oox/drawingml/chart/plotareaconverter.hxx" #include "oox/drawingml/chart/titleconverter.hxx" -#include "properties.hxx" namespace oox { namespace drawingml { diff --git a/oox/source/drawingml/chart/chartspacefragment.cxx b/oox/source/drawingml/chart/chartspacefragment.cxx index f7aca001df5e..d4b4a66f361f 100644 --- a/oox/source/drawingml/chart/chartspacefragment.cxx +++ b/oox/source/drawingml/chart/chartspacefragment.cxx @@ -39,8 +39,8 @@ namespace chart { // ============================================================================ -using ::oox::core::ContextHandlerRef; -using ::oox::core::XmlFilterBase; +using namespace ::oox::core; + using ::rtl::OUString; // ============================================================================ diff --git a/oox/source/drawingml/chart/converterbase.cxx b/oox/source/drawingml/chart/converterbase.cxx index f2949c99a2ab..df4d40e952ac 100644 --- a/oox/source/drawingml/chart/converterbase.cxx +++ b/oox/source/drawingml/chart/converterbase.cxx @@ -40,7 +40,6 @@ #include <tools/solar.h> // for F_PI180 #include "oox/core/xmlfilterbase.hxx" #include "oox/drawingml/theme.hxx" -#include "properties.hxx" namespace oox { namespace drawingml { diff --git a/oox/source/drawingml/chart/datasourceconverter.cxx b/oox/source/drawingml/chart/datasourceconverter.cxx index abb9ad111a8a..c68a6cbe4adf 100644 --- a/oox/source/drawingml/chart/datasourceconverter.cxx +++ b/oox/source/drawingml/chart/datasourceconverter.cxx @@ -30,7 +30,6 @@ #include <com/sun/star/chart2/XChartDocument.hpp> #include "oox/drawingml/chart/chartconverter.hxx" #include "oox/drawingml/chart/datasourcemodel.hxx" -#include "properties.hxx" namespace oox { namespace drawingml { diff --git a/oox/source/drawingml/chart/objectformatter.cxx b/oox/source/drawingml/chart/objectformatter.cxx index c66b9a14c924..f6d441ded650 100644 --- a/oox/source/drawingml/chart/objectformatter.cxx +++ b/oox/source/drawingml/chart/objectformatter.cxx @@ -39,8 +39,6 @@ #include "oox/drawingml/theme.hxx" #include "oox/drawingml/chart/chartspacemodel.hxx" #include "oox/helper/modelobjecthelper.hxx" -#include "properties.hxx" -#include "tokens.hxx" namespace oox { namespace drawingml { diff --git a/oox/source/drawingml/chart/plotareaconverter.cxx b/oox/source/drawingml/chart/plotareaconverter.cxx index 19556d16dbf5..78379ae855bd 100644 --- a/oox/source/drawingml/chart/plotareaconverter.cxx +++ b/oox/source/drawingml/chart/plotareaconverter.cxx @@ -38,7 +38,6 @@ #include "oox/drawingml/chart/axisconverter.hxx" #include "oox/drawingml/chart/plotareamodel.hxx" #include "oox/drawingml/chart/typegroupconverter.hxx" -#include "properties.hxx" namespace oox { namespace drawingml { diff --git a/oox/source/drawingml/chart/seriesconverter.cxx b/oox/source/drawingml/chart/seriesconverter.cxx index 0ff1aa2eaa12..f901506f555c 100644 --- a/oox/source/drawingml/chart/seriesconverter.cxx +++ b/oox/source/drawingml/chart/seriesconverter.cxx @@ -39,7 +39,6 @@ #include "oox/drawingml/chart/titleconverter.hxx" #include "oox/drawingml/chart/typegroupconverter.hxx" #include "oox/drawingml/chart/typegroupmodel.hxx" -#include "properties.hxx" namespace oox { namespace drawingml { diff --git a/oox/source/drawingml/chart/titleconverter.cxx b/oox/source/drawingml/chart/titleconverter.cxx index c1cd02e17378..1baefdc641e4 100644 --- a/oox/source/drawingml/chart/titleconverter.cxx +++ b/oox/source/drawingml/chart/titleconverter.cxx @@ -38,7 +38,6 @@ #include "oox/drawingml/textparagraph.hxx" #include "oox/drawingml/chart/datasourceconverter.hxx" #include "oox/drawingml/chart/titlemodel.hxx" -#include "properties.hxx" namespace oox { namespace drawingml { diff --git a/oox/source/drawingml/chart/typegroupconverter.cxx b/oox/source/drawingml/chart/typegroupconverter.cxx index 7c1f1a56fe25..6b0975f26260 100644 --- a/oox/source/drawingml/chart/typegroupconverter.cxx +++ b/oox/source/drawingml/chart/typegroupconverter.cxx @@ -40,7 +40,6 @@ #include "oox/drawingml/lineproperties.hxx" #include "oox/drawingml/chart/seriesconverter.hxx" #include "oox/drawingml/chart/typegroupmodel.hxx" -#include "properties.hxx" namespace oox { namespace drawingml { diff --git a/oox/source/drawingml/clrscheme.cxx b/oox/source/drawingml/clrscheme.cxx index fdeb28a27ef0..b011cd27b147 100644 --- a/oox/source/drawingml/clrscheme.cxx +++ b/oox/source/drawingml/clrscheme.cxx @@ -26,7 +26,7 @@ ************************************************************************/ #include "oox/drawingml/clrscheme.hxx" -#include "tokens.hxx" +#include "oox/token/tokens.hxx" namespace oox { namespace drawingml { diff --git a/oox/source/drawingml/clrschemecontext.cxx b/oox/source/drawingml/clrschemecontext.cxx index 996ddef2ab0f..fad92dd35c3c 100644 --- a/oox/source/drawingml/clrschemecontext.cxx +++ b/oox/source/drawingml/clrschemecontext.cxx @@ -26,9 +26,7 @@ ************************************************************************/ #include "oox/drawingml/clrschemecontext.hxx" -#include "oox/core/namespaces.hxx" #include "oox/core/xmlfilterbase.hxx" -#include "tokens.hxx" using namespace ::oox::core; using namespace ::com::sun::star::uno; @@ -99,7 +97,7 @@ Reference< XFastContextHandler > clrSchemeContext::createFastChildContext( case A_TOKEN( accent6 ): case A_TOKEN( hlink ): case A_TOKEN( folHlink ): - return new clrSchemeColorContext( *this, mrClrScheme, getToken( nElement ) ); + return new clrSchemeColorContext( *this, mrClrScheme, getBaseToken( nElement ) ); } return 0; } diff --git a/oox/source/drawingml/color.cxx b/oox/source/drawingml/color.cxx index 8653d787517d..4ff19a4bf987 100644 --- a/oox/source/drawingml/color.cxx +++ b/oox/source/drawingml/color.cxx @@ -28,11 +28,11 @@ #include "oox/drawingml/color.hxx" #include <algorithm> #include <math.h> -#include "tokens.hxx" #include "oox/helper/containerhelper.hxx" #include "oox/helper/graphichelper.hxx" -#include "oox/core/namespaces.hxx" #include "oox/drawingml/drawingmltypes.hxx" +#include "oox/token/namespaces.hxx" +#include "oox/token/tokens.hxx" using ::rtl::OUString; @@ -314,7 +314,7 @@ void Color::addTransformation( sal_Int32 nElement, sal_Int32 nValue ) /* Execute alpha transformations directly, store other transformations in a vector, they may depend on a scheme base color which will be resolved in Color::getColor(). */ - sal_Int32 nToken = getToken( nElement ); + sal_Int32 nToken = getBaseToken( nElement ); switch( nToken ) { case XML_alpha: lclSetValue( mnAlpha, nValue ); break; @@ -336,7 +336,7 @@ void Color::addChartTintTransformation( double fTint ) void Color::addExcelTintTransformation( double fTint ) { sal_Int32 nValue = getLimitedValue< sal_Int32, double >( fTint * MAX_PERCENT + 0.5, -MAX_PERCENT, MAX_PERCENT ); - maTransforms.push_back( Transformation( NMSP_XLS | XML_tint, nValue ) ); + maTransforms.push_back( Transformation( XLS_TOKEN( tint ), nValue ) ); } void Color::clearTransformations() diff --git a/oox/source/drawingml/colorchoicecontext.cxx b/oox/source/drawingml/colorchoicecontext.cxx index 2bc01e049a8e..a909f2f68d0c 100644 --- a/oox/source/drawingml/colorchoicecontext.cxx +++ b/oox/source/drawingml/colorchoicecontext.cxx @@ -27,7 +27,6 @@ #include "oox/drawingml/colorchoicecontext.hxx" #include "oox/helper/attributelist.hxx" -#include "oox/core/namespaces.hxx" #include "oox/drawingml/color.hxx" using ::com::sun::star::uno::Reference; diff --git a/oox/source/drawingml/connectorshapecontext.cxx b/oox/source/drawingml/connectorshapecontext.cxx index 3327d627af6d..f2840a8d82fa 100644 --- a/oox/source/drawingml/connectorshapecontext.cxx +++ b/oox/source/drawingml/connectorshapecontext.cxx @@ -35,8 +35,6 @@ #include "oox/drawingml/drawingmltypes.hxx" #include "oox/drawingml/customshapegeometry.hxx" #include "oox/drawingml/textbodycontext.hxx" -#include "oox/core/namespaces.hxx" -#include "tokens.hxx" using rtl::OUString; using namespace oox::core; @@ -63,7 +61,7 @@ Reference< XFastContextHandler > ConnectorShapeContext::createFastChildContext( { Reference< XFastContextHandler > xRet; - switch( getToken( aElementToken ) ) + switch( getBaseToken( aElementToken ) ) { case XML_nvCxnSpPr : break; diff --git a/oox/source/drawingml/customshapegeometry.cxx b/oox/source/drawingml/customshapegeometry.cxx index a0fcc3142f51..d0c5c6a2dde2 100644 --- a/oox/source/drawingml/customshapegeometry.cxx +++ b/oox/source/drawingml/customshapegeometry.cxx @@ -32,10 +32,7 @@ #include <hash_map> #include "oox/helper/helper.hxx" #include "oox/helper/attributelist.hxx" -#include "oox/token/tokenmap.hxx" #include "oox/helper/propertymap.hxx" -#include "oox/core/namespaces.hxx" -#include "tokens.hxx" using ::rtl::OUString; using namespace ::oox::core; @@ -243,7 +240,7 @@ static EnhancedCustomShapeParameter GetAdjCoordinate( CustomShapeProperties& rCu sal_Char nVal = 0; // first check if its a constant value - switch( StaticTokenMap::get().getTokenFromUnicode( rValue ) ) + switch( AttributeConversion::decodeToken( rValue ) ) { case XML_3cd4 : nConstant = 270 * 60000; break; case XML_3cd8 : nConstant = 135 * 60000; break; @@ -631,7 +628,7 @@ static rtl::OUString convertToOOEquation( CustomShapeProperties& rCustomShapePro Reference< XFastContextHandler > GeomGuideListContext::createFastChildContext( sal_Int32 aElementToken, const Reference< XFastAttributeList >& xAttribs ) throw (SAXException, RuntimeException) { - if ( aElementToken == ( NMSP_DRAWINGML | XML_gd ) ) // CT_GeomGuide + if ( aElementToken == A_TOKEN( gd ) ) // CT_GeomGuide { CustomShapeGuide aGuide; aGuide.maName = xAttribs->getOptionalValue( XML_name ); @@ -712,7 +709,7 @@ XYAdjustHandleContext::XYAdjustHandleContext( ContextHandler& rParent, const Ref Reference< XFastContextHandler > XYAdjustHandleContext::createFastChildContext( sal_Int32 aElementToken, const Reference< XFastAttributeList >& xAttribs ) throw (SAXException, RuntimeException) { Reference< XFastContextHandler > xContext; - if ( aElementToken == ( NMSP_DRAWINGML | XML_pos ) ) + if ( aElementToken == A_TOKEN( pos ) ) xContext = new AdjPoint2DContext( *this, xAttribs, mrCustomShapeProperties, mrAdjustHandle.pos ); // CT_AdjPoint2D return xContext; } @@ -766,7 +763,7 @@ PolarAdjustHandleContext::PolarAdjustHandleContext( ContextHandler& rParent, con Reference< XFastContextHandler > PolarAdjustHandleContext::createFastChildContext( sal_Int32 aElementToken, const Reference< XFastAttributeList >& xAttribs ) throw (SAXException, RuntimeException) { Reference< XFastContextHandler > xContext; - if ( aElementToken == ( NMSP_DRAWINGML | XML_pos ) ) + if ( aElementToken == A_TOKEN( pos ) ) xContext = new AdjPoint2DContext( *this, xAttribs, mrCustomShapeProperties, mrAdjustHandle.pos ); // CT_AdjPoint2D return xContext; } @@ -794,13 +791,13 @@ AdjustHandleListContext::AdjustHandleListContext( ContextHandler& rParent, Custo Reference< XFastContextHandler > AdjustHandleListContext::createFastChildContext( sal_Int32 aElementToken, const Reference< XFastAttributeList >& xAttribs ) throw (SAXException, RuntimeException) { Reference< XFastContextHandler > xContext; - if ( aElementToken == ( NMSP_DRAWINGML | XML_ahXY ) ) // CT_XYAdjustHandle + if ( aElementToken == A_TOKEN( ahXY ) ) // CT_XYAdjustHandle { AdjustHandle aAdjustHandle( sal_False ); mrAdjustHandleList.push_back( aAdjustHandle ); xContext = new XYAdjustHandleContext( *this, xAttribs, mrCustomShapeProperties, mrAdjustHandleList.back() ); } - else if ( aElementToken == ( NMSP_DRAWINGML | XML_ahPolar ) ) // CT_PolarAdjustHandle + else if ( aElementToken == A_TOKEN( ahPolar ) ) // CT_PolarAdjustHandle { AdjustHandle aAdjustHandle( sal_True ); mrAdjustHandleList.push_back( aAdjustHandle ); @@ -833,7 +830,7 @@ ConnectionSiteContext::ConnectionSiteContext( ContextHandler& rParent, const Ref Reference< XFastContextHandler > ConnectionSiteContext::createFastChildContext( sal_Int32 aElementToken, const Reference< XFastAttributeList >& xAttribs ) throw (SAXException, RuntimeException) { Reference< XFastContextHandler > xContext; - if ( aElementToken == ( NMSP_DRAWINGML | XML_pos ) ) + if ( aElementToken == A_TOKEN( pos ) ) xContext = new AdjPoint2DContext( *this, xAttribs, mrCustomShapeProperties, mrConnectionSite.pos ); // CT_AdjPoint2D return xContext; } @@ -861,7 +858,7 @@ Path2DMoveToContext::Path2DMoveToContext( ContextHandler& rParent, CustomShapePr Reference< XFastContextHandler > Path2DMoveToContext::createFastChildContext( sal_Int32 aElementToken, const Reference< XFastAttributeList >& xAttribs ) throw (SAXException, RuntimeException) { Reference< XFastContextHandler > xContext; - if ( aElementToken == ( NMSP_DRAWINGML | XML_pt ) ) + if ( aElementToken == A_TOKEN( pt ) ) xContext = new AdjPoint2DContext( *this, xAttribs, mrCustomShapeProperties, mrAdjPoint2D ); // CT_AdjPoint2D return xContext; } @@ -889,7 +886,7 @@ Path2DLineToContext::Path2DLineToContext( ContextHandler& rParent, CustomShapePr Reference< XFastContextHandler > Path2DLineToContext::createFastChildContext( sal_Int32 aElementToken, const Reference< XFastAttributeList >& xAttribs ) throw (SAXException, RuntimeException) { Reference< XFastContextHandler > xContext; - if ( aElementToken == ( NMSP_DRAWINGML | XML_pt ) ) + if ( aElementToken == A_TOKEN( pt ) ) xContext = new AdjPoint2DContext( *this, xAttribs, mrCustomShapeProperties, mrAdjPoint2D ); // CT_AdjPoint2D return xContext; } @@ -924,7 +921,7 @@ Path2DQuadBezierToContext::Path2DQuadBezierToContext( ContextHandler& rParent, Reference< XFastContextHandler > Path2DQuadBezierToContext::createFastChildContext( sal_Int32 aElementToken, const Reference< XFastAttributeList >& xAttribs ) throw (SAXException, RuntimeException) { Reference< XFastContextHandler > xContext; - if ( aElementToken == ( NMSP_DRAWINGML | XML_pt ) ) + if ( aElementToken == A_TOKEN( pt ) ) xContext = new AdjPoint2DContext( *this, xAttribs, mrCustomShapeProperties, nCount++ ? mrPt2 : mrPt1 ); // CT_AdjPoint2D return xContext; } @@ -962,7 +959,7 @@ Path2DCubicBezierToContext::Path2DCubicBezierToContext( ContextHandler& rParent, Reference< XFastContextHandler > Path2DCubicBezierToContext::createFastChildContext( sal_Int32 aElementToken, const Reference< XFastAttributeList >& xAttribs ) throw (SAXException, RuntimeException) { Reference< XFastContextHandler > xContext; - if ( aElementToken == ( NMSP_DRAWINGML | XML_pt ) ) + if ( aElementToken == A_TOKEN( pt ) ) xContext = new AdjPoint2DContext( *this, xAttribs, mrCustomShapeProperties, nCount++ ? nCount == 2 ? mrControlPt2 : mrEndPt : mrControlPt1 ); // CT_AdjPoint2D return xContext; @@ -1021,7 +1018,7 @@ Reference< XFastContextHandler > Path2DContext::createFastChildContext( sal_Int3 Reference< XFastContextHandler > xContext; switch( aElementToken ) { - case NMSP_DRAWINGML | XML_close : + case A_TOKEN( close ) : { EnhancedCustomShapeSegment aNewSegment; aNewSegment.Command = EnhancedCustomShapeSegmentCommand::CLOSESUBPATH; @@ -1029,7 +1026,7 @@ Reference< XFastContextHandler > Path2DContext::createFastChildContext( sal_Int3 mrSegments.push_back( aNewSegment ); } break; - case NMSP_DRAWINGML | XML_moveTo : + case A_TOKEN( moveTo ) : { EnhancedCustomShapeSegment aNewSegment; aNewSegment.Command = EnhancedCustomShapeSegmentCommand::MOVETO; @@ -1041,7 +1038,7 @@ Reference< XFastContextHandler > Path2DContext::createFastChildContext( sal_Int3 xContext = new Path2DMoveToContext( *this, mrCustomShapeProperties, mrPath2D.parameter.back() ); } break; - case NMSP_DRAWINGML | XML_lnTo : + case A_TOKEN( lnTo ) : { if ( !mrSegments.empty() && ( mrSegments.back().Command == EnhancedCustomShapeSegmentCommand::LINETO ) ) @@ -1058,7 +1055,7 @@ Reference< XFastContextHandler > Path2DContext::createFastChildContext( sal_Int3 xContext = new Path2DLineToContext( *this, mrCustomShapeProperties, mrPath2D.parameter.back() ); } break; - case NMSP_DRAWINGML | XML_arcTo : // CT_Path2DArcTo + case A_TOKEN( arcTo ) : // CT_Path2DArcTo { if ( !mrSegments.empty() && ( mrSegments.back().Command == EnhancedCustomShapeSegmentCommand::ARCTO ) ) mrSegments.back().Count++; @@ -1084,7 +1081,7 @@ Reference< XFastContextHandler > Path2DContext::createFastChildContext( sal_Int3 mrPath2D.parameter.push_back( aPt ); } break; - case NMSP_DRAWINGML | XML_quadBezTo : + case A_TOKEN( quadBezTo ) : { if ( !mrSegments.empty() && ( mrSegments.back().Command == EnhancedCustomShapeSegmentCommand::QUADRATICCURVETO ) ) mrSegments.back().Count++; @@ -1104,7 +1101,7 @@ Reference< XFastContextHandler > Path2DContext::createFastChildContext( sal_Int3 mrPath2D.parameter.back() ); } break; - case NMSP_DRAWINGML | XML_cubicBezTo : + case A_TOKEN( cubicBezTo ) : { if ( !mrSegments.empty() && ( mrSegments.back().Command == EnhancedCustomShapeSegmentCommand::CURVETO ) ) mrSegments.back().Count++; @@ -1160,7 +1157,7 @@ Path2DListContext::Path2DListContext( ContextHandler& rParent, CustomShapeProper ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastContextHandler > SAL_CALL Path2DListContext::createFastChildContext( sal_Int32 aElementToken, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& xAttribs ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException) { Reference< XFastContextHandler > xContext; - if ( aElementToken == ( NMSP_DRAWINGML | XML_path ) ) + if ( aElementToken == A_TOKEN( path ) ) { Path2D aPath2D; mrPath2DList.push_back( aPath2D ); @@ -1983,19 +1980,19 @@ Reference< XFastContextHandler > CustomShapeGeometryContext::createFastChildCont Reference< XFastContextHandler > xContext; switch( aElementToken ) { - case NMSP_DRAWINGML|XML_avLst: // CT_GeomGuideList adjust value list + case A_TOKEN( avLst ): // CT_GeomGuideList adjust value list xContext = new GeomGuideListContext( *this, mrCustomShapeProperties, mrCustomShapeProperties.getAdjustmentGuideList() ); break; - case NMSP_DRAWINGML|XML_gdLst: // CT_GeomGuideList guide list + case A_TOKEN( gdLst ): // CT_GeomGuideList guide list xContext = new GeomGuideListContext( *this, mrCustomShapeProperties, mrCustomShapeProperties.getGuideList() ); break; - case NMSP_DRAWINGML|XML_ahLst: // CT_AdjustHandleList adjust handle list + case A_TOKEN( ahLst ): // CT_AdjustHandleList adjust handle list xContext = new AdjustHandleListContext( *this, mrCustomShapeProperties, mrCustomShapeProperties.getAdjustHandleList() ); break; - case NMSP_DRAWINGML|XML_cxnLst: // CT_ConnectionSiteList connection site list + case A_TOKEN( cxnLst ): // CT_ConnectionSiteList connection site list xContext = this; break; - case NMSP_DRAWINGML|XML_rect: // CT_GeomRectList geometry rect list + case A_TOKEN( rect ): // CT_GeomRectList geometry rect list { GeomRect aGeomRect; aGeomRect.l = GetAdjCoordinate( mrCustomShapeProperties, xAttribs->getOptionalValue( XML_l ), sal_True ); @@ -2005,12 +2002,12 @@ Reference< XFastContextHandler > CustomShapeGeometryContext::createFastChildCont mrCustomShapeProperties.getTextRect() = aGeomRect; } break; - case NMSP_DRAWINGML|XML_pathLst: // CT_Path2DList 2d path list + case A_TOKEN( pathLst ): // CT_Path2DList 2d path list xContext = new Path2DListContext( *this, mrCustomShapeProperties, mrCustomShapeProperties.getSegments(), mrCustomShapeProperties.getPath2DList() ); break; // from cxnLst: - case NMSP_DRAWINGML|XML_cxn: // CT_ConnectionSite + case A_TOKEN( cxn ): // CT_ConnectionSite { ConnectionSite aConnectionSite; mrCustomShapeProperties.getConnectionSiteList().push_back( aConnectionSite ); @@ -2037,7 +2034,7 @@ PresetShapeGeometryContext::PresetShapeGeometryContext( ContextHandler& rParent, Reference< XFastContextHandler > PresetShapeGeometryContext::createFastChildContext( sal_Int32 aElementToken, const Reference< XFastAttributeList >& ) throw (SAXException, RuntimeException) { - if ( aElementToken == ( NMSP_DRAWINGML | XML_avLst ) ) + if ( aElementToken == A_TOKEN( avLst ) ) return new GeomGuideListContext( *this, mrCustomShapeProperties, mrCustomShapeProperties.getAdjustmentGuideList() ); else return this; @@ -2059,7 +2056,7 @@ PresetTextShapeContext::PresetTextShapeContext( ContextHandler& rParent, const R Reference< XFastContextHandler > PresetTextShapeContext::createFastChildContext( sal_Int32 aElementToken, const Reference< XFastAttributeList >& ) throw (SAXException, RuntimeException) { - if ( aElementToken == ( NMSP_DRAWINGML | XML_avLst ) ) + if ( aElementToken == A_TOKEN( avLst ) ) return new GeomGuideListContext( *this, mrCustomShapeProperties, mrCustomShapeProperties.getAdjustmentGuideList() ); else return this; diff --git a/oox/source/drawingml/customshapeproperties.cxx b/oox/source/drawingml/customshapeproperties.cxx index d296a4041fb9..052fdc5e1dfc 100644 --- a/oox/source/drawingml/customshapeproperties.cxx +++ b/oox/source/drawingml/customshapeproperties.cxx @@ -29,9 +29,6 @@ #include "oox/helper/helper.hxx" #include "oox/helper/propertymap.hxx" #include "oox/helper/propertyset.hxx" -#include "oox/core/namespaces.hxx" -#include "properties.hxx" -#include "tokens.hxx" #include <com/sun/star/awt/Rectangle.hpp> #include <com/sun/star/beans/XMultiPropertySet.hpp> #include <com/sun/star/lang/XMultiServiceFactory.hpp> diff --git a/oox/source/drawingml/diagram/datamodelcontext.cxx b/oox/source/drawingml/diagram/datamodelcontext.cxx index 901b9267df36..8d81c800b2df 100644 --- a/oox/source/drawingml/diagram/datamodelcontext.cxx +++ b/oox/source/drawingml/diagram/datamodelcontext.cxx @@ -27,7 +27,6 @@ #include "oox/drawingml/diagram/datamodelcontext.hxx" #include "oox/helper/attributelist.hxx" -#include "oox/core/namespaces.hxx" #include "oox/drawingml/fillpropertiesgroupcontext.hxx" #include "oox/drawingml/shapepropertiescontext.hxx" #include "oox/drawingml/textbodycontext.hxx" @@ -39,8 +38,6 @@ using ::rtl::OUString; namespace oox { namespace drawingml { - - // CL_Cxn class CxnContext : public ContextHandler @@ -73,7 +70,7 @@ public: switch( aElementToken ) { - case NMSP_DIAGRAM|XML_extLst: + case DGM_TOKEN( extLst ): return xRet; default: break; @@ -106,7 +103,7 @@ public: switch( aElementToken ) { - case NMSP_DIAGRAM|XML_cxn: + case DGM_TOKEN( cxn ): { dgm::ConnectionPtr pConnection( new dgm::Connection() ); maConnections.push_back( pConnection ); @@ -161,17 +158,17 @@ public: switch( aElementToken ) { - case NMSP_DIAGRAM|XML_extLst: + case DGM_TOKEN( extLst ): return xRet; - case NMSP_DIAGRAM|XML_prSet: + case DGM_TOKEN( prSet ): // TODO // CT_ElemPropSet break; - case NMSP_DIAGRAM|XML_spPr: + case DGM_TOKEN( spPr ): OSL_TRACE( "shape props for point"); xRet = new ShapePropertiesContext( *this, *mpPoint->getShape() ); break; - case NMSP_DIAGRAM|XML_t: + case DGM_TOKEN( t ): { OSL_TRACE( "shape text body for point"); TextBodyPtr xTextBody( new TextBody ); @@ -212,7 +209,7 @@ public: switch( aElementToken ) { - case NMSP_DIAGRAM|XML_pt: + case DGM_TOKEN( pt ): { // CT_Pt dgm::PointPtr pPoint( new dgm::Point() ); @@ -253,18 +250,18 @@ public: switch( aElementToken ) { - case NMSP_DRAWINGML|XML_blipFill: - case NMSP_DRAWINGML|XML_gradFill: - case NMSP_DRAWINGML|XML_grpFill: - case NMSP_DRAWINGML|XML_noFill: - case NMSP_DRAWINGML|XML_pattFill: - case NMSP_DRAWINGML|XML_solidFill: + case A_TOKEN( blipFill ): + case A_TOKEN( gradFill ): + case A_TOKEN( grpFill ): + case A_TOKEN( noFill ): + case A_TOKEN( pattFill ): + case A_TOKEN( solidFill ): // EG_FillProperties xRet.set( FillPropertiesContext::createFillContext( *this, aElementToken, xAttribs, *mpDataModel->getFillProperties() ) ); break; - case NMSP_DRAWINGML|XML_effectDag: - case NMSP_DRAWINGML|XML_effectLst: + case A_TOKEN( effectDag ): + case A_TOKEN( effectLst ): // TODO // EG_EffectProperties break; @@ -306,23 +303,23 @@ DataModelContext::createFastChildContext( ::sal_Int32 aElement, switch( aElement ) { - case NMSP_DIAGRAM|XML_cxnLst: + case DGM_TOKEN( cxnLst ): // CT_CxnList xRet.set( new CxnListContext( *this, mpDataModel->getConnections() ) ); break; - case NMSP_DIAGRAM|XML_ptLst: + case DGM_TOKEN( ptLst ): // CT_PtList xRet.set( new PtListContext( *this, mpDataModel->getPoints() ) ); break; - case NMSP_DIAGRAM|XML_bg: + case DGM_TOKEN( bg ): // CT_BackgroundFormatting xRet.set( new BackgroundFormattingContext( *this, mpDataModel ) ); break; - case NMSP_DIAGRAM|XML_whole: + case DGM_TOKEN( whole ): // CT_WholeE2oFormatting // TODO return xRet; - case NMSP_DIAGRAM|XML_extLst: + case DGM_TOKEN( extLst ): return xRet; default: break; diff --git a/oox/source/drawingml/diagram/diagram.cxx b/oox/source/drawingml/diagram/diagram.cxx index 516d6bfb231c..cebb730af103 100644 --- a/oox/source/drawingml/diagram/diagram.cxx +++ b/oox/source/drawingml/diagram/diagram.cxx @@ -33,8 +33,6 @@ #include <com/sun/star/awt/Size.hpp> #include "oox/drawingml/diagram/diagram.hxx" #include "oox/drawingml/fillproperties.hxx" -#include "oox/core/namespaces.hxx" -#include "tokens.hxx" using rtl::OUString; using namespace ::com::sun::star; diff --git a/oox/source/drawingml/diagram/diagramdefinitioncontext.cxx b/oox/source/drawingml/diagram/diagramdefinitioncontext.cxx index 53477211848e..ac98bfb18c38 100644 --- a/oox/source/drawingml/diagram/diagramdefinitioncontext.cxx +++ b/oox/source/drawingml/diagram/diagramdefinitioncontext.cxx @@ -26,11 +26,9 @@ ************************************************************************/ #include "diagramdefinitioncontext.hxx" -#include "oox/core/namespaces.hxx" #include "oox/helper/helper.hxx" #include "layoutnodecontext.hxx" #include "oox/drawingml/diagram/datamodelcontext.hxx" -#include "tokens.hxx" using namespace ::oox::core; using namespace ::com::sun::star::uno; @@ -80,29 +78,29 @@ DiagramDefinitionContext::createFastChildContext( ::sal_Int32 aElement, switch( aElement ) { - case NMSP_DIAGRAM|XML_title: + case DGM_TOKEN( title ): mpLayout->setTitle( xAttribs->getOptionalValue( XML_val ) ); break; - case NMSP_DIAGRAM|XML_desc: + case DGM_TOKEN( desc ): mpLayout->setDesc( xAttribs->getOptionalValue( XML_val ) ); break; - case NMSP_DIAGRAM|XML_layoutNode: + case DGM_TOKEN( layoutNode ): mpLayout->getNode().reset( new LayoutNode() ); xRet.set( new LayoutNodeContext( *this, xAttribs, mpLayout->getNode() ) ); break; - case NMSP_DIAGRAM|XML_clrData: + case DGM_TOKEN( clrData ): // TODO, does not matter for the UI. skip. return xRet; - case NMSP_DIAGRAM|XML_sampData: + case DGM_TOKEN( sampData ): mpLayout->getSampData().reset( new DiagramData ); xRet.set( new DataModelContext( *this, mpLayout->getSampData() ) ); break; - case NMSP_DIAGRAM|XML_styleData: + case DGM_TOKEN( styleData ): mpLayout->getStyleData().reset( new DiagramData ); xRet.set( new DataModelContext( *this, mpLayout->getStyleData() ) ); break; - case NMSP_DIAGRAM|XML_cat: - case NMSP_DIAGRAM|XML_catLst: + case DGM_TOKEN( cat ): + case DGM_TOKEN( catLst ): // TODO, does not matter for the UI default: break; diff --git a/oox/source/drawingml/diagram/diagramfragmenthandler.cxx b/oox/source/drawingml/diagram/diagramfragmenthandler.cxx index ac2e755bee40..644e84771b3e 100644 --- a/oox/source/drawingml/diagram/diagramfragmenthandler.cxx +++ b/oox/source/drawingml/diagram/diagramfragmenthandler.cxx @@ -29,9 +29,7 @@ #include "oox/drawingml/diagram/diagramfragmenthandler.hxx" #include "oox/drawingml/diagram/datamodelcontext.hxx" -#include "oox/core/namespaces.hxx" #include "diagramdefinitioncontext.hxx" -#include "tokens.hxx" using namespace ::oox::core; using namespace ::com::sun::star::xml::sax; @@ -70,7 +68,7 @@ DiagramDataFragmentHandler::createFastChildContext( ::sal_Int32 aElement, switch( aElement ) { - case NMSP_DIAGRAM|XML_dataModel: + case DGM_TOKEN( dataModel ): xRet.set( new DataModelContext( *this, mpDataPtr ) ); break; default: @@ -115,7 +113,7 @@ DiagramLayoutFragmentHandler::createFastChildContext( ::sal_Int32 aElement, switch( aElement ) { - case NMSP_DIAGRAM|XML_layoutDef: + case DGM_TOKEN( layoutDef ): xRet.set( new DiagramDefinitionContext( *this, xAttribs, mpDataPtr ) ); break; default: @@ -160,7 +158,7 @@ DiagramQStylesFragmentHandler::createFastChildContext( ::sal_Int32 aElement, switch( aElement ) { - case NMSP_DIAGRAM|XML_styleDef: + case DGM_TOKEN( styleDef ): // TODO break; default: @@ -205,7 +203,7 @@ DiagramColorsFragmentHandler::createFastChildContext( ::sal_Int32 aElement, switch( aElement ) { - case NMSP_DIAGRAM|XML_colorsDef: + case DGM_TOKEN( colorsDef ): // TODO break; default: diff --git a/oox/source/drawingml/diagram/layoutnodecontext.cxx b/oox/source/drawingml/diagram/layoutnodecontext.cxx index 4d430bb6ba36..0815843dd424 100644 --- a/oox/source/drawingml/diagram/layoutnodecontext.cxx +++ b/oox/source/drawingml/diagram/layoutnodecontext.cxx @@ -28,7 +28,6 @@ #include "layoutnodecontext.hxx" #include "oox/helper/attributelist.hxx" -#include "oox/core/namespaces.hxx" #include "oox/drawingml/diagram/diagram.hxx" #include "oox/drawingml/shapecontext.hxx" #include "diagramdefinitioncontext.hxx" @@ -178,7 +177,7 @@ public: { Reference< XFastContextHandler > xRet; - sal_Int32 nIdx = LayoutNodeContext::tagToVarIdx( getToken( aElement ) ); + sal_Int32 nIdx = LayoutNodeContext::tagToVarIdx( getBaseToken( aElement ) ); if( nIdx != -1 ) { mVariables[ nIdx ] = makeAny( xAttribs->getOptionalValue( XML_val ) ); @@ -229,31 +228,31 @@ sal_Int32 LayoutNodeContext::tagToVarIdx( sal_Int32 aTag ) sal_Int32 nIdx = -1; switch( aTag ) { - case NMSP_DIAGRAM|XML_animLvl: + case DGM_TOKEN( animLvl ): nIdx = LayoutNode::VAR_animLvl; break; - case NMSP_DIAGRAM|XML_animOne: + case DGM_TOKEN( animOne ): nIdx = LayoutNode::VAR_animOne; break; - case NMSP_DIAGRAM|XML_bulletEnabled: + case DGM_TOKEN( bulletEnabled ): nIdx = LayoutNode::VAR_bulletEnabled; break; - case NMSP_DIAGRAM|XML_chMax: + case DGM_TOKEN( chMax ): nIdx = LayoutNode::VAR_chMax; break; - case NMSP_DIAGRAM|XML_chPref: + case DGM_TOKEN( chPref ): nIdx = LayoutNode::VAR_chPref; break; - case NMSP_DIAGRAM|XML_dir: + case DGM_TOKEN( dir ): nIdx = LayoutNode::VAR_dir; break; - case NMSP_DIAGRAM|XML_hierBranch: + case DGM_TOKEN( hierBranch ): nIdx = LayoutNode::VAR_hierBranch; break; - case NMSP_DIAGRAM|XML_orgChart: + case DGM_TOKEN( orgChart ): nIdx = LayoutNode::VAR_orgChart; break; - case NMSP_DIAGRAM|XML_resizeHandles: + case DGM_TOKEN( resizeHandles ): nIdx = LayoutNode::VAR_resizeHandles; break; default: @@ -272,22 +271,22 @@ LayoutNodeContext::createFastChildContext( ::sal_Int32 aElement, switch( aElement ) { - case NMSP_DIAGRAM|XML_layoutNode: + case DGM_TOKEN( layoutNode ): { LayoutNodePtr pNode( new LayoutNode() ); mpNode->addChild( pNode ); xRet.set( new LayoutNodeContext( *this, xAttribs, pNode ) ); break; } - case NMSP_DIAGRAM|XML_shape: + case DGM_TOKEN( shape ): { ShapePtr pShape( new Shape() ); xRet.set( new ShapeContext( *this, ShapePtr(), pShape ) ); break; } - case NMSP_DIAGRAM|XML_extLst: + case DGM_TOKEN( extLst ): return xRet; - case NMSP_DIAGRAM|XML_alg: + case DGM_TOKEN( alg ): { // CT_Algorithm LayoutAtomPtr pAtom( new AlgAtom ); @@ -295,7 +294,7 @@ LayoutNodeContext::createFastChildContext( ::sal_Int32 aElement, xRet.set( new AlgorithmContext( *this, xAttribs, pAtom ) ); break; } - case NMSP_DIAGRAM|XML_choose: + case DGM_TOKEN( choose ): { // CT_Choose LayoutAtomPtr pAtom( new ChooseAtom ); @@ -303,7 +302,7 @@ LayoutNodeContext::createFastChildContext( ::sal_Int32 aElement, xRet.set( new ChooseContext( *this, xAttribs, pAtom ) ); break; } - case NMSP_DIAGRAM|XML_forEach: + case DGM_TOKEN( forEach ): { // CT_ForEach LayoutAtomPtr pAtom( new ForEachAtom ); @@ -311,11 +310,11 @@ LayoutNodeContext::createFastChildContext( ::sal_Int32 aElement, xRet.set( new ForEachContext( *this, xAttribs, pAtom ) ); break; } - case NMSP_DIAGRAM|XML_constrLst: + case DGM_TOKEN( constrLst ): // CT_Constraints // TODO break; - case NMSP_DIAGRAM|XML_presOf: + case DGM_TOKEN( presOf ): { // CT_PresentationOf // TODO @@ -327,11 +326,11 @@ LayoutNodeContext::createFastChildContext( ::sal_Int32 aElement, xAttribs->getOptionalValue( XML_step ); break; } - case NMSP_DIAGRAM|XML_ruleLst: + case DGM_TOKEN( ruleLst ): // CT_Rules // TODO break; - case NMSP_DIAGRAM|XML_varLst: + case DGM_TOKEN( varLst ): { LayoutNodePtr pNode( boost::dynamic_pointer_cast< LayoutNode >( mpNode ) ); if( pNode ) diff --git a/oox/source/drawingml/drawingmltypes.cxx b/oox/source/drawingml/drawingmltypes.cxx index e5aef824bf54..f99fdc21ab55 100644 --- a/oox/source/drawingml/drawingmltypes.cxx +++ b/oox/source/drawingml/drawingmltypes.cxx @@ -31,7 +31,7 @@ #include <com/sun/star/style/CaseMap.hpp> #include <com/sun/star/style/ParagraphAdjust.hpp> #include <sax/tools/converter.hxx> -#include "tokens.hxx" +#include "oox/token/tokens.hxx" using ::rtl::OUString; using ::com::sun::star::uno::Reference; diff --git a/oox/source/drawingml/embeddedwavaudiofile.cxx b/oox/source/drawingml/embeddedwavaudiofile.cxx index 02cad5ce9f05..5c9484894109 100644 --- a/oox/source/drawingml/embeddedwavaudiofile.cxx +++ b/oox/source/drawingml/embeddedwavaudiofile.cxx @@ -27,9 +27,6 @@ #include "oox/drawingml/embeddedwavaudiofile.hxx" #include "oox/helper/attributelist.hxx" -#include "oox/core/namespaces.hxx" - -#include "tokens.hxx" using ::rtl::OUString; using namespace ::oox::core; @@ -46,7 +43,7 @@ namespace oox { namespace drawingml { { AttributeList attribs(xAttribs); - OUString sId = xAttribs->getOptionalValue( NMSP_RELATIONSHIPS|XML_embed ); + OUString sId = xAttribs->getOptionalValue( R_TOKEN( embed ) ); aAudio.msEmbed = rRelations.getFragmentPathFromRelId( sId ); aAudio.mbBuiltIn = attribs.getBool( XML_builtIn, false ); aAudio.msName = xAttribs->getOptionalValue( XML_name ); diff --git a/oox/source/drawingml/fillproperties.cxx b/oox/source/drawingml/fillproperties.cxx index 168055935104..558ce2abdfc8 100644 --- a/oox/source/drawingml/fillproperties.cxx +++ b/oox/source/drawingml/fillproperties.cxx @@ -35,13 +35,12 @@ #include <com/sun/star/drawing/FillStyle.hpp> #include <com/sun/star/drawing/RectanglePoint.hpp> #include <com/sun/star/graphic/XGraphicTransformer.hpp> -#include "properties.hxx" -#include "tokens.hxx" #include "oox/helper/graphichelper.hxx" #include "oox/helper/modelobjecthelper.hxx" #include "oox/helper/propertymap.hxx" #include "oox/helper/propertyset.hxx" #include "oox/drawingml/drawingmltypes.hxx" +#include "oox/token/tokens.hxx" using namespace ::com::sun::star; using namespace ::com::sun::star::drawing; diff --git a/oox/source/drawingml/fillpropertiesgroupcontext.cxx b/oox/source/drawingml/fillpropertiesgroupcontext.cxx index b9d7fa7e1142..508bba587add 100644 --- a/oox/source/drawingml/fillpropertiesgroupcontext.cxx +++ b/oox/source/drawingml/fillpropertiesgroupcontext.cxx @@ -28,7 +28,6 @@ #include "oox/drawingml/fillpropertiesgroupcontext.hxx" #include "oox/helper/attributelist.hxx" #include "oox/helper/graphichelper.hxx" -#include "oox/core/namespaces.hxx" #include "oox/core/xmlfilterbase.hxx" #include "oox/drawingml/drawingmltypes.hxx" #include "oox/drawingml/fillproperties.hxx" @@ -190,7 +189,7 @@ Reference< XFastContextHandler > BlipContext::createFastChildContext( { case A_TOKEN( biLevel ): case A_TOKEN( grayscl ): - mrBlipProps.moColorEffect = getToken( nElement ); + mrBlipProps.moColorEffect = getBaseToken( nElement ); break; case A_TOKEN( clrChange ): @@ -229,7 +228,7 @@ Reference< XFastContextHandler > BlipFillContext::createFastChildContext( break; case A_TOKEN( tile ): - mrBlipProps.moBitmapMode = getToken( nElement ); + mrBlipProps.moBitmapMode = getBaseToken( nElement ); mrBlipProps.moTileOffsetX = aAttribs.getInteger( XML_tx ); mrBlipProps.moTileOffsetY = aAttribs.getInteger( XML_ty ); mrBlipProps.moTileScaleX = aAttribs.getInteger( XML_sx ); @@ -239,7 +238,7 @@ Reference< XFastContextHandler > BlipFillContext::createFastChildContext( break; case A_TOKEN( stretch ): - mrBlipProps.moBitmapMode = getToken( nElement ); + mrBlipProps.moBitmapMode = getBaseToken( nElement ); return this; // for fillRect element case A_TOKEN( fillRect ): @@ -271,12 +270,12 @@ Reference< XFastContextHandler > FillPropertiesContext::createFastChildContext( { switch( nElement ) { - case A_TOKEN( noFill ): { rFillProps.moFillType = getToken( nElement ); return 0; }; - case A_TOKEN( solidFill ): { rFillProps.moFillType = getToken( nElement ); return new SolidFillContext( rParent, rxAttribs, rFillProps ); }; - case A_TOKEN( gradFill ): { rFillProps.moFillType = getToken( nElement ); return new GradientFillContext( rParent, rxAttribs, rFillProps.maGradientProps ); }; - case A_TOKEN( pattFill ): { rFillProps.moFillType = getToken( nElement ); return new PatternFillContext( rParent, rxAttribs, rFillProps.maPatternProps ); }; - case A_TOKEN( blipFill ): { rFillProps.moFillType = getToken( nElement ); return new BlipFillContext( rParent, rxAttribs, rFillProps.maBlipProps ); }; - case A_TOKEN( grpFill ): { rFillProps.moFillType = getToken( nElement ); return 0; }; // TODO + case A_TOKEN( noFill ): { rFillProps.moFillType = getBaseToken( nElement ); return 0; }; + case A_TOKEN( solidFill ): { rFillProps.moFillType = getBaseToken( nElement ); return new SolidFillContext( rParent, rxAttribs, rFillProps ); }; + case A_TOKEN( gradFill ): { rFillProps.moFillType = getBaseToken( nElement ); return new GradientFillContext( rParent, rxAttribs, rFillProps.maGradientProps ); }; + case A_TOKEN( pattFill ): { rFillProps.moFillType = getBaseToken( nElement ); return new PatternFillContext( rParent, rxAttribs, rFillProps.maPatternProps ); }; + case A_TOKEN( blipFill ): { rFillProps.moFillType = getBaseToken( nElement ); return new BlipFillContext( rParent, rxAttribs, rFillProps.maBlipProps ); }; + case A_TOKEN( grpFill ): { rFillProps.moFillType = getBaseToken( nElement ); return 0; }; // TODO } return 0; } diff --git a/oox/source/drawingml/graphicshapecontext.cxx b/oox/source/drawingml/graphicshapecontext.cxx index 0df33903ffbb..646017aa22ea 100644 --- a/oox/source/drawingml/graphicshapecontext.cxx +++ b/oox/source/drawingml/graphicshapecontext.cxx @@ -32,7 +32,6 @@ #include "oox/drawingml/customshapeproperties.hxx" #include "oox/drawingml/diagram/diagramfragmenthandler.hxx" #include "oox/drawingml/table/tablecontext.hxx" -#include "oox/core/namespaces.hxx" #include "oox/core/xmlfilterbase.hxx" #include "oox/helper/attributelist.hxx" #include "oox/helper/graphichelper.hxx" @@ -42,8 +41,6 @@ #include "oox/vml/vmlshapecontainer.hxx" #include "oox/drawingml/fillproperties.hxx" #include "oox/drawingml/transform2dcontext.hxx" -#include "properties.hxx" -#include "tokens.hxx" using ::rtl::OUString; using namespace ::com::sun::star; @@ -69,7 +66,7 @@ Reference< XFastContextHandler > GraphicShapeContext::createFastChildContext( sa { Reference< XFastContextHandler > xRet; - switch( getToken( aElementToken ) ) + switch( getBaseToken( aElementToken ) ) { // CT_ShapeProperties case XML_xfrm: @@ -80,13 +77,13 @@ Reference< XFastContextHandler > GraphicShapeContext::createFastChildContext( sa break; } - if (getNamespace( aElementToken ) == NMSP_VML && mpShapePtr) + if ((getNamespace( aElementToken ) == NMSP_vml) && mpShapePtr) { mpShapePtr->setServiceName("com.sun.star.drawing.CustomShape"); CustomShapePropertiesPtr pCstmShpProps (mpShapePtr->getCustomShapeProperties()); - sal_uInt32 nType = aElementToken & (~ NMSP_MASK); + sal_uInt32 nType = getBaseToken( aElementToken ); OUString sType(GetShapeType(nType)); if (sType.getLength() > 0) @@ -112,7 +109,7 @@ Reference< XFastContextHandler > GraphicalObjectFrameContext::createFastChildCon { Reference< XFastContextHandler > xRet; - switch( aElementToken &(~NMSP_MASK) ) + switch( getBaseToken( aElementToken ) ) { // CT_ShapeProperties case XML_nvGraphicFramePr: // CT_GraphicalObjectFrameNonVisual @@ -272,12 +269,12 @@ Reference< XFastContextHandler > DiagramGraphicDataContext::createFastChildConte switch( aElementToken ) { - case NMSP_DIAGRAM|XML_relIds: + case DGM_TOKEN( relIds ): { - msDm = xAttribs->getOptionalValue( NMSP_RELATIONSHIPS|XML_dm ); - msLo = xAttribs->getOptionalValue( NMSP_RELATIONSHIPS|XML_lo ); - msQs = xAttribs->getOptionalValue( NMSP_RELATIONSHIPS|XML_qs ); - msCs = xAttribs->getOptionalValue( NMSP_RELATIONSHIPS|XML_cs ); + msDm = xAttribs->getOptionalValue( R_TOKEN( dm ) ); + msLo = xAttribs->getOptionalValue( R_TOKEN( lo ) ); + msQs = xAttribs->getOptionalValue( R_TOKEN( qs ) ); + msCs = xAttribs->getOptionalValue( R_TOKEN( cs ) ); DiagramPtr pDiagram = loadDiagram(); pDiagram->addTo( mpShapePtr ); OSL_TRACE("diagram added shape %s of type %s", OUSTRING_TO_CSTR( mpShapePtr->getName() ), diff --git a/oox/source/drawingml/guidcontext.cxx b/oox/source/drawingml/guidcontext.cxx index b53e33fcb746..d5fbc10783ac 100644 --- a/oox/source/drawingml/guidcontext.cxx +++ b/oox/source/drawingml/guidcontext.cxx @@ -25,10 +25,7 @@ * ************************************************************************/ -#include <rtl/ustring.hxx> #include "oox/drawingml/guidcontext.hxx" -#include "oox/core/namespaces.hxx" -#include "tokens.hxx" using ::rtl::OUString; using namespace ::oox::core; diff --git a/oox/source/drawingml/hyperlinkcontext.cxx b/oox/source/drawingml/hyperlinkcontext.cxx index 280077eb0b5b..2b2b1ee1cef6 100644 --- a/oox/source/drawingml/hyperlinkcontext.cxx +++ b/oox/source/drawingml/hyperlinkcontext.cxx @@ -27,17 +27,12 @@ #include "hyperlinkcontext.hxx" -#include <rtl/ustring.hxx> - #include <com/sun/star/xml/sax/XFastContextHandler.hpp> #include "oox/helper/propertymap.hxx" #include "oox/core/relations.hxx" -#include "oox/core/namespaces.hxx" #include "oox/core/xmlfilterbase.hxx" #include "oox/drawingml/embeddedwavaudiofile.hxx" -#include "properties.hxx" -#include "tokens.hxx" using ::rtl::OUString; using namespace ::oox::core; @@ -53,7 +48,7 @@ HyperLinkContext::HyperLinkContext( ContextHandler& rParent, , maProperties(aProperties) { OUString sURL, sHref; - OUString aRelId = xAttributes->getOptionalValue( NMSP_RELATIONSHIPS|XML_id ); + OUString aRelId = xAttributes->getOptionalValue( R_TOKEN( id ) ); if ( aRelId.getLength() ) { OSL_TRACE("OOX: URI rId %s", ::rtl::OUStringToOString (aRelId, RTL_TEXTENCODING_UTF8).pData->buffer); @@ -64,10 +59,10 @@ HyperLinkContext::HyperLinkContext( ContextHandler& rParent, sURL = getFilter().getAbsoluteUrl( sHref ); } } - OUString sTooltip = xAttributes->getOptionalValue( NMSP_RELATIONSHIPS|XML_tooltip ); + OUString sTooltip = xAttributes->getOptionalValue( R_TOKEN( tooltip ) ); if ( sTooltip.getLength() ) maProperties[ PROP_Representation ] <<= sTooltip; - OUString sFrame = xAttributes->getOptionalValue( NMSP_RELATIONSHIPS|XML_tgtFrame ); + OUString sFrame = xAttributes->getOptionalValue( R_TOKEN( tgtFrame ) ); if( sFrame.getLength() ) maProperties[ PROP_TargetFrame ] <<= sFrame; OUString aAction = xAttributes->getOptionalValue( XML_action ); @@ -164,9 +159,9 @@ Reference< XFastContextHandler > HyperLinkContext::createFastChildContext( Reference< XFastContextHandler > xRet; switch( aElement ) { - case NMSP_DRAWINGML|XML_extLst: + case A_TOKEN( extLst ): return xRet; - case NMSP_DRAWINGML|XML_snd: + case A_TOKEN( snd ): EmbeddedWAVAudioFile aAudio; getEmbeddedWAVAudioFile( getRelations(), xAttribs, aAudio ); break; diff --git a/oox/source/drawingml/lineproperties.cxx b/oox/source/drawingml/lineproperties.cxx index 9f23cf466d30..38b6eb2d82a3 100644 --- a/oox/source/drawingml/lineproperties.cxx +++ b/oox/source/drawingml/lineproperties.cxx @@ -35,14 +35,12 @@ #include <com/sun/star/drawing/LineStyle.hpp> #include <com/sun/star/drawing/PointSequence.hpp> #include <com/sun/star/drawing/PolyPolygonBezierCoords.hpp> -#include "properties.hxx" -#include "tokens.hxx" #include "oox/helper/graphichelper.hxx" #include "oox/helper/modelobjecthelper.hxx" #include "oox/helper/propertymap.hxx" #include "oox/helper/propertyset.hxx" -#include "oox/core/namespaces.hxx" #include "oox/drawingml/drawingmltypes.hxx" +#include "oox/token/tokens.hxx" using namespace ::com::sun::star::drawing; diff --git a/oox/source/drawingml/linepropertiescontext.cxx b/oox/source/drawingml/linepropertiescontext.cxx index a2cf4111a524..a200b60f9e4b 100644 --- a/oox/source/drawingml/linepropertiescontext.cxx +++ b/oox/source/drawingml/linepropertiescontext.cxx @@ -30,8 +30,6 @@ #include "oox/drawingml/fillpropertiesgroupcontext.hxx" #include "oox/drawingml/lineproperties.hxx" #include "oox/helper/attributelist.hxx" -#include "oox/core/namespaces.hxx" -#include "tokens.hxx" using ::rtl::OUString; using namespace ::oox::core; @@ -88,7 +86,7 @@ Reference< XFastContextHandler > LinePropertiesContext::createFastChildContext( case A_TOKEN( round ): case A_TOKEN( bevel ): case A_TOKEN( miter ): - mrLineProperties.moLineJoint = getToken( nElement ); + mrLineProperties.moLineJoint = getBaseToken( nElement ); break; case A_TOKEN( headEnd ): // CT_LineEndProperties diff --git a/oox/source/drawingml/objectdefaultcontext.cxx b/oox/source/drawingml/objectdefaultcontext.cxx index 69b9423a4abc..d233379f9b02 100644 --- a/oox/source/drawingml/objectdefaultcontext.cxx +++ b/oox/source/drawingml/objectdefaultcontext.cxx @@ -28,8 +28,6 @@ #include "oox/drawingml/objectdefaultcontext.hxx" #include "oox/drawingml/spdefcontext.hxx" #include "oox/drawingml/theme.hxx" -#include "oox/core/namespaces.hxx" -#include "tokens.hxx" using rtl::OUString; using namespace ::oox::core; @@ -48,11 +46,11 @@ Reference< XFastContextHandler > objectDefaultContext::createFastChildContext( s { switch( aElementToken ) { - case NMSP_DRAWINGML|XML_spDef: + case A_TOKEN( spDef ): return new spDefContext( *this, mrTheme.getSpDef() ); - case NMSP_DRAWINGML|XML_lnDef: + case A_TOKEN( lnDef ): return new spDefContext( *this, mrTheme.getLnDef() ); - case NMSP_DRAWINGML|XML_txDef: + case A_TOKEN( txDef ): return new spDefContext( *this, mrTheme.getTxDef() ); } return 0; diff --git a/oox/source/drawingml/shape.cxx b/oox/source/drawingml/shape.cxx index 4d98de51a002..61956c068deb 100644 --- a/oox/source/drawingml/shape.cxx +++ b/oox/source/drawingml/shape.cxx @@ -38,12 +38,9 @@ #include "oox/vml/vmldrawing.hxx" #include "oox/vml/vmlshape.hxx" #include "oox/vml/vmlshapecontainer.hxx" -#include "oox/core/namespaces.hxx" #include "oox/core/xmlfilterbase.hxx" #include "oox/helper/graphichelper.hxx" #include "oox/helper/propertyset.hxx" -#include "properties.hxx" -#include "tokens.hxx" #include <tools/solar.h> // for the F_PI180 define #include <com/sun/star/graphic/XGraphic.hpp> diff --git a/oox/source/drawingml/shapecontext.cxx b/oox/source/drawingml/shapecontext.cxx index a5f3b1598447..d4781fdaa436 100644 --- a/oox/source/drawingml/shapecontext.cxx +++ b/oox/source/drawingml/shapecontext.cxx @@ -34,13 +34,11 @@ #include "oox/helper/attributelist.hxx" #include "oox/drawingml/shapecontext.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" using rtl::OUString; using namespace oox::core; @@ -80,7 +78,7 @@ Reference< XFastContextHandler > ShapeContext::createFastChildContext( sal_Int32 { Reference< XFastContextHandler > xRet; - switch( getToken( aElementToken ) ) + switch( getBaseToken( aElementToken ) ) { // nvSpPr CT_ShapeNonVisual begin // case XML_drElemPr: diff --git a/oox/source/drawingml/shapegroupcontext.cxx b/oox/source/drawingml/shapegroupcontext.cxx index 2c8e0808d8af..183302667066 100644 --- a/oox/source/drawingml/shapegroupcontext.cxx +++ b/oox/source/drawingml/shapegroupcontext.cxx @@ -37,8 +37,6 @@ #include "oox/drawingml/drawingmltypes.hxx" #include "oox/drawingml/customshapegeometry.hxx" #include "oox/drawingml/textbodycontext.hxx" -#include "oox/core/namespaces.hxx" -#include "tokens.hxx" using rtl::OUString; using namespace oox::core; @@ -68,7 +66,7 @@ Reference< XFastContextHandler > ShapeGroupContext::createFastChildContext( sal_ { Reference< XFastContextHandler > xRet; - switch( getToken( aElementToken ) ) + switch( getBaseToken( aElementToken ) ) { case XML_cNvPr: { diff --git a/oox/source/drawingml/shapepropertiescontext.cxx b/oox/source/drawingml/shapepropertiescontext.cxx index dd1814ac23cf..13fd8c421784 100644 --- a/oox/source/drawingml/shapepropertiescontext.cxx +++ b/oox/source/drawingml/shapepropertiescontext.cxx @@ -33,12 +33,10 @@ #include <com/sun/star/lang/XMultiServiceFactory.hpp> #include <com/sun/star/container/XNamed.hpp> -#include "oox/core/namespaces.hxx" #include "oox/drawingml/linepropertiescontext.hxx" #include "oox/drawingml/fillpropertiesgroupcontext.hxx" #include "oox/drawingml/transform2dcontext.hxx" #include "oox/drawingml/customshapegeometry.hxx" -#include "tokens.hxx" using rtl::OUString; using namespace oox::core; @@ -68,17 +66,17 @@ Reference< XFastContextHandler > ShapePropertiesContext::createFastChildContext( switch( aElementToken ) { // CT_Transform2D - case NMSP_DRAWINGML|XML_xfrm: + case A_TOKEN( xfrm ): xRet.set( new Transform2DContext( *this, xAttribs, mrShape ) ); break; // GeometryGroup - case NMSP_DRAWINGML|XML_custGeom: // custom geometry "CT_CustomGeometry2D" + case A_TOKEN( custGeom ): // custom geometry "CT_CustomGeometry2D" xRet.set( new CustomShapeGeometryContext( *this, xAttribs, *(mrShape.getCustomShapeProperties()) ) ); break; - case NMSP_DRAWINGML|XML_prstGeom: // preset geometry "CT_PresetGeometry2D" + case A_TOKEN( prstGeom ): // preset geometry "CT_PresetGeometry2D" { sal_Int32 nToken = xAttribs->getOptionalValueToken( XML_prst, 0 ); if ( nToken == XML_line ) @@ -90,24 +88,24 @@ Reference< XFastContextHandler > ShapePropertiesContext::createFastChildContext( } break; - case NMSP_DRAWINGML|XML_prstTxWarp: + case A_TOKEN( prstTxWarp ): xRet.set( new PresetTextShapeContext( *this, xAttribs, *(mrShape.getCustomShapeProperties()) ) ); break; // CT_LineProperties - case NMSP_DRAWINGML|XML_ln: + case A_TOKEN( ln ): xRet.set( new LinePropertiesContext( *this, xAttribs, mrShape.getLineProperties() ) ); break; // EffectPropertiesGroup // todo not supported by core - case NMSP_DRAWINGML|XML_effectLst: // CT_EffectList - case NMSP_DRAWINGML|XML_effectDag: // CT_EffectContainer + case A_TOKEN( effectLst ): // CT_EffectList + case A_TOKEN( effectDag ): // CT_EffectContainer break; // todo - case NMSP_DRAWINGML|XML_scene3d: // CT_Scene3D - case NMSP_DRAWINGML|XML_sp3d: // CT_Shape3D + case A_TOKEN( scene3d ): // CT_Scene3D + case A_TOKEN( sp3d ): // CT_Shape3D break; } diff --git a/oox/source/drawingml/shapestylecontext.cxx b/oox/source/drawingml/shapestylecontext.cxx index 13f15783e49b..a1ae5df43cda 100644 --- a/oox/source/drawingml/shapestylecontext.cxx +++ b/oox/source/drawingml/shapestylecontext.cxx @@ -28,9 +28,7 @@ #include "oox/drawingml/shapestylecontext.hxx" #include "oox/helper/attributelist.hxx" -#include "oox/core/namespaces.hxx" #include "oox/drawingml/colorchoicecontext.hxx" -#include "tokens.hxx" using ::rtl::OUString; using namespace ::oox::core; @@ -67,12 +65,12 @@ Reference< XFastContextHandler > ShapeStyleContext::createFastChildContext( sal_ AttributeList aAttribs( rxAttributes ); switch( aElementToken ) { - case NMSP_DRAWINGML|XML_lnRef : // CT_StyleMatrixReference - case NMSP_DRAWINGML|XML_fillRef : // CT_StyleMatrixReference - case NMSP_DRAWINGML|XML_effectRef : // CT_StyleMatrixReference - case NMSP_DRAWINGML|XML_fontRef : // CT_FontReference + case A_TOKEN( lnRef ) : // CT_StyleMatrixReference + case A_TOKEN( fillRef ) : // CT_StyleMatrixReference + case A_TOKEN( effectRef ) : // CT_StyleMatrixReference + case A_TOKEN( fontRef ) : // CT_FontReference { - sal_Int32 nToken = getToken( aElementToken ); + sal_Int32 nToken = getBaseToken( aElementToken ); ShapeStyleRef& rStyleRef = mrShape.getShapeStyleRefs()[ nToken ]; rStyleRef.mnThemedIdx = (nToken == XML_fontRef) ? aAttribs.getToken( XML_idx, XML_none ) : aAttribs.getInteger( XML_idx, 0 ); xRet.set( new ColorContext( *this, rStyleRef.maPhClr ) ); diff --git a/oox/source/drawingml/spdefcontext.cxx b/oox/source/drawingml/spdefcontext.cxx index d85fe2ceb2bb..da86e031ddec 100644 --- a/oox/source/drawingml/spdefcontext.cxx +++ b/oox/source/drawingml/spdefcontext.cxx @@ -30,8 +30,6 @@ #include "oox/drawingml/textbody.hxx" #include "oox/drawingml/textbodypropertiescontext.hxx" #include "oox/drawingml/textliststylecontext.hxx" -#include "oox/core/namespaces.hxx" -#include "tokens.hxx" using rtl::OUString; using namespace ::oox::core; @@ -51,22 +49,22 @@ Reference< XFastContextHandler > spDefContext::createFastChildContext( sal_Int32 Reference< XFastContextHandler > xRet; switch( aElementToken ) { - case NMSP_DRAWINGML|XML_spPr: + case A_TOKEN( spPr ): { xRet = new ShapePropertiesContext( *this, mrDefaultObject ); break; } - case NMSP_DRAWINGML|XML_bodyPr: + case A_TOKEN( bodyPr ): { TextBodyPtr xTextBody( new TextBody ); mrDefaultObject.setTextBody( xTextBody ); xRet = new TextBodyPropertiesContext( *this, xAttribs, xTextBody->getTextProperties() ); break; } - case NMSP_DRAWINGML|XML_lstStyle: + case A_TOKEN( lstStyle ): xRet.set( new TextListStyleContext( *this, *mrDefaultObject.getMasterTextListStyle() ) ); break; - case NMSP_DRAWINGML|XML_style: + case A_TOKEN( style ): break; } if( !xRet.is() ) diff --git a/oox/source/drawingml/table/tablebackgroundstylecontext.cxx b/oox/source/drawingml/table/tablebackgroundstylecontext.cxx index c9be0287a7cc..075e8ded9b31 100644 --- a/oox/source/drawingml/table/tablebackgroundstylecontext.cxx +++ b/oox/source/drawingml/table/tablebackgroundstylecontext.cxx @@ -29,9 +29,8 @@ #include "oox/drawingml/table/tablebackgroundstylecontext.hxx" #include "oox/drawingml/fillpropertiesgroupcontext.hxx" -#include "oox/core/namespaces.hxx" #include "oox/helper/attributelist.hxx" -#include "tokens.hxx" + using namespace ::oox::core; using namespace ::com::sun::star; using namespace ::com::sun::star::uno; @@ -60,14 +59,14 @@ TableBackgroundStyleContext::createFastChildContext( ::sal_Int32 aElementToken, switch( aElementToken ) { // EG_ThemeableFillStyle (choice) - case NMSP_DRAWINGML|XML_fill: // CT_FillProperties + case A_TOKEN( fill ): // CT_FillProperties { boost::shared_ptr< FillProperties >& rxFillProperties = mrTableStyle.getBackgroundFillProperties(); rxFillProperties.reset( new FillProperties ); xRet.set( new FillPropertiesContext( *this, *rxFillProperties ) ); } break; - case NMSP_DRAWINGML|XML_fillRef: // CT_StyleMatrixReference + case A_TOKEN( fillRef ): // CT_StyleMatrixReference { ShapeStyleRef& rStyleRef = mrTableStyle.getBackgroundFillStyleRef(); rStyleRef.mnThemedIdx = aAttribs.getInteger( XML_idx, 0 ); @@ -76,9 +75,9 @@ TableBackgroundStyleContext::createFastChildContext( ::sal_Int32 aElementToken, break; // EG_ThemeableEffectStyle (choice) - case NMSP_DRAWINGML|XML_effect: // CT_EffectProperties + case A_TOKEN( effect ): // CT_EffectProperties break; - case NMSP_DRAWINGML|XML_effectRef: // CT_StyleMatrixReference + case A_TOKEN( effectRef ): // CT_StyleMatrixReference break; } if( !xRet.is() ) diff --git a/oox/source/drawingml/table/tablecell.cxx b/oox/source/drawingml/table/tablecell.cxx index ee3ac495f4d6..f381b20d5383 100644 --- a/oox/source/drawingml/table/tablecell.cxx +++ b/oox/source/drawingml/table/tablecell.cxx @@ -28,10 +28,7 @@ #include "oox/drawingml/table/tablecell.hxx" #include "oox/drawingml/table/tableproperties.hxx" #include "oox/drawingml/textbody.hxx" -#include "oox/core/namespaces.hxx" #include "oox/core/xmlfilterbase.hxx" -#include "properties.hxx" -#include "tokens.hxx" #include "oox/helper/propertyset.hxx" #include <com/sun/star/container/XNameContainer.hpp> #include <com/sun/star/beans/XMultiPropertySet.hpp> diff --git a/oox/source/drawingml/table/tablecellcontext.cxx b/oox/source/drawingml/table/tablecellcontext.cxx index 68e3cd3a864a..844f134c3e85 100644 --- a/oox/source/drawingml/table/tablecellcontext.cxx +++ b/oox/source/drawingml/table/tablecellcontext.cxx @@ -31,7 +31,6 @@ #include "oox/drawingml/textbodycontext.hxx" #include "oox/drawingml/linepropertiescontext.hxx" #include "oox/drawingml/fillpropertiesgroupcontext.hxx" -#include "oox/core/namespaces.hxx" #include "oox/helper/attributelist.hxx" using namespace ::oox::core; @@ -66,7 +65,7 @@ TableCellContext::createFastChildContext( ::sal_Int32 aElementToken, const uno:: switch( aElementToken ) { - case NMSP_DRAWINGML|XML_txBody: // CT_TextBody + case A_TOKEN( txBody ): // CT_TextBody { oox::drawingml::TextBodyPtr xTextBody( new oox::drawingml::TextBody ); mrTableCell.setTextBody( xTextBody ); @@ -74,7 +73,7 @@ TableCellContext::createFastChildContext( ::sal_Int32 aElementToken, const uno:: } break; - case NMSP_DRAWINGML|XML_tcPr: // CT_TableCellProperties + case A_TOKEN( tcPr ): // CT_TableCellProperties { AttributeList aAttribs( xAttribs ); mrTableCell.setLeftMargin( aAttribs.getInteger( XML_marL, 91440 ) ); @@ -87,28 +86,28 @@ TableCellContext::createFastChildContext( ::sal_Int32 aElementToken, const uno:: mrTableCell.setHorzOverflowToken( xAttribs->getOptionalValueToken( XML_horzOverflow, XML_clip ) ); // ST_TextHorzOverflowType } break; - case NMSP_DRAWINGML|XML_lnL: + case A_TOKEN( lnL ): xRet.set( new oox::drawingml::LinePropertiesContext( *this, xAttribs, mrTableCell.maLinePropertiesLeft ) ); break; - case NMSP_DRAWINGML|XML_lnR: + case A_TOKEN( lnR ): xRet.set( new oox::drawingml::LinePropertiesContext( *this, xAttribs, mrTableCell.maLinePropertiesRight ) ); break; - case NMSP_DRAWINGML|XML_lnT: + case A_TOKEN( lnT ): xRet.set( new oox::drawingml::LinePropertiesContext( *this, xAttribs, mrTableCell.maLinePropertiesTop ) ); break; - case NMSP_DRAWINGML|XML_lnB: + case A_TOKEN( lnB ): xRet.set( new oox::drawingml::LinePropertiesContext( *this, xAttribs, mrTableCell.maLinePropertiesBottom ) ); break; - case NMSP_DRAWINGML|XML_lnTlToBr: + case A_TOKEN( lnTlToBr ): xRet.set( new oox::drawingml::LinePropertiesContext( *this, xAttribs, mrTableCell.maLinePropertiesTopLeftToBottomRight ) ); break; - case NMSP_DRAWINGML|XML_lnBlToTr: + case A_TOKEN( lnBlToTr ): xRet.set( new oox::drawingml::LinePropertiesContext( *this, xAttribs, mrTableCell.maLinePropertiesBottomLeftToTopRight ) ); break; - case NMSP_DRAWINGML|XML_cell3D: // CT_Cell3D + case A_TOKEN( cell3D ): // CT_Cell3D break; - case NMSP_DRAWINGML|XML_extLst: // CT_OfficeArtExtensionList + case A_TOKEN( extLst ): // CT_OfficeArtExtensionList break; default: diff --git a/oox/source/drawingml/table/tablecontext.cxx b/oox/source/drawingml/table/tablecontext.cxx index ef5d87e3081b..f7e7af620428 100644 --- a/oox/source/drawingml/table/tablecontext.cxx +++ b/oox/source/drawingml/table/tablecontext.cxx @@ -32,7 +32,6 @@ #include "oox/drawingml/table/tableproperties.hxx" #include "oox/drawingml/table/tablestylecontext.hxx" #include "oox/drawingml/table/tablerowcontext.hxx" -#include "oox/core/namespaces.hxx" using namespace ::oox::core; using namespace ::com::sun::star; @@ -59,7 +58,7 @@ TableContext::createFastChildContext( ::sal_Int32 aElementToken, const uno::Refe switch( aElementToken ) { - case NMSP_DRAWINGML|XML_tblPr: // CT_TableProperties + case A_TOKEN( tblPr ): // CT_TableProperties { AttributeList aAttribs( xAttribs ); mrTableProperties.isRtl() = aAttribs.getBool( XML_rtl, sal_False ); @@ -71,26 +70,26 @@ TableContext::createFastChildContext( ::sal_Int32 aElementToken, const uno::Refe mrTableProperties.isBandCol() = aAttribs.getBool( XML_bandCol, sal_False ); } break; - case NMSP_DRAWINGML|XML_tableStyle: // CT_TableStyle + case A_TOKEN( tableStyle ): // CT_TableStyle { boost::shared_ptr< TableStyle >& rTableStyle = mrTableProperties.getTableStyle(); rTableStyle.reset( new TableStyle() ); xRet = new TableStyleContext( *this, xAttribs, *rTableStyle ); } break; - case NMSP_DRAWINGML|XML_tableStyleId: // ST_Guid + case A_TOKEN( tableStyleId ): // ST_Guid xRet.set( new oox::drawingml::GuidContext( *this, mrTableProperties.getStyleId() ) ); break; - case NMSP_DRAWINGML|XML_tblGrid: // CT_TableGrid + case A_TOKEN( tblGrid ): // CT_TableGrid break; - case NMSP_DRAWINGML|XML_gridCol: // CT_TableCol + case A_TOKEN( gridCol ): // CT_TableCol { std::vector< sal_Int32 >& rvTableGrid( mrTableProperties.getTableGrid() ); rvTableGrid.push_back( xAttribs->getOptionalValue( XML_w ).toInt32() ); } break; - case NMSP_DRAWINGML|XML_tr: // CT_TableRow + case A_TOKEN( tr ): // CT_TableRow { std::vector< TableRow >& rvTableRows( mrTableProperties.getTableRows() ); rvTableRows.resize( rvTableRows.size() + 1 ); diff --git a/oox/source/drawingml/table/tablepartstylecontext.cxx b/oox/source/drawingml/table/tablepartstylecontext.cxx index 92e314d6afa7..1d48cbcf2a18 100644 --- a/oox/source/drawingml/table/tablepartstylecontext.cxx +++ b/oox/source/drawingml/table/tablepartstylecontext.cxx @@ -30,8 +30,7 @@ #include "oox/drawingml/table/tablepartstylecontext.hxx" #include "oox/drawingml/table/tablestyletextstylecontext.hxx" #include "oox/drawingml/table/tablestylecellstylecontext.hxx" -#include "oox/core/namespaces.hxx" -#include "tokens.hxx" + using namespace ::oox::core; using namespace ::com::sun::star; using namespace ::com::sun::star::uno; @@ -59,10 +58,10 @@ TablePartStyleContext::createFastChildContext( ::sal_Int32 aElementToken, const switch( aElementToken ) { - case NMSP_DRAWINGML|XML_tcTxStyle: // CT_TableStyleTextStyle + case A_TOKEN( tcTxStyle ): // CT_TableStyleTextStyle xRet.set( new TableStyleTextStyleContext( *this, xAttribs, mrTableStylePart ) ); break; - case NMSP_DRAWINGML|XML_tcStyle: // CT_TableStyleCellStyle + case A_TOKEN( tcStyle ): // CT_TableStyleCellStyle xRet.set( new TableStyleCellStyleContext( *this, mrTableStylePart ) ); break; } diff --git a/oox/source/drawingml/table/tableproperties.cxx b/oox/source/drawingml/table/tableproperties.cxx index 136754fbccc3..e0d0ac91c2ab 100644 --- a/oox/source/drawingml/table/tableproperties.cxx +++ b/oox/source/drawingml/table/tableproperties.cxx @@ -33,10 +33,8 @@ #include <com/sun/star/lang/XMultiServiceFactory.hpp> #include <com/sun/star/table/XMergeableCellRange.hpp> #include <com/sun/star/table/BorderLine.hpp> -#include "oox/core/namespaces.hxx" #include "oox/core/xmlfilterbase.hxx" #include "oox/helper/propertyset.hxx" -#include "tokens.hxx" using rtl::OUString; using namespace ::oox::core; diff --git a/oox/source/drawingml/table/tablerow.cxx b/oox/source/drawingml/table/tablerow.cxx index 8986a6e35d08..3c4af56a5d42 100644 --- a/oox/source/drawingml/table/tablerow.cxx +++ b/oox/source/drawingml/table/tablerow.cxx @@ -27,8 +27,6 @@ #include "oox/drawingml/table/tablerow.hxx" #include "oox/drawingml/drawingmltypes.hxx" -#include "oox/core/namespaces.hxx" -#include "tokens.hxx" #include <com/sun/star/container/XNameContainer.hpp> #include <com/sun/star/beans/XMultiPropertySet.hpp> #include "oox/helper/propertyset.hxx" diff --git a/oox/source/drawingml/table/tablerowcontext.cxx b/oox/source/drawingml/table/tablerowcontext.cxx index 7e0ff052bb4e..1a6c38167a8d 100644 --- a/oox/source/drawingml/table/tablerowcontext.cxx +++ b/oox/source/drawingml/table/tablerowcontext.cxx @@ -30,8 +30,6 @@ #include "oox/drawingml/table/tablerowcontext.hxx" #include "oox/drawingml/table/tablecellcontext.hxx" #include "oox/drawingml/table/tablerow.hxx" -#include "oox/core/namespaces.hxx" -#include "tokens.hxx" using namespace ::oox::core; using namespace ::com::sun::star; @@ -58,14 +56,14 @@ TableRowContext::createFastChildContext( ::sal_Int32 aElementToken, const uno::R switch( aElementToken ) { - case NMSP_DRAWINGML|XML_tc: // CT_TableCell + case A_TOKEN( tc ): // CT_TableCell { std::vector< TableCell >& rvTableCells = mrTableRow.getTableCells(); rvTableCells.resize( rvTableCells.size() + 1 ); xRet.set( new TableCellContext( *this, xAttribs, rvTableCells.back() ) ); } break; - case NMSP_DRAWINGML|XML_extLst: // CT_OfficeArtExtensionList + case A_TOKEN( extLst ): // CT_OfficeArtExtensionList default: break; } diff --git a/oox/source/drawingml/table/tablestylecellstylecontext.cxx b/oox/source/drawingml/table/tablestylecellstylecontext.cxx index 47d747bf8b20..56127b0c049c 100644 --- a/oox/source/drawingml/table/tablestylecellstylecontext.cxx +++ b/oox/source/drawingml/table/tablestylecellstylecontext.cxx @@ -30,9 +30,8 @@ #include "oox/drawingml/table/tablestylecellstylecontext.hxx" #include "oox/drawingml/fillpropertiesgroupcontext.hxx" #include "oox/drawingml/linepropertiescontext.hxx" -#include "oox/core/namespaces.hxx" #include "oox/helper/attributelist.hxx" -#include "tokens.hxx" + using namespace ::oox::core; using namespace ::com::sun::star; using namespace ::com::sun::star::uno; @@ -61,20 +60,20 @@ TableStyleCellStyleContext::createFastChildContext( ::sal_Int32 aElementToken, c AttributeList aAttribs( xAttribs ); switch( aElementToken ) { - case NMSP_DRAWINGML|XML_tcBdr: // CT_TableCellBorderStyle + case A_TOKEN( tcBdr ): // CT_TableCellBorderStyle break; - case NMSP_DRAWINGML|XML_left: // CT_ThemeableLineStyle - case NMSP_DRAWINGML|XML_right: - case NMSP_DRAWINGML|XML_top: - case NMSP_DRAWINGML|XML_bottom: - case NMSP_DRAWINGML|XML_insideH: - case NMSP_DRAWINGML|XML_insideV: - case NMSP_DRAWINGML|XML_tl2br: - case NMSP_DRAWINGML|XML_tr2bl: - mnLineType = getToken( aElementToken ); + case A_TOKEN( left ): // CT_ThemeableLineStyle + case A_TOKEN( right ): + case A_TOKEN( top ): + case A_TOKEN( bottom ): + case A_TOKEN( insideH ): + case A_TOKEN( insideV ): + case A_TOKEN( tl2br ): + case A_TOKEN( tr2bl ): + mnLineType = getBaseToken( aElementToken ); break; - case NMSP_DRAWINGML|XML_ln: + case A_TOKEN( ln ): { if ( mnLineType != XML_none ) { @@ -85,7 +84,7 @@ TableStyleCellStyleContext::createFastChildContext( ::sal_Int32 aElementToken, c } } break; - case NMSP_DRAWINGML|XML_lnRef: + case A_TOKEN( lnRef ): { if ( mnLineType != XML_none ) { @@ -97,14 +96,14 @@ TableStyleCellStyleContext::createFastChildContext( ::sal_Int32 aElementToken, c break; // EG_ThemeableFillStyle (choice) - case NMSP_DRAWINGML|XML_fill: // CT_FillProperties + case A_TOKEN( fill ): // CT_FillProperties { FillPropertiesPtr& rxFillProperties = mrTableStylePart.getFillProperties(); rxFillProperties.reset( new FillProperties ); xRet.set( new FillPropertiesContext( *this, *rxFillProperties ) ); } break; - case NMSP_DRAWINGML|XML_fillRef: // CT_StyleMatrixReference + case A_TOKEN( fillRef ): // CT_StyleMatrixReference { ShapeStyleRef& rStyleRef = mrTableStylePart.getStyleRefs()[ XML_fillRef ]; rStyleRef.mnThemedIdx = aAttribs.getInteger( XML_idx, 0 ); @@ -112,7 +111,7 @@ TableStyleCellStyleContext::createFastChildContext( ::sal_Int32 aElementToken, c } break; - case NMSP_DRAWINGML|XML_cell3D: // CT_Cell3D + case A_TOKEN( cell3D ): // CT_Cell3D break; } if( !xRet.is() ) diff --git a/oox/source/drawingml/table/tablestylecontext.cxx b/oox/source/drawingml/table/tablestylecontext.cxx index 4d0b945d3d72..aee23eaf9c7b 100644 --- a/oox/source/drawingml/table/tablestylecontext.cxx +++ b/oox/source/drawingml/table/tablestylecontext.cxx @@ -30,8 +30,7 @@ #include "oox/drawingml/table/tablestylecontext.hxx" #include "oox/drawingml/table/tablebackgroundstylecontext.hxx" #include "oox/drawingml/table/tablepartstylecontext.hxx" -#include "oox/core/namespaces.hxx" -#include "tokens.hxx" + using namespace ::oox::core; using namespace ::com::sun::star; using namespace ::com::sun::star::uno; @@ -61,49 +60,49 @@ TableStyleContext::createFastChildContext( ::sal_Int32 aElementToken, const uno: switch( aElementToken ) { - case NMSP_DRAWINGML|XML_tblBg: // CT_TableBackgroundStyle + case A_TOKEN( tblBg ): // CT_TableBackgroundStyle xRet = new TableBackgroundStyleContext( *this, mrTableStyle ); break; - case NMSP_DRAWINGML|XML_wholeTbl: // CT_TablePartStyle + case A_TOKEN( wholeTbl ): // CT_TablePartStyle xRet = new TablePartStyleContext( *this, mrTableStyle.getWholeTbl() ); break; - case NMSP_DRAWINGML|XML_band1H: // CT_TablePartStyle + case A_TOKEN( band1H ): // CT_TablePartStyle xRet = new TablePartStyleContext( *this, mrTableStyle.getBand1H() ); break; - case NMSP_DRAWINGML|XML_band2H: // CT_TablePartStyle + case A_TOKEN( band2H ): // CT_TablePartStyle xRet = new TablePartStyleContext( *this, mrTableStyle.getBand2H() ); break; - case NMSP_DRAWINGML|XML_band1V: // CT_TablePartStyle + case A_TOKEN( band1V ): // CT_TablePartStyle xRet = new TablePartStyleContext( *this, mrTableStyle.getBand1V() ); break; - case NMSP_DRAWINGML|XML_band2V: // CT_TablePartStyle + case A_TOKEN( band2V ): // CT_TablePartStyle xRet = new TablePartStyleContext( *this, mrTableStyle.getBand2V() ); break; - case NMSP_DRAWINGML|XML_lastCol: // CT_TablePartStyle + case A_TOKEN( lastCol ): // CT_TablePartStyle xRet = new TablePartStyleContext( *this, mrTableStyle.getLastCol() ); break; - case NMSP_DRAWINGML|XML_firstCol: // CT_TablePartStyle + case A_TOKEN( firstCol ): // CT_TablePartStyle xRet = new TablePartStyleContext( *this, mrTableStyle.getFirstCol() ); break; - case NMSP_DRAWINGML|XML_lastRow: // CT_TablePartStyle + case A_TOKEN( lastRow ): // CT_TablePartStyle xRet = new TablePartStyleContext( *this, mrTableStyle.getLastRow() ); break; - case NMSP_DRAWINGML|XML_seCell: // CT_TablePartStyle + case A_TOKEN( seCell ): // CT_TablePartStyle xRet = new TablePartStyleContext( *this, mrTableStyle.getSeCell() ); break; - case NMSP_DRAWINGML|XML_swCell: // CT_TablePartStyle + case A_TOKEN( swCell ): // CT_TablePartStyle xRet = new TablePartStyleContext( *this, mrTableStyle.getSwCell() ); break; - case NMSP_DRAWINGML|XML_firstRow: // CT_TablePartStyle + case A_TOKEN( firstRow ): // CT_TablePartStyle xRet = new TablePartStyleContext( *this, mrTableStyle.getFirstRow() ); break; - case NMSP_DRAWINGML|XML_neCell: // CT_TablePartStyle + case A_TOKEN( neCell ): // CT_TablePartStyle xRet = new TablePartStyleContext( *this, mrTableStyle.getNeCell() ); break; - case NMSP_DRAWINGML|XML_nwCell: // CT_TablePartStyle + case A_TOKEN( nwCell ): // CT_TablePartStyle xRet = new TablePartStyleContext( *this, mrTableStyle.getNwCell() ); break; - case NMSP_DRAWINGML|XML_extLst: // CT_OfficeArtExtensionList + case A_TOKEN( extLst ): // CT_OfficeArtExtensionList break; } if( !xRet.is() ) diff --git a/oox/source/drawingml/table/tablestylelistfragmenthandler.cxx b/oox/source/drawingml/table/tablestylelistfragmenthandler.cxx index e90554409d4d..7b837d27e826 100644 --- a/oox/source/drawingml/table/tablestylelistfragmenthandler.cxx +++ b/oox/source/drawingml/table/tablestylelistfragmenthandler.cxx @@ -62,10 +62,10 @@ Reference< XFastContextHandler > TableStyleListFragmentHandler::createFastChildC Reference< XFastContextHandler > xRet; switch( aElementToken ) { - case NMSP_DRAWINGML|XML_tblStyleLst: // CT_TableStyleList + case A_TOKEN( tblStyleLst ): // CT_TableStyleList mrTableStyleList.getDefaultStyleId() = xAttribs->getOptionalValue( XML_def ); break; - case NMSP_DRAWINGML|XML_tblStyle: // CT_TableStyle + case A_TOKEN( tblStyle ): // CT_TableStyle std::vector< TableStyle >& rTableStyles = mrTableStyleList.getTableStyles(); rTableStyles.resize( rTableStyles.size() + 1 ); xRet = new TableStyleContext( *this, xAttribs, rTableStyles.back() ); diff --git a/oox/source/drawingml/table/tablestylepart.cxx b/oox/source/drawingml/table/tablestylepart.cxx index f8e700e5fccd..b4a68fd488cd 100644 --- a/oox/source/drawingml/table/tablestylepart.cxx +++ b/oox/source/drawingml/table/tablestylepart.cxx @@ -27,8 +27,6 @@ #include "oox/drawingml/table/tablestylepart.hxx" #include "oox/drawingml/drawingmltypes.hxx" -#include "oox/core/namespaces.hxx" -#include "tokens.hxx" using rtl::OUString; using namespace ::oox::core; diff --git a/oox/source/drawingml/table/tablestyletextstylecontext.cxx b/oox/source/drawingml/table/tablestyletextstylecontext.cxx index ec117f4ac3c1..7c04e3293eb1 100644 --- a/oox/source/drawingml/table/tablestyletextstylecontext.cxx +++ b/oox/source/drawingml/table/tablestyletextstylecontext.cxx @@ -29,9 +29,8 @@ #include "oox/drawingml/table/tablestyletextstylecontext.hxx" #include "oox/drawingml/colorchoicecontext.hxx" -#include "oox/core/namespaces.hxx" #include "oox/helper/attributelist.hxx" -#include "tokens.hxx" + using namespace ::oox::core; using namespace ::com::sun::star; using namespace ::com::sun::star::uno; @@ -73,23 +72,23 @@ TableStyleTextStyleContext::createFastChildContext( ::sal_Int32 aElementToken, c switch( aElementToken ) { // EG_ThemeableFontStyles (choice) - case NMSP_DRAWINGML|XML_font: // CT_FontCollection + case A_TOKEN( font ): // CT_FontCollection xRet.set( this ); break; - case NMSP_DRAWINGML|XML_ea: // CT_TextFont + case A_TOKEN( ea ): // CT_TextFont mrTableStylePart.getAsianFont().setAttributes( aAttribs ); return 0; - case NMSP_DRAWINGML|XML_cs: // CT_TextFont + case A_TOKEN( cs ): // CT_TextFont mrTableStylePart.getComplexFont().setAttributes( aAttribs ); return 0; - case NMSP_DRAWINGML|XML_sym: // CT_TextFont + case A_TOKEN( sym ): // CT_TextFont mrTableStylePart.getSymbolFont().setAttributes( aAttribs ); return 0; - case NMSP_DRAWINGML|XML_latin: // CT_TextFont + case A_TOKEN( latin ): // CT_TextFont mrTableStylePart.getLatinFont().setAttributes( aAttribs ); return 0; - case NMSP_DRAWINGML|XML_fontRef: // CT_FontReference + case A_TOKEN( fontRef ): // CT_FontReference { ShapeStyleRef& rFontStyle = mrTableStylePart.getStyleRefs()[ XML_fontRef ]; rFontStyle.mnThemedIdx = aAttribs.getToken( XML_idx, XML_none ); @@ -97,7 +96,7 @@ TableStyleTextStyleContext::createFastChildContext( ::sal_Int32 aElementToken, c } break; - case NMSP_DRAWINGML|XML_extLst: // CT_OfficeArtExtensionList + case A_TOKEN( extLst ): // CT_OfficeArtExtensionList break; } if( !xRet.is() ) diff --git a/oox/source/drawingml/textbodycontext.cxx b/oox/source/drawingml/textbodycontext.cxx index 8de730849b24..8d695e295fd4 100644 --- a/oox/source/drawingml/textbodycontext.cxx +++ b/oox/source/drawingml/textbodycontext.cxx @@ -33,8 +33,6 @@ #include "oox/drawingml/textliststylecontext.hxx" #include "oox/drawingml/textfield.hxx" #include "oox/drawingml/textfieldcontext.hxx" -#include "oox/core/namespaces.hxx" -#include "tokens.hxx" using ::rtl::OUString; using namespace ::oox::core; @@ -69,7 +67,7 @@ TextParagraphContext::TextParagraphContext( ContextHandler& rParent, TextParagra // -------------------------------------------------------------------- void TextParagraphContext::endFastElement( sal_Int32 aElementToken ) throw (SAXException, RuntimeException) { - if( aElementToken == (NMSP_DRAWINGML|XML_p) ) + if( aElementToken == (A_TOKEN( p )) ) { } } @@ -83,14 +81,14 @@ Reference< XFastContextHandler > TextParagraphContext::createFastChildContext( s // EG_TextRun switch( aElementToken ) { - case NMSP_DRAWINGML|XML_r: // "CT_RegularTextRun" Regular Text Run. + case A_TOKEN( r ): // "CT_RegularTextRun" Regular Text Run. { TextRunPtr pRun( new TextRun ); mrParagraph.addRun( pRun ); xRet.set( new RegularTextRunContext( *this, pRun ) ); break; } - case NMSP_DRAWINGML|XML_br: // "CT_TextLineBreak" Soft return line break (vertical tab). + case A_TOKEN( br ): // "CT_TextLineBreak" Soft return line break (vertical tab). { TextRunPtr pRun( new TextRun ); pRun->setLineBreak(); @@ -98,17 +96,17 @@ Reference< XFastContextHandler > TextParagraphContext::createFastChildContext( s xRet.set( new RegularTextRunContext( *this, pRun ) ); break; } - case NMSP_DRAWINGML|XML_fld: // "CT_TextField" Text Field. + case A_TOKEN( fld ): // "CT_TextField" Text Field. { TextFieldPtr pField( new TextField ); mrParagraph.addRun( pField ); xRet.set( new TextFieldContext( *this, xAttribs, *pField ) ); break; } - case NMSP_DRAWINGML|XML_pPr: + case A_TOKEN( pPr ): xRet.set( new TextParagraphPropertiesContext( *this, xAttribs, mrParagraph.getProperties() ) ); break; - case NMSP_DRAWINGML|XML_endParaRPr: + case A_TOKEN( endParaRPr ): xRet.set( new TextCharacterPropertiesContext( *this, xAttribs, mrParagraph.getEndProperties() ) ); break; } @@ -130,12 +128,12 @@ void RegularTextRunContext::endFastElement( sal_Int32 aElementToken ) throw (SAX { switch( aElementToken ) { - case NMSP_DRAWINGML|XML_t: + case A_TOKEN( t ): { mbIsInText = false; break; } - case NMSP_DRAWINGML|XML_r: + case A_TOKEN( r ): { break; } @@ -161,10 +159,10 @@ Reference< XFastContextHandler > RegularTextRunContext::createFastChildContext( switch( aElementToken ) { - case NMSP_DRAWINGML|XML_rPr: // "CT_TextCharPropertyBag" The text char properties of this text run. + case A_TOKEN( rPr ): // "CT_TextCharPropertyBag" The text char properties of this text run. xRet.set( new TextCharacterPropertiesContext( *this, xAttribs, mpRunPtr->getTextCharacterProperties() ) ); break; - case NMSP_DRAWINGML|XML_t: // "xsd:string" minOccurs="1" The actual text string. + case A_TOKEN( t ): // "xsd:string" minOccurs="1" The actual text string. mbIsInText = true; break; } @@ -194,13 +192,13 @@ Reference< XFastContextHandler > TextBodyContext::createFastChildContext( sal_In switch( aElementToken ) { - case NMSP_DRAWINGML|XML_bodyPr: // CT_TextBodyPropertyBag + case A_TOKEN( bodyPr ): // CT_TextBodyPropertyBag xRet.set( new TextBodyPropertiesContext( *this, xAttribs, mrTextBody.getTextProperties() ) ); break; - case NMSP_DRAWINGML|XML_lstStyle: // CT_TextListStyle + case A_TOKEN( lstStyle ): // CT_TextListStyle xRet.set( new TextListStyleContext( *this, mrTextBody.getTextListStyle() ) ); break; - case NMSP_DRAWINGML|XML_p: // CT_TextParagraph + case A_TOKEN( p ): // CT_TextParagraph xRet.set( new TextParagraphContext( *this, mrTextBody.addParagraph() ) ); break; } diff --git a/oox/source/drawingml/textbodyproperties.cxx b/oox/source/drawingml/textbodyproperties.cxx index 6cec7643e58e..4339c93aa0ae 100644 --- a/oox/source/drawingml/textbodyproperties.cxx +++ b/oox/source/drawingml/textbodyproperties.cxx @@ -27,8 +27,7 @@ #include "oox/drawingml/textbodyproperties.hxx" #include <com/sun/star/text/WritingMode.hpp> -#include "properties.hxx" -#include "tokens.hxx" +#include "oox/token/tokens.hxx" namespace oox { namespace drawingml { diff --git a/oox/source/drawingml/textbodypropertiescontext.cxx b/oox/source/drawingml/textbodypropertiescontext.cxx index 668266f2f679..f22258075e16 100644 --- a/oox/source/drawingml/textbodypropertiescontext.cxx +++ b/oox/source/drawingml/textbodypropertiescontext.cxx @@ -36,9 +36,6 @@ #include "oox/drawingml/drawingmltypes.hxx" #include "oox/helper/attributelist.hxx" #include "oox/helper/propertymap.hxx" -#include "oox/core/namespaces.hxx" -#include "properties.hxx" -#include "tokens.hxx" using ::rtl::OUString; using namespace ::oox::core; @@ -156,27 +153,27 @@ Reference< XFastContextHandler > TextBodyPropertiesContext::createFastChildConte switch( aElementToken ) { // Sequence - case NMSP_DRAWINGML|XML_prstTxWarp: // CT_PresetTextShape - case NMSP_DRAWINGML|XML_prot: // CT_TextProtectionProperty + case A_TOKEN( prstTxWarp ): // CT_PresetTextShape + case A_TOKEN( prot ): // CT_TextProtectionProperty break; // EG_TextAutofit - case NMSP_DRAWINGML|XML_noAutofit: + case A_TOKEN( noAutofit ): mrTextBodyProp.maPropertyMap[ PROP_TextAutoGrowHeight ] <<= false; // CT_TextNoAutofit break; - case NMSP_DRAWINGML|XML_normAutofit: // CT_TextNormalAutofit + case A_TOKEN( normAutofit ): // CT_TextNormalAutofit mrTextBodyProp.maPropertyMap[ PROP_TextFitToSize ] <<= true; mrTextBodyProp.maPropertyMap[ PROP_TextAutoGrowHeight ] <<= false; break; - case NMSP_DRAWINGML|XML_spAutoFit: + case A_TOKEN( spAutoFit ): mrTextBodyProp.maPropertyMap[ PROP_TextAutoGrowHeight ] <<= true; break; - case NMSP_DRAWINGML|XML_scene3d: // CT_Scene3D + case A_TOKEN( scene3d ): // CT_Scene3D // EG_Text3D - case NMSP_DRAWINGML|XML_sp3d: // CT_Shape3D - case NMSP_DRAWINGML|XML_flatTx: // CT_FlatText + case A_TOKEN( sp3d ): // CT_Shape3D + case A_TOKEN( flatTx ): // CT_FlatText break; } diff --git a/oox/source/drawingml/textcharacterproperties.cxx b/oox/source/drawingml/textcharacterproperties.cxx index 3ac5018c1dad..c55751ba25f6 100644 --- a/oox/source/drawingml/textcharacterproperties.cxx +++ b/oox/source/drawingml/textcharacterproperties.cxx @@ -33,8 +33,7 @@ #include "oox/helper/propertyset.hxx" #include "oox/core/xmlfilterbase.hxx" #include "oox/drawingml/drawingmltypes.hxx" -#include "properties.hxx" -#include "tokens.hxx" +#include "oox/token/tokens.hxx" using ::rtl::OUString; using ::oox::core::XmlFilterBase; diff --git a/oox/source/drawingml/textcharacterpropertiescontext.cxx b/oox/source/drawingml/textcharacterpropertiescontext.cxx index cfba04a7b44b..f3be44773a39 100644 --- a/oox/source/drawingml/textcharacterpropertiescontext.cxx +++ b/oox/source/drawingml/textcharacterpropertiescontext.cxx @@ -32,10 +32,8 @@ #include "oox/drawingml/colorchoicecontext.hxx" #include "oox/drawingml/lineproperties.hxx" #include "oox/drawingml/textparagraphproperties.hxx" -#include "oox/core/namespaces.hxx" #include "oox/core/relations.hxx" #include "hyperlinkcontext.hxx" -#include "tokens.hxx" using ::rtl::OUString; using namespace ::oox::core; @@ -76,21 +74,21 @@ TextCharacterPropertiesContext::TextCharacterPropertiesContext( // ST_TextNonNegativePoint const OUString sCharKerning( CREATE_OUSTRING( "CharKerning" ) ); - //case NMSP_DRAWINGML|XML_kern: + //case A_TOKEN( kern ): // ST_TextLanguageID OUString sAltLang = rXAttributes->getOptionalValue( XML_altLang ); - case NMSP_DRAWINGML|XML_kumimoji: // xsd:boolean + case A_TOKEN( kumimoji ): // xsd:boolean break; - case NMSP_DRAWINGML|XML_spc: // ST_TextPoint - case NMSP_DRAWINGML|XML_normalizeH: // xsd:boolean - case NMSP_DRAWINGML|XML_baseline: // ST_Percentage - case NMSP_DRAWINGML|XML_noProof: // xsd:boolean - case NMSP_DRAWINGML|XML_dirty: // xsd:boolean - case NMSP_DRAWINGML|XML_err: // xsd:boolean - case NMSP_DRAWINGML|XML_smtClean: // xsd:boolean - case NMSP_DRAWINGML|XML_smtId: // xsd:unsignedInt + case A_TOKEN( spc ): // ST_TextPoint + case A_TOKEN( normalizeH ): // xsd:boolean + case A_TOKEN( baseline ): // ST_Percentage + case A_TOKEN( noProof ): // xsd:boolean + case A_TOKEN( dirty ): // xsd:boolean + case A_TOKEN( err ): // xsd:boolean + case A_TOKEN( smtClean ): // xsd:boolean + case A_TOKEN( smtId ): // xsd:unsignedInt break; */ @@ -115,56 +113,56 @@ Reference< XFastContextHandler > TextCharacterPropertiesContext::createFastChild switch( aElementToken ) { // TODO unsupported yet -// case NMSP_DRAWINGML|XML_ln: // CT_LineProperties +// case A_TOKEN( ln ): // CT_LineProperties // xRet.set( new LinePropertiesContext( getHandler(), xAttributes, maTextOutlineProperties ) ); // break; - case NMSP_DRAWINGML|XML_solidFill: // EG_FillProperties + case A_TOKEN( solidFill ): // EG_FillProperties xRet.set( new ColorContext( *this, mrTextCharacterProperties.maCharColor ) ); break; // EG_EffectProperties - case NMSP_DRAWINGML|XML_effectDag: // CT_EffectContainer 5.1.10.25 - case NMSP_DRAWINGML|XML_effectLst: // CT_EffectList 5.1.10.26 + case A_TOKEN( effectDag ): // CT_EffectContainer 5.1.10.25 + case A_TOKEN( effectLst ): // CT_EffectList 5.1.10.26 break; - case NMSP_DRAWINGML|XML_highlight: // CT_Color + case A_TOKEN( highlight ): // CT_Color xRet.set( new ColorContext( *this, mrTextCharacterProperties.maHighlightColor ) ); break; // EG_TextUnderlineLine - case NMSP_DRAWINGML|XML_uLnTx: // CT_TextUnderlineLineFollowText + case A_TOKEN( uLnTx ): // CT_TextUnderlineLineFollowText mrTextCharacterProperties.moUnderlineLineFollowText = true; break; // TODO unsupported yet -// case NMSP_DRAWINGML|XML_uLn: // CT_LineProperties +// case A_TOKEN( uLn ): // CT_LineProperties // xRet.set( new LinePropertiesContext( getHandler(), xAttributes, maUnderlineProperties ) ); // break; // EG_TextUnderlineFill - case NMSP_DRAWINGML|XML_uFillTx: // CT_TextUnderlineFillFollowText + case A_TOKEN( uFillTx ): // CT_TextUnderlineFillFollowText mrTextCharacterProperties.moUnderlineFillFollowText = true; break; - case NMSP_DRAWINGML|XML_uFill: // CT_TextUnderlineFillGroupWrapper->EG_FillProperties (not supported) + case A_TOKEN( uFill ): // CT_TextUnderlineFillGroupWrapper->EG_FillProperties (not supported) xRet.set( new SimpleFillPropertiesContext( *this, mrTextCharacterProperties.maUnderlineColor ) ); break; // CT_FontCollection - case NMSP_DRAWINGML|XML_latin: // CT_TextFont + case A_TOKEN( latin ): // CT_TextFont mrTextCharacterProperties.maLatinFont.setAttributes( aAttribs ); break; - case NMSP_DRAWINGML|XML_ea: // CT_TextFont + case A_TOKEN( ea ): // CT_TextFont mrTextCharacterProperties.maAsianFont.setAttributes( aAttribs ); break; - case NMSP_DRAWINGML|XML_cs: // CT_TextFont + case A_TOKEN( cs ): // CT_TextFont mrTextCharacterProperties.maComplexFont.setAttributes( aAttribs ); break; - case NMSP_DRAWINGML|XML_sym: // CT_TextFont + case A_TOKEN( sym ): // CT_TextFont mrTextCharacterProperties.maSymbolFont.setAttributes( aAttribs ); break; - case NMSP_DRAWINGML|XML_hlinkClick: // CT_Hyperlink - case NMSP_DRAWINGML|XML_hlinkMouseOver: // CT_Hyperlink + case A_TOKEN( hlinkClick ): // CT_Hyperlink + case A_TOKEN( hlinkMouseOver ): // CT_Hyperlink xRet.set( new HyperLinkContext( *this, xAttributes, mrTextCharacterProperties.maHyperlinkPropertyMap ) ); break; } diff --git a/oox/source/drawingml/textfieldcontext.cxx b/oox/source/drawingml/textfieldcontext.cxx index 2c993af562bf..4e9f576a0ca9 100644 --- a/oox/source/drawingml/textfieldcontext.cxx +++ b/oox/source/drawingml/textfieldcontext.cxx @@ -29,8 +29,6 @@ #include "oox/drawingml/textparagraphpropertiescontext.hxx" #include "oox/drawingml/textcharacterpropertiescontext.hxx" #include "oox/drawingml/textfield.hxx" -#include "oox/core/namespaces.hxx" -#include "tokens.hxx" using ::rtl::OUString; using namespace ::oox::core; @@ -52,7 +50,7 @@ TextFieldContext::TextFieldContext( ContextHandler& rParent, void TextFieldContext::endFastElement( sal_Int32 aElementToken ) throw (SAXException, RuntimeException) { - if( aElementToken == (NMSP_DRAWINGML|XML_t) ) + if( aElementToken == (A_TOKEN( t )) ) { mbIsInText = false; } @@ -72,13 +70,13 @@ Reference< XFastContextHandler > TextFieldContext::createFastChildContext( sal_I Reference< XFastContextHandler > xRet; switch( aElementToken ) { - case NMSP_DRAWINGML|XML_rPr: + case A_TOKEN( rPr ): xRet.set( new TextCharacterPropertiesContext( *this, xAttribs, mrTextField.getTextCharacterProperties() ) ); break; - case NMSP_DRAWINGML|XML_pPr: + case A_TOKEN( pPr ): xRet.set( new TextParagraphPropertiesContext( *this, xAttribs, mrTextField.getTextParagraphProperties() ) ); break; - case NMSP_DRAWINGML|XML_t: + case A_TOKEN( t ): mbIsInText = true; break; } diff --git a/oox/source/drawingml/textfont.cxx b/oox/source/drawingml/textfont.cxx index 8d58787e544a..b4f9d359fb14 100644 --- a/oox/source/drawingml/textfont.cxx +++ b/oox/source/drawingml/textfont.cxx @@ -31,7 +31,6 @@ #include "oox/drawingml/theme.hxx" #include "oox/core/xmlfilterbase.hxx" #include "oox/helper/attributelist.hxx" -#include "tokens.hxx" using ::rtl::OUString; using ::oox::core::XmlFilterBase; diff --git a/oox/source/drawingml/textliststylecontext.cxx b/oox/source/drawingml/textliststylecontext.cxx index 693957490579..21afc698d730 100644 --- a/oox/source/drawingml/textliststylecontext.cxx +++ b/oox/source/drawingml/textliststylecontext.cxx @@ -27,9 +27,7 @@ #include "oox/drawingml/textliststylecontext.hxx" #include "oox/drawingml/textparagraphpropertiescontext.hxx" -#include "oox/core/namespaces.hxx" #include "oox/helper/attributelist.hxx" -#include "tokens.hxx" using ::rtl::OUString; using namespace ::oox::core; @@ -64,40 +62,40 @@ Reference< XFastContextHandler > TextListStyleContext::createFastChildContext( s Reference< XFastContextHandler > xRet; switch( aElementToken ) { - case NMSP_DRAWINGML|XML_defPPr: // CT_TextParagraphProperties + case A_TOKEN( defPPr ): // CT_TextParagraphProperties xRet.set( new TextParagraphPropertiesContext( *this, rxAttributes, *mrTextListStyle.getListStyle()[ 0 ] ) ); break; - case NMSP_DRAWINGML|XML_outline1pPr: + case A_TOKEN( outline1pPr ): xRet.set( new TextParagraphPropertiesContext( *this, rxAttributes, *mrTextListStyle.getAggregationListStyle()[ 0 ] ) ); break; - case NMSP_DRAWINGML|XML_outline2pPr: + case A_TOKEN( outline2pPr ): xRet.set( new TextParagraphPropertiesContext( *this, rxAttributes, *mrTextListStyle.getAggregationListStyle()[ 1 ] ) ); break; - case NMSP_DRAWINGML|XML_lvl1pPr: + case A_TOKEN( lvl1pPr ): xRet.set( new TextParagraphPropertiesContext( *this, rxAttributes, *mrTextListStyle.getListStyle()[ 0 ] ) ); break; - case NMSP_DRAWINGML|XML_lvl2pPr: + case A_TOKEN( lvl2pPr ): xRet.set( new TextParagraphPropertiesContext( *this, rxAttributes, *mrTextListStyle.getListStyle()[ 1 ] ) ); break; - case NMSP_DRAWINGML|XML_lvl3pPr: + case A_TOKEN( lvl3pPr ): xRet.set( new TextParagraphPropertiesContext( *this, rxAttributes, *mrTextListStyle.getListStyle()[ 2 ] ) ); break; - case NMSP_DRAWINGML|XML_lvl4pPr: + case A_TOKEN( lvl4pPr ): xRet.set( new TextParagraphPropertiesContext( *this, rxAttributes, *mrTextListStyle.getListStyle()[ 3 ] ) ); break; - case NMSP_DRAWINGML|XML_lvl5pPr: + case A_TOKEN( lvl5pPr ): xRet.set( new TextParagraphPropertiesContext( *this, rxAttributes, *mrTextListStyle.getListStyle()[ 4 ] ) ); break; - case NMSP_DRAWINGML|XML_lvl6pPr: + case A_TOKEN( lvl6pPr ): xRet.set( new TextParagraphPropertiesContext( *this, rxAttributes, *mrTextListStyle.getListStyle()[ 5 ] ) ); break; - case NMSP_DRAWINGML|XML_lvl7pPr: + case A_TOKEN( lvl7pPr ): xRet.set( new TextParagraphPropertiesContext( *this, rxAttributes, *mrTextListStyle.getListStyle()[ 6 ] ) ); break; - case NMSP_DRAWINGML|XML_lvl8pPr: + case A_TOKEN( lvl8pPr ): xRet.set( new TextParagraphPropertiesContext( *this, rxAttributes, *mrTextListStyle.getListStyle()[ 7 ] ) ); break; - case NMSP_DRAWINGML|XML_lvl9pPr: + case A_TOKEN( lvl9pPr ): xRet.set( new TextParagraphPropertiesContext( *this, rxAttributes, *mrTextListStyle.getListStyle()[ 8 ] ) ); break; } diff --git a/oox/source/drawingml/textparagraphproperties.cxx b/oox/source/drawingml/textparagraphproperties.cxx index 2f5954168d37..cd969874513e 100644 --- a/oox/source/drawingml/textparagraphproperties.cxx +++ b/oox/source/drawingml/textparagraphproperties.cxx @@ -37,11 +37,8 @@ #include "oox/helper/helper.hxx" #include "oox/helper/propertyset.hxx" -#include "oox/core/namespaces.hxx" #include "oox/core/xmlfilterbase.hxx" #include "oox/drawingml/drawingmltypes.hxx" -#include "properties.hxx" -#include "tokens.hxx" using rtl::OUString; using namespace ::oox::core; diff --git a/oox/source/drawingml/textparagraphpropertiescontext.cxx b/oox/source/drawingml/textparagraphpropertiescontext.cxx index 3c41fef69a76..eb888867556b 100644 --- a/oox/source/drawingml/textparagraphpropertiescontext.cxx +++ b/oox/source/drawingml/textparagraphpropertiescontext.cxx @@ -34,11 +34,8 @@ #include "oox/drawingml/textcharacterpropertiescontext.hxx" #include "oox/drawingml/fillproperties.hxx" #include "oox/helper/attributelist.hxx" -#include "oox/core/namespaces.hxx" -#include "properties.hxx" #include "textspacingcontext.hxx" #include "texttabstoplistcontext.hxx" -#include "tokens.hxx" using ::rtl::OUString; using namespace ::oox::core; @@ -187,49 +184,49 @@ Reference< XFastContextHandler > TextParagraphPropertiesContext::createFastChild Reference< XFastContextHandler > xRet; switch( aElementToken ) { - case NMSP_DRAWINGML|XML_lnSpc: // CT_TextSpacing + case A_TOKEN( lnSpc ): // CT_TextSpacing xRet.set( new TextSpacingContext( *this, maLineSpacing ) ); break; - case NMSP_DRAWINGML|XML_spcBef: // CT_TextSpacing + case A_TOKEN( spcBef ): // CT_TextSpacing xRet.set( new TextSpacingContext( *this, mrSpaceBefore ) ); break; - case NMSP_DRAWINGML|XML_spcAft: // CT_TextSpacing + case A_TOKEN( spcAft ): // CT_TextSpacing xRet.set( new TextSpacingContext( *this, mrSpaceAfter ) ); break; // EG_TextBulletColor - case NMSP_DRAWINGML|XML_buClrTx: // CT_TextBulletColorFollowText ??? + case A_TOKEN( buClrTx ): // CT_TextBulletColorFollowText ??? mrBulletList.mbBulletColorFollowText <<= sal_True; break; - case NMSP_DRAWINGML|XML_buClr: // CT_Color + case A_TOKEN( buClr ): // CT_Color xRet.set( new ColorContext( *this, *mrBulletList.maBulletColorPtr ) ); break; // EG_TextBulletSize - case NMSP_DRAWINGML|XML_buSzTx: // CT_TextBulletSizeFollowText + case A_TOKEN( buSzTx ): // CT_TextBulletSizeFollowText mrBulletList.setBulletSize(100); break; - case NMSP_DRAWINGML|XML_buSzPct: // CT_TextBulletSizePercent + case A_TOKEN( buSzPct ): // CT_TextBulletSizePercent mrBulletList.setBulletSize( static_cast<sal_Int16>( GetPercent( rXAttributes->getOptionalValue( XML_val ) ) / 1000 ) ); break; - case NMSP_DRAWINGML|XML_buSzPts: // CT_TextBulletSizePoint + case A_TOKEN( buSzPts ): // CT_TextBulletSizePoint mrBulletList.setBulletSize(0); mrBulletList.setFontSize( static_cast<sal_Int16>(GetTextSize( rXAttributes->getOptionalValue( XML_val ) ) ) ); break; // EG_TextBulletTypeface - case NMSP_DRAWINGML|XML_buFontTx: // CT_TextBulletTypefaceFollowText + case A_TOKEN( buFontTx ): // CT_TextBulletTypefaceFollowText mrBulletList.mbBulletFontFollowText <<= sal_True; break; - case NMSP_DRAWINGML|XML_buFont: // CT_TextFont + case A_TOKEN( buFont ): // CT_TextFont mrBulletList.maBulletFont.setAttributes( aAttribs ); break; // EG_TextBullet - case NMSP_DRAWINGML|XML_buNone: // CT_TextNoBullet + case A_TOKEN( buNone ): // CT_TextNoBullet mrBulletList.setNone(); break; - case NMSP_DRAWINGML|XML_buAutoNum: // CT_TextAutonumberBullet + case A_TOKEN( buAutoNum ): // CT_TextAutonumberBullet { AttributeList attribs( rXAttributes ); try { @@ -252,7 +249,7 @@ Reference< XFastContextHandler > TextParagraphPropertiesContext::createFastChild } break; } - case NMSP_DRAWINGML|XML_buChar: // CT_TextCharBullet + case A_TOKEN( buChar ): // CT_TextCharBullet try { mrBulletList.setBulletChar( rXAttributes->getValue( XML_char ) ); } @@ -261,17 +258,17 @@ Reference< XFastContextHandler > TextParagraphPropertiesContext::createFastChild OSL_TRACE("OOX: SAXException in XML_buChar"); } break; - case NMSP_DRAWINGML|XML_buBlip: // CT_TextBlipBullet + case A_TOKEN( buBlip ): // CT_TextBlipBullet { mxBlipProps.reset( new BlipFillProperties ); xRet.set( new BlipFillContext( *this, rXAttributes, *mxBlipProps ) ); } break; - case NMSP_DRAWINGML|XML_tabLst: // CT_TextTabStopList + case A_TOKEN( tabLst ): // CT_TextTabStopList xRet.set( new TextTabStopListContext( *this, maTabList ) ); break; - case NMSP_DRAWINGML|XML_defRPr: // CT_TextCharacterProperties + case A_TOKEN( defRPr ): // CT_TextCharacterProperties xRet.set( new TextCharacterPropertiesContext( *this, rXAttributes, mrTextParagraphProperties.getTextCharacterProperties() ) ); break; } diff --git a/oox/source/drawingml/textrun.cxx b/oox/source/drawingml/textrun.cxx index aa74d767a7ad..944e17691c56 100644 --- a/oox/source/drawingml/textrun.cxx +++ b/oox/source/drawingml/textrun.cxx @@ -35,7 +35,6 @@ #include "oox/helper/helper.hxx" #include "oox/helper/propertyset.hxx" #include "oox/core/xmlfilterbase.hxx" -#include "properties.hxx" using ::rtl::OUString; using namespace ::com::sun::star::uno; diff --git a/oox/source/drawingml/textspacingcontext.cxx b/oox/source/drawingml/textspacingcontext.cxx index 6bc6b79497d6..5eb5f3d77f82 100644 --- a/oox/source/drawingml/textspacingcontext.cxx +++ b/oox/source/drawingml/textspacingcontext.cxx @@ -27,10 +27,7 @@ #include "oox/drawingml/drawingmltypes.hxx" #include "oox/drawingml/textspacing.hxx" -#include "oox/core/namespaces.hxx" #include "textspacingcontext.hxx" -#include "tokens.hxx" - using namespace ::oox::core; using namespace ::com::sun::star::xml::sax; @@ -52,17 +49,17 @@ namespace oox { namespace drawingml { } Reference< XFastContextHandler > TextSpacingContext::createFastChildContext( ::sal_Int32 aElement, - const Reference< XFastAttributeList >& xAttribs ) + const Reference< XFastAttributeList >& xAttribs ) throw ( SAXException, RuntimeException ) { Reference< XFastContextHandler > xRet; switch( aElement ) { - case NMSP_DRAWINGML|XML_spcPct: + case A_TOKEN( spcPct ): maSpacing.nUnit = TextSpacing::PERCENT; maSpacing.nValue = GetPercent( xAttribs->getValue( XML_val ) ); break; - case NMSP_DRAWINGML|XML_spcPts: + case A_TOKEN( spcPts ): maSpacing.nUnit = TextSpacing::POINTS; maSpacing.nValue = GetTextSpacingPoint( xAttribs->getValue( XML_val ) ); break; diff --git a/oox/source/drawingml/texttabstoplistcontext.cxx b/oox/source/drawingml/texttabstoplistcontext.cxx index 1a8affa898bb..78248fd0b6f7 100644 --- a/oox/source/drawingml/texttabstoplistcontext.cxx +++ b/oox/source/drawingml/texttabstoplistcontext.cxx @@ -30,10 +30,8 @@ #include <rtl/ustring.hxx> -#include "oox/core/namespaces.hxx" #include "oox/drawingml/drawingmltypes.hxx" #include "texttabstoplistcontext.hxx" -#include "tokens.hxx" using ::rtl::OUString; using namespace ::oox::core; @@ -66,7 +64,7 @@ namespace oox { namespace drawingml { Reference< XFastContextHandler > xRet; switch( aElement ) { - case NMSP_DRAWINGML|XML_tab: + case A_TOKEN( tab ): { OUString sValue; TabStop aTabStop; diff --git a/oox/source/drawingml/theme.cxx b/oox/source/drawingml/theme.cxx index 59245201eb61..b37ccdbaf13c 100644 --- a/oox/source/drawingml/theme.cxx +++ b/oox/source/drawingml/theme.cxx @@ -26,7 +26,6 @@ ************************************************************************/ #include "oox/drawingml/theme.hxx" -#include "tokens.hxx" using ::rtl::OUString; diff --git a/oox/source/drawingml/themeelementscontext.cxx b/oox/source/drawingml/themeelementscontext.cxx index 7e8b5177498f..a27afdbc0ea3 100644 --- a/oox/source/drawingml/themeelementscontext.cxx +++ b/oox/source/drawingml/themeelementscontext.cxx @@ -32,9 +32,7 @@ #include "oox/drawingml/fillproperties.hxx" #include "oox/drawingml/fillpropertiesgroupcontext.hxx" #include "oox/drawingml/theme.hxx" -#include "oox/core/namespaces.hxx" #include "oox/helper/attributelist.hxx" -#include "tokens.hxx" using ::rtl::OUString; using namespace ::oox::core; @@ -67,12 +65,12 @@ Reference< XFastContextHandler > FillStyleListContext::createFastChildContext( s { switch( nElement ) { - case NMSP_DRAWINGML|XML_noFill: - case NMSP_DRAWINGML|XML_solidFill: - case NMSP_DRAWINGML|XML_gradFill: - case NMSP_DRAWINGML|XML_blipFill: - case NMSP_DRAWINGML|XML_pattFill: - case NMSP_DRAWINGML|XML_grpFill: + case A_TOKEN( noFill ): + case A_TOKEN( solidFill ): + case A_TOKEN( gradFill ): + case A_TOKEN( blipFill ): + case A_TOKEN( pattFill ): + case A_TOKEN( grpFill ): mrFillStyleList.push_back( FillPropertiesPtr( new FillProperties ) ); return FillPropertiesContext::createFillContext( *this, nElement, xAttribs, *mrFillStyleList.back() ); } @@ -102,7 +100,7 @@ Reference< XFastContextHandler > LineStyleListContext::createFastChildContext( s { switch( nElement ) { - case NMSP_DRAWINGML|XML_ln: + case A_TOKEN( ln ): mrLineStyleList.push_back( LinePropertiesPtr( new LineProperties ) ); return new LinePropertiesContext( *this, xAttribs, *mrLineStyleList.back() ); } @@ -131,7 +129,7 @@ Reference< XFastContextHandler > EffectStyleListContext::createFastChildContext( { switch( nElement ) { - case NMSP_DRAWINGML|XML_effectStyle: + case A_TOKEN( effectStyle ): mrEffectStyleList.push_back( EffectStyleList::value_type( new PropertyMap ) ); // TODO: import effect styles return 0; @@ -165,24 +163,24 @@ Reference< XFastContextHandler > FontSchemeContext::createFastChildContext( sal_ AttributeList aAttribs( rxAttribs ); switch( nElement ) { - case NMSP_DRAWINGML|XML_majorFont: + case A_TOKEN( majorFont ): mxCharProps.reset( new TextCharacterProperties ); mrFontScheme[ XML_major ] = mxCharProps; return this; - case NMSP_DRAWINGML|XML_minorFont: + case A_TOKEN( minorFont ): mxCharProps.reset( new TextCharacterProperties ); mrFontScheme[ XML_minor ] = mxCharProps; return this; - case NMSP_DRAWINGML|XML_latin: + case A_TOKEN( latin ): if( mxCharProps.get() ) mxCharProps->maLatinFont.setAttributes( aAttribs ); break; - case NMSP_DRAWINGML|XML_ea: + case A_TOKEN( ea ): if( mxCharProps.get() ) mxCharProps->maAsianFont.setAttributes( aAttribs ); break; - case NMSP_DRAWINGML|XML_cs: + case A_TOKEN( cs ): if( mxCharProps.get() ) mxCharProps->maComplexFont.setAttributes( aAttribs ); break; @@ -194,8 +192,8 @@ void FontSchemeContext::endFastElement( sal_Int32 nElement ) throw (SAXException { switch( nElement ) { - case NMSP_DRAWINGML|XML_majorFont: - case NMSP_DRAWINGML|XML_minorFont: + case A_TOKEN( majorFont ): + case A_TOKEN( minorFont ): mxCharProps.reset(); break; } @@ -215,22 +213,22 @@ Reference< XFastContextHandler > ThemeElementsContext::createFastChildContext( s Reference< XFastContextHandler > xRet; switch( nElement ) { - case NMSP_DRAWINGML|XML_clrScheme: // CT_ColorScheme + case A_TOKEN( clrScheme ): // CT_ColorScheme return new clrSchemeContext( *this, mrTheme.getClrScheme() ); - case NMSP_DRAWINGML|XML_fontScheme: // CT_FontScheme + case A_TOKEN( fontScheme ): // CT_FontScheme return new FontSchemeContext( *this, mrTheme.getFontScheme() ); - case NMSP_DRAWINGML|XML_fmtScheme: // CT_StyleMatrix + case A_TOKEN( fmtScheme ): // CT_StyleMatrix mrTheme.setStyleName( xAttribs->getOptionalValue( XML_name ) ); return this; - case NMSP_DRAWINGML|XML_fillStyleLst: // CT_FillStyleList + case A_TOKEN( fillStyleLst ): // CT_FillStyleList return new FillStyleListContext( *this, mrTheme.getFillStyleList() ); - case NMSP_DRAWINGML|XML_lnStyleLst: // CT_LineStyleList + case A_TOKEN( lnStyleLst ): // CT_LineStyleList return new LineStyleListContext( *this, mrTheme.getLineStyleList() ); - case NMSP_DRAWINGML|XML_effectStyleLst: // CT_EffectStyleList + case A_TOKEN( effectStyleLst ): // CT_EffectStyleList return new EffectStyleListContext( *this, mrTheme.getEffectStyleList() ); - case NMSP_DRAWINGML|XML_bgFillStyleLst: // CT_BackgroundFillStyleList + case A_TOKEN( bgFillStyleLst ): // CT_BackgroundFillStyleList return new FillStyleListContext( *this, mrTheme.getBgFillStyleList() ); } return 0; diff --git a/oox/source/drawingml/themefragmenthandler.cxx b/oox/source/drawingml/themefragmenthandler.cxx index 160db1881a25..3cae10e40b4f 100644 --- a/oox/source/drawingml/themefragmenthandler.cxx +++ b/oox/source/drawingml/themefragmenthandler.cxx @@ -56,23 +56,23 @@ ContextHandlerRef ThemeFragmentHandler::onCreateContext( sal_Int32 nElement, con case XML_ROOT_CONTEXT: switch( nElement ) { - case NMSP_DRAWINGML|XML_theme: + case A_TOKEN( theme ): return this; } break; - case NMSP_DRAWINGML|XML_theme: + case A_TOKEN( theme ): switch( nElement ) { - case NMSP_DRAWINGML|XML_themeElements: // CT_BaseStyles + case A_TOKEN( themeElements ): // CT_BaseStyles return new ThemeElementsContext( *this, mrTheme ); - case NMSP_DRAWINGML|XML_objectDefaults: // CT_ObjectStyleDefaults + case A_TOKEN( objectDefaults ): // CT_ObjectStyleDefaults return new objectDefaultContext( *this, mrTheme ); - case NMSP_DRAWINGML|XML_extraClrSchemeLst: // CT_ColorSchemeList + case A_TOKEN( extraClrSchemeLst ): // CT_ColorSchemeList return 0; - case NMSP_DRAWINGML|XML_custClrLst: // CustomColorList + case A_TOKEN( custClrLst ): // CustomColorList return 0; - case NMSP_DRAWINGML|XML_ext: // CT_OfficeArtExtension + case A_TOKEN( ext ): // CT_OfficeArtExtension return 0; } break; diff --git a/oox/source/drawingml/transform2dcontext.cxx b/oox/source/drawingml/transform2dcontext.cxx index 43748bd1089a..c686feed165c 100644 --- a/oox/source/drawingml/transform2dcontext.cxx +++ b/oox/source/drawingml/transform2dcontext.cxx @@ -26,7 +26,6 @@ ************************************************************************/ #include "oox/drawingml/transform2dcontext.hxx" -#include "oox/core/namespaces.hxx" #include "oox/helper/attributelist.hxx" #include "oox/drawingml/shape.hxx" @@ -58,15 +57,15 @@ Reference< XFastContextHandler > Transform2DContext::createFastChildContext( sal { switch( aElementToken ) { - case NMSP_DRAWINGML|XML_off: // horz/vert translation + case A_TOKEN( off ): // horz/vert translation mrShape.setPosition( Point( xAttribs->getOptionalValue( XML_x ).toInt32(), xAttribs->getOptionalValue( XML_y ).toInt32() ) ); break; - case NMSP_DRAWINGML|XML_ext: // horz/vert size + case A_TOKEN( ext ): // horz/vert size mrShape.setSize( Size( xAttribs->getOptionalValue( XML_cx ).toInt32(), xAttribs->getOptionalValue( XML_cy ).toInt32() ) ); break; /* todo: what to do? - case NMSP_DRAWINGML|XML_chOff: // horz/vert translation of children - case NMSP_DRAWINGML|XML_chExt: // horz/vert size of children + case A_TOKEN( chOff ): // horz/vert translation of children + case A_TOKEN( chExt ): // horz/vert size of children break; */ } |