From 64f870b426c96776b0367b7a97dd9b3d70aead06 Mon Sep 17 00:00:00 2001 From: Daniel Rentz Date: Thu, 5 Aug 2010 16:01:52 +0200 Subject: dr77: code cleanup --- oox/source/drawingml/chart/chartspacefragment.cxx | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'oox/source/drawingml/chart/chartspacefragment.cxx') diff --git a/oox/source/drawingml/chart/chartspacefragment.cxx b/oox/source/drawingml/chart/chartspacefragment.cxx index 75df94e95de7..f7aca001df5e 100644 --- a/oox/source/drawingml/chart/chartspacefragment.cxx +++ b/oox/source/drawingml/chart/chartspacefragment.cxx @@ -26,22 +26,25 @@ ************************************************************************/ #include "oox/drawingml/chart/chartspacefragment.hxx" + #include "oox/drawingml/shapepropertiescontext.hxx" #include "oox/drawingml/textbodycontext.hxx" #include "oox/drawingml/chart/chartspacemodel.hxx" #include "oox/drawingml/chart/plotareacontext.hxx" #include "oox/drawingml/chart/titlecontext.hxx" -using ::rtl::OUString; -using ::oox::core::ContextHandlerRef; -using ::oox::core::XmlFilterBase; - namespace oox { namespace drawingml { namespace chart { // ============================================================================ +using ::oox::core::ContextHandlerRef; +using ::oox::core::XmlFilterBase; +using ::rtl::OUString; + +// ============================================================================ + ChartSpaceFragment::ChartSpaceFragment( XmlFilterBase& rFilter, const OUString& rFragmentPath, ChartSpaceModel& rModel ) : FragmentBase< ChartSpaceModel >( rFilter, rFragmentPath, rModel ) { @@ -124,4 +127,3 @@ ContextHandlerRef ChartSpaceFragment::onCreateContext( sal_Int32 nElement, const } // namespace chart } // namespace drawingml } // namespace oox - -- cgit v1.2.3 From 6cafb68322fa85a54a6fa1ca47239af459f519ce Mon Sep 17 00:00:00 2001 From: "Daniel Rentz [dr]" Date: Mon, 8 Nov 2010 13:47:01 +0100 Subject: dr77: optimizations in generation of XML tokens, XML namespaces, property names; code cleanup --- oox/inc/oox/core/contexthandler.hxx | 4 +- oox/inc/oox/core/contexthandler2.hxx | 6 +- oox/inc/oox/core/fastparser.hxx | 93 ++++++++ oox/inc/oox/core/fasttokenhandler.hxx | 13 +- oox/inc/oox/core/relations.hxx | 11 +- oox/inc/oox/drawingml/chart/modelbase.hxx | 1 - oox/inc/oox/drawingml/clrscheme.hxx | 1 - oox/inc/oox/drawingml/customshapeproperties.hxx | 14 +- oox/inc/oox/helper/attributelist.hxx | 3 +- oox/inc/oox/helper/propertymap.hxx | 7 +- oox/inc/oox/helper/propertyset.hxx | 1 + oox/inc/oox/ole/axbinaryreader.hxx | 1 - oox/inc/oox/ole/axcontrolfragment.hxx | 1 - oox/inc/oox/ole/olehelper.hxx | 1 - oox/inc/oox/ole/oleobjecthelper.hxx | 3 +- oox/inc/oox/ole/olestorage.hxx | 2 +- oox/inc/oox/ole/vbainputstream.hxx | 1 - oox/inc/oox/ole/vbamodule.hxx | 2 +- oox/inc/oox/ppt/pptimport.hxx | 1 - oox/inc/oox/ppt/slidepersist.hxx | 1 - oox/inc/oox/token/namespacemap.hxx | 49 ++++ oox/inc/oox/token/propertylist.hxx | 50 ---- oox/inc/oox/token/propertynames.hxx | 49 ++++ oox/inc/oox/xls/autofilterbuffer.hxx | 6 +- oox/prj/d.lst | 7 +- oox/source/core/contexthandler2.cxx | 2 +- oox/source/core/facreg.cxx | 102 -------- oox/source/core/fastparser.cxx | 136 +++++++++++ oox/source/core/fasttokenhandler.cxx | 49 +++- oox/source/core/filterbase.cxx | 1 - oox/source/core/filterdetect.cxx | 53 ++--- oox/source/core/makefile.mk | 3 +- oox/source/core/relations.cxx | 4 +- oox/source/core/relationshandler.cxx | 6 +- oox/source/core/services.cxx | 102 ++++++++ oox/source/core/xmlfilterbase.cxx | 95 +++----- oox/source/docprop/docprophandler.cxx | 138 ++++++----- oox/source/docprop/docprophandler.hxx | 10 + oox/source/docprop/ooxmldocpropimport.cxx | 261 +++++++++------------ oox/source/docprop/ooxmldocpropimport.hxx | 40 ++-- oox/source/drawingml/chart/axisconverter.cxx | 1 - .../drawingml/chart/chartdrawingfragment.cxx | 4 +- oox/source/drawingml/chart/chartspaceconverter.cxx | 1 - oox/source/drawingml/chart/chartspacefragment.cxx | 4 +- oox/source/drawingml/chart/converterbase.cxx | 1 - oox/source/drawingml/chart/datasourceconverter.cxx | 1 - oox/source/drawingml/chart/objectformatter.cxx | 2 - oox/source/drawingml/chart/plotareaconverter.cxx | 1 - oox/source/drawingml/chart/seriesconverter.cxx | 1 - oox/source/drawingml/chart/titleconverter.cxx | 1 - oox/source/drawingml/chart/typegroupconverter.cxx | 1 - oox/source/drawingml/clrscheme.cxx | 2 +- oox/source/drawingml/clrschemecontext.cxx | 4 +- oox/source/drawingml/color.cxx | 8 +- oox/source/drawingml/colorchoicecontext.cxx | 1 - oox/source/drawingml/connectorshapecontext.cxx | 4 +- oox/source/drawingml/customshapegeometry.cxx | 57 +++-- oox/source/drawingml/customshapeproperties.cxx | 3 - oox/source/drawingml/diagram/datamodelcontext.cxx | 43 ++-- oox/source/drawingml/diagram/diagram.cxx | 2 - .../drawingml/diagram/diagramdefinitioncontext.cxx | 18 +- .../drawingml/diagram/diagramfragmenthandler.cxx | 10 +- oox/source/drawingml/diagram/layoutnodecontext.cxx | 41 ++-- oox/source/drawingml/drawingmltypes.cxx | 2 +- oox/source/drawingml/embeddedwavaudiofile.cxx | 5 +- oox/source/drawingml/fillproperties.cxx | 3 +- .../drawingml/fillpropertiesgroupcontext.cxx | 19 +- oox/source/drawingml/graphicshapecontext.cxx | 21 +- oox/source/drawingml/guidcontext.cxx | 3 - oox/source/drawingml/hyperlinkcontext.cxx | 15 +- oox/source/drawingml/lineproperties.cxx | 4 +- oox/source/drawingml/linepropertiescontext.cxx | 4 +- oox/source/drawingml/objectdefaultcontext.cxx | 8 +- oox/source/drawingml/shape.cxx | 3 - oox/source/drawingml/shapecontext.cxx | 4 +- oox/source/drawingml/shapegroupcontext.cxx | 4 +- oox/source/drawingml/shapepropertiescontext.cxx | 20 +- oox/source/drawingml/shapestylecontext.cxx | 12 +- oox/source/drawingml/spdefcontext.cxx | 10 +- .../table/tablebackgroundstylecontext.cxx | 11 +- oox/source/drawingml/table/tablecell.cxx | 3 - oox/source/drawingml/table/tablecellcontext.cxx | 21 +- oox/source/drawingml/table/tablecontext.cxx | 13 +- .../drawingml/table/tablepartstylecontext.cxx | 7 +- oox/source/drawingml/table/tableproperties.cxx | 2 - oox/source/drawingml/table/tablerow.cxx | 2 - oox/source/drawingml/table/tablerowcontext.cxx | 6 +- .../drawingml/table/tablestylecellstylecontext.cxx | 33 ++- oox/source/drawingml/table/tablestylecontext.cxx | 33 ++- .../table/tablestylelistfragmenthandler.cxx | 4 +- oox/source/drawingml/table/tablestylepart.cxx | 2 - .../drawingml/table/tablestyletextstylecontext.cxx | 17 +- oox/source/drawingml/textbodycontext.cxx | 28 +-- oox/source/drawingml/textbodyproperties.cxx | 3 +- oox/source/drawingml/textbodypropertiescontext.cxx | 19 +- oox/source/drawingml/textcharacterproperties.cxx | 3 +- .../drawingml/textcharacterpropertiescontext.cxx | 52 ++-- oox/source/drawingml/textfieldcontext.cxx | 10 +- oox/source/drawingml/textfont.cxx | 1 - oox/source/drawingml/textliststylecontext.cxx | 26 +- oox/source/drawingml/textparagraphproperties.cxx | 3 - .../drawingml/textparagraphpropertiescontext.cxx | 35 ++- oox/source/drawingml/textrun.cxx | 1 - oox/source/drawingml/textspacingcontext.cxx | 9 +- oox/source/drawingml/texttabstoplistcontext.cxx | 4 +- oox/source/drawingml/theme.cxx | 1 - oox/source/drawingml/themeelementscontext.cxx | 46 ++-- oox/source/drawingml/themefragmenthandler.cxx | 14 +- oox/source/drawingml/transform2dcontext.cxx | 9 +- oox/source/export/drawingml.cxx | 1 - oox/source/export/shapes.cxx | 1 - oox/source/helper/graphichelper.cxx | 2 +- oox/source/helper/propertymap.cxx | 18 +- oox/source/ole/axbinaryreader.cxx | 8 +- oox/source/ole/axcontrol.cxx | 2 - oox/source/ole/axcontrolfragment.cxx | 18 +- oox/source/ole/olehelper.cxx | 12 +- oox/source/ole/oleobjecthelper.cxx | 33 ++- oox/source/ole/olestorage.cxx | 37 +-- oox/source/ole/vbacontrol.cxx | 2 - oox/source/ole/vbahelper.cxx | 5 +- oox/source/ole/vbainputstream.cxx | 2 + oox/source/ole/vbaproject.cxx | 2 - oox/source/ppt/animationspersist.cxx | 4 - oox/source/ppt/animationtypes.cxx | 2 - oox/source/ppt/animvariantcontext.cxx | 12 +- oox/source/ppt/backgroundproperties.cxx | 4 +- oox/source/ppt/buildlistcontext.cxx | 15 +- oox/source/ppt/commonbehaviorcontext.cxx | 18 +- oox/source/ppt/commontimenodecontext.cxx | 20 +- oox/source/ppt/conditioncontext.cxx | 12 +- oox/source/ppt/customshowlistcontext.cxx | 9 +- oox/source/ppt/headerfootercontext.cxx | 2 - oox/source/ppt/layoutfragmenthandler.cxx | 6 +- oox/source/ppt/pptimport.cxx | 4 +- oox/source/ppt/pptshape.cxx | 2 - oox/source/ppt/pptshapecontext.cxx | 15 +- oox/source/ppt/pptshapegroupcontext.cxx | 22 +- oox/source/ppt/pptshapepropertiescontext.cxx | 5 +- oox/source/ppt/presentationfragmenthandler.cxx | 38 ++- oox/source/ppt/slidefragmenthandler.cxx | 45 ++-- oox/source/ppt/slidemastertextstylescontext.cxx | 10 +- oox/source/ppt/slidepersist.cxx | 2 - oox/source/ppt/slidetimingcontext.cxx | 8 +- oox/source/ppt/slidetransition.cxx | 45 ++-- oox/source/ppt/slidetransitioncontext.cxx | 49 ++-- oox/source/ppt/soundactioncontext.cxx | 11 +- oox/source/ppt/timeanimvaluecontext.cxx | 10 +- oox/source/ppt/timenodelistcontext.cxx | 122 +++++----- oox/source/ppt/timetargetelementcontext.cxx | 28 +-- oox/source/shape/FastTokenHandlerService.cxx | 118 ---------- oox/source/shape/FastTokenHandlerService.hxx | 73 ------ oox/source/shape/ShapeContextHandler.cxx | 7 +- oox/source/shape/makefile.mk | 3 +- oox/source/token/gennamespaces.pl | 66 ------ oox/source/token/genproperties.pl | 46 ---- oox/source/token/gentoken.pl | 61 ----- oox/source/token/makefile.mk | 44 ++-- oox/source/token/namespacemap.cxx | 49 ++++ oox/source/token/namespaces.hxx.head | 36 +++ oox/source/token/namespaces.hxx.tail | 35 +++ oox/source/token/namespaces.pl | 79 +++++++ oox/source/token/namespaces.txt | 101 ++++---- oox/source/token/parsexsd.pl | 27 +++ oox/source/token/properties.hxx.head | 36 +++ oox/source/token/properties.hxx.tail | 6 + oox/source/token/properties.pl | 67 ++++++ oox/source/token/propertylist.cxx | 56 ----- oox/source/token/propertynames.cxx | 51 ++++ oox/source/token/tokenmap.cxx | 34 +-- oox/source/token/tokens.hxx.head | 36 +++ oox/source/token/tokens.hxx.tail | 8 + oox/source/token/tokens.pl | 80 +++++++ oox/source/vml/vmldrawing.cxx | 1 - oox/source/vml/vmldrawingfragment.cxx | 4 +- oox/source/vml/vmlformatting.cxx | 1 - oox/source/vml/vmlshape.cxx | 1 - oox/source/vml/vmltextbox.cxx | 1 - oox/source/xls/autofilterbuffer.cxx | 3 - oox/source/xls/chartsheetfragment.cxx | 4 +- oox/source/xls/commentsfragment.cxx | 4 +- oox/source/xls/condformatbuffer.cxx | 1 - oox/source/xls/connectionsbuffer.cxx | 2 - oox/source/xls/connectionsfragment.cxx | 4 +- oox/source/xls/defnamesbuffer.cxx | 1 - oox/source/xls/drawingfragment.cxx | 1 - oox/source/xls/excelfilter.cxx | 2 +- oox/source/xls/excelvbaproject.cxx | 1 - oox/source/xls/externallinkbuffer.cxx | 5 +- oox/source/xls/externallinkfragment.cxx | 4 +- oox/source/xls/formulabase.cxx | 1 - oox/source/xls/formulaparser.cxx | 1 - oox/source/xls/numberformatsbuffer.cxx | 1 - oox/source/xls/pagesettings.cxx | 1 - oox/source/xls/pivotcachebuffer.cxx | 1 - oox/source/xls/pivotcachefragment.cxx | 3 +- oox/source/xls/pivottablebuffer.cxx | 1 - oox/source/xls/pivottablefragment.cxx | 4 +- oox/source/xls/querytablebuffer.cxx | 1 - oox/source/xls/querytablefragment.cxx | 4 +- oox/source/xls/scenariobuffer.cxx | 1 - oox/source/xls/sharedformulabuffer.cxx | 1 - oox/source/xls/sharedstringsfragment.cxx | 4 +- oox/source/xls/stylesbuffer.cxx | 1 - oox/source/xls/stylesfragment.cxx | 4 +- oox/source/xls/tablebuffer.cxx | 1 - oox/source/xls/tablefragment.cxx | 4 +- oox/source/xls/themebuffer.cxx | 1 - oox/source/xls/unitconverter.cxx | 1 - oox/source/xls/viewsettings.cxx | 1 - oox/source/xls/workbookfragment.cxx | 25 +- oox/source/xls/workbookhelper.cxx | 1 - oox/source/xls/workbooksettings.cxx | 1 - oox/source/xls/worksheetbuffer.cxx | 1 - oox/source/xls/worksheetfragment.cxx | 13 +- oox/source/xls/worksheethelper.cxx | 2 - oox/source/xls/worksheetsettings.cxx | 1 - writerfilter/source/ooxml/model.xml | 26 +- writerfilter/source/ooxml/namespaceids.xsl | 2 +- .../source/resourcemodel/namespace_preprocess.pl | 25 +- 220 files changed, 2075 insertions(+), 1977 deletions(-) create mode 100755 oox/inc/oox/core/fastparser.hxx mode change 100644 => 100755 oox/inc/oox/core/relations.hxx mode change 100755 => 100644 oox/inc/oox/ole/axbinaryreader.hxx mode change 100755 => 100644 oox/inc/oox/ole/olestorage.hxx mode change 100755 => 100644 oox/inc/oox/ole/vbamodule.hxx create mode 100755 oox/inc/oox/token/namespacemap.hxx delete mode 100644 oox/inc/oox/token/propertylist.hxx create mode 100644 oox/inc/oox/token/propertynames.hxx delete mode 100644 oox/source/core/facreg.cxx create mode 100755 oox/source/core/fastparser.cxx create mode 100644 oox/source/core/services.cxx mode change 100755 => 100644 oox/source/ole/axbinaryreader.cxx mode change 100755 => 100644 oox/source/ole/olestorage.cxx delete mode 100644 oox/source/shape/FastTokenHandlerService.cxx delete mode 100644 oox/source/shape/FastTokenHandlerService.hxx delete mode 100644 oox/source/token/gennamespaces.pl delete mode 100644 oox/source/token/genproperties.pl delete mode 100644 oox/source/token/gentoken.pl create mode 100755 oox/source/token/namespacemap.cxx create mode 100755 oox/source/token/namespaces.hxx.head create mode 100755 oox/source/token/namespaces.hxx.tail create mode 100644 oox/source/token/namespaces.pl create mode 100755 oox/source/token/properties.hxx.head create mode 100755 oox/source/token/properties.hxx.tail create mode 100644 oox/source/token/properties.pl delete mode 100644 oox/source/token/propertylist.cxx create mode 100644 oox/source/token/propertynames.cxx create mode 100755 oox/source/token/tokens.hxx.head create mode 100755 oox/source/token/tokens.hxx.tail create mode 100644 oox/source/token/tokens.pl (limited to 'oox/source/drawingml/chart/chartspacefragment.cxx') diff --git a/oox/inc/oox/core/contexthandler.hxx b/oox/inc/oox/core/contexthandler.hxx index c5c198c34c23..10de170f9e40 100644 --- a/oox/inc/oox/core/contexthandler.hxx +++ b/oox/inc/oox/core/contexthandler.hxx @@ -28,10 +28,12 @@ #ifndef OOX_CORE_CONTEXTHANDLER_HXX #define OOX_CORE_CONTEXTHANDLER_HXX -#include #include +#include #include #include +#include "oox/token/namespaces.hxx" +#include "oox/token/tokens.hxx" namespace com { namespace sun { namespace star { namespace xml { namespace sax { class XLocator; } } diff --git a/oox/inc/oox/core/contexthandler2.hxx b/oox/inc/oox/core/contexthandler2.hxx index 59da648883b0..314a0886b866 100644 --- a/oox/inc/oox/core/contexthandler2.hxx +++ b/oox/inc/oox/core/contexthandler2.hxx @@ -30,17 +30,19 @@ #include #include -#include "tokens.hxx" #include "oox/helper/attributelist.hxx" #include "oox/helper/recordinputstream.hxx" #include "oox/core/contexthandler.hxx" -#include "oox/core/namespaces.hxx" namespace oox { namespace core { // ============================================================================ +const sal_Int32 XML_ROOT_CONTEXT = SAL_MAX_INT32; + +// ============================================================================ + struct ElementInfo; /** Helper class that provides a context stack. diff --git a/oox/inc/oox/core/fastparser.hxx b/oox/inc/oox/core/fastparser.hxx new file mode 100755 index 000000000000..967c42474dcc --- /dev/null +++ b/oox/inc/oox/core/fastparser.hxx @@ -0,0 +1,93 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef OOX_CORE_FASTPARSER_HXX +#define OOX_CORE_FASTPARSER_HXX + +#include +#include + +namespace oox { + struct NamespaceMap; + class StorageBase; +} + +namespace oox { +namespace core { + +// ============================================================================ + +/** Wrapper for a fast SAX parser that works on automatically generated OOXML + token and namespace identifiers. + */ +class FastParser +{ +public: + explicit FastParser( + const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext ) + throw( ::com::sun::star::uno::RuntimeException ); + + virtual ~FastParser(); + + /** Registers an OOXML namespace at the parser. */ + void registerNamespace( sal_Int32 nNamespaceId ) + throw( ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException ); + + /** Sets the passed document handler that will receive the SAX parser events. */ + void setDocumentHandler( + const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastDocumentHandler >& rxDocHandler ) + throw( ::com::sun::star::uno::RuntimeException ); + + /** Parses the passed SAX input source. + @param bCloseStream True = closes the stream in the input source after parsing. */ + void parseStream( const ::com::sun::star::xml::sax::InputSource& rInputSource, bool bCloseStream = false ) + throw( ::com::sun::star::xml::sax::SAXException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException ); + + /** Parses the passed input stream. + @param bCloseStream True = closes the passed stream after parsing. */ + void parseStream( + const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& rxInStream, + const ::rtl::OUString& rStreamName, bool bCloseStream = false ) + throw( ::com::sun::star::xml::sax::SAXException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException ); + + /** Parses a stream from the passed storage with the specified name. + @param bCloseStream True = closes the stream after parsing. */ + void parseStream( StorageBase& rStorage, const ::rtl::OUString& rStreamName, bool bCloseStream = false ) + throw( ::com::sun::star::xml::sax::SAXException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException ); + +private: + ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastParser > + mxParser; + const NamespaceMap& mrNamespaceMap; +}; + +// ============================================================================ + +} // namespace core +} // namespace oox + +#endif diff --git a/oox/inc/oox/core/fasttokenhandler.hxx b/oox/inc/oox/core/fasttokenhandler.hxx index 01422aebc3ea..a6c73de9842b 100644 --- a/oox/inc/oox/core/fasttokenhandler.hxx +++ b/oox/inc/oox/core/fasttokenhandler.hxx @@ -28,8 +28,9 @@ #ifndef OOX_CORE_FASTTOKENHANDLER_HXX #define OOX_CORE_FASTTOKENHANDLER_HXX +#include #include -#include +#include namespace oox { class TokenMap; } @@ -38,15 +39,23 @@ namespace core { // ============================================================================ +typedef ::cppu::WeakImplHelper2< ::com::sun::star::lang::XServiceInfo, ::com::sun::star::xml::sax::XFastTokenHandler > FastTokenHandlerBase; + /** Wrapper implementing the com.sun.star.xml.sax.XFastTokenHandler API interface that provides access to the tokens generated from the internal token name list. */ -class FastTokenHandler : public ::cppu::WeakImplHelper1< ::com::sun::star::xml::sax::XFastTokenHandler > +class FastTokenHandler : public FastTokenHandlerBase { public: explicit FastTokenHandler(); virtual ~FastTokenHandler(); + // XServiceInfo + virtual ::rtl::OUString SAL_CALL getImplementationName() throw (::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& rServiceName ) throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() throw (::com::sun::star::uno::RuntimeException); + + // XFastTokenHandler virtual sal_Int32 SAL_CALL getToken( const ::rtl::OUString& rIdentifier ) throw (::com::sun::star::uno::RuntimeException); virtual ::rtl::OUString SAL_CALL getIdentifier( sal_Int32 nToken ) throw (::com::sun::star::uno::RuntimeException); virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getUTF8Identifier( sal_Int32 nToken ) throw (::com::sun::star::uno::RuntimeException); diff --git a/oox/inc/oox/core/relations.hxx b/oox/inc/oox/core/relations.hxx old mode 100644 new mode 100755 index 6abb48c361a0..285c4ed947e4 --- a/oox/inc/oox/core/relations.hxx +++ b/oox/inc/oox/core/relations.hxx @@ -37,14 +37,19 @@ namespace core { // ============================================================================ -/** Expands to an OUString containing an officeDocument relation type created +/** Expands to an OUString containing an 'officeDocument' relation type created from the passed literal(!) ASCII(!) character array. */ -#define CREATE_OFFICEDOC_RELATIONSTYPE( ascii ) \ +#define CREATE_OFFICEDOC_RELATION_TYPE( ascii ) \ CREATE_OUSTRING( "http://schemas.openxmlformats.org/officeDocument/2006/relationships/" ascii ) +/** Expands to an OUString containing a 'package' relation type created from + the passed literal(!) ASCII(!) character array. */ +#define CREATE_PACKAGE_RELATION_TYPE( ascii ) \ + CREATE_OUSTRING( "http://schemas.openxmlformats.org/package/2006/relationships/" ascii ) + /** Expands to an OUString containing an MS Office specific relation type created from the passed literal(!) ASCII(!) character array. */ -#define CREATE_MSOFFICE_RELATIONSTYPE( ascii ) \ +#define CREATE_MSOFFICE_RELATION_TYPE( ascii ) \ CREATE_OUSTRING( "http://schemas.microsoft.com/office/2006/relationships/" ascii ) // ============================================================================ diff --git a/oox/inc/oox/drawingml/chart/modelbase.hxx b/oox/inc/oox/drawingml/chart/modelbase.hxx index 065c45f3c2df..f29374bd6c69 100644 --- a/oox/inc/oox/drawingml/chart/modelbase.hxx +++ b/oox/inc/oox/drawingml/chart/modelbase.hxx @@ -30,7 +30,6 @@ #include "oox/helper/containerhelper.hxx" #include "oox/helper/helper.hxx" -#include "tokens.hxx" namespace oox { class AttributeList; } diff --git a/oox/inc/oox/drawingml/clrscheme.hxx b/oox/inc/oox/drawingml/clrscheme.hxx index 22eab1a892a1..5f13f54b705d 100644 --- a/oox/inc/oox/drawingml/clrscheme.hxx +++ b/oox/inc/oox/drawingml/clrscheme.hxx @@ -31,7 +31,6 @@ #include #include #include -#include "oox/core/namespaces.hxx" #include "oox/drawingml/color.hxx" namespace oox { namespace drawingml { diff --git a/oox/inc/oox/drawingml/customshapeproperties.hxx b/oox/inc/oox/drawingml/customshapeproperties.hxx index 282e0c6009b5..985507d22265 100644 --- a/oox/inc/oox/drawingml/customshapeproperties.hxx +++ b/oox/inc/oox/drawingml/customshapeproperties.hxx @@ -28,13 +28,7 @@ #ifndef OOX_DRAWINGML_CUSTOMSHAPEPROPERTIES_HXX #define OOX_DRAWINGML_CUSTOMSHAPEPROPERTIES_HXX -#include "oox/helper/propertymap.hxx" -#include "oox/drawingml/color.hxx" -#include "oox/core/xmlfilterbase.hxx" -#include #include -#include "oox/helper/helper.hxx" -#include "tokens.hxx" #include #include #include @@ -45,11 +39,15 @@ #include #include #include -#ifndef __com_sun_star_beans_PropertyValues_hpp__ #include -#endif #include #include +#include +#include "oox/core/xmlfilterbase.hxx" +#include "oox/drawingml/color.hxx" +#include "oox/helper/helper.hxx" +#include "oox/helper/propertymap.hxx" +#include "oox/token/tokens.hxx" namespace oox { namespace drawingml { diff --git a/oox/inc/oox/helper/attributelist.hxx b/oox/inc/oox/helper/attributelist.hxx index f2919e889994..87e21e553c2d 100644 --- a/oox/inc/oox/helper/attributelist.hxx +++ b/oox/inc/oox/helper/attributelist.hxx @@ -31,7 +31,8 @@ #include #include #include "oox/helper/helper.hxx" -#include "tokens.hxx" +#include "oox/token/namespaces.hxx" +#include "oox/token/tokens.hxx" namespace oox { diff --git a/oox/inc/oox/helper/propertymap.hxx b/oox/inc/oox/helper/propertymap.hxx index 0bc16b3443ff..9e7196381002 100644 --- a/oox/inc/oox/helper/propertymap.hxx +++ b/oox/inc/oox/helper/propertymap.hxx @@ -30,9 +30,10 @@ #include #include -#include #include #include +#include +#include "oox/token/properties.hxx" namespace com { namespace sun { namespace star { namespace beans { struct PropertyValue; @@ -41,7 +42,7 @@ namespace com { namespace sun { namespace star { namespace beans { namespace oox { -struct PropertyList; +struct PropertyNameVector; // ============================================================================ @@ -90,7 +91,7 @@ public: makePropertySet() const; private: - const PropertyList* mpPropNames; + const PropertyNameVector* mpPropNames; }; // ============================================================================ diff --git a/oox/inc/oox/helper/propertyset.hxx b/oox/inc/oox/helper/propertyset.hxx index bb8307ad39b1..9a49bb48cf92 100644 --- a/oox/inc/oox/helper/propertyset.hxx +++ b/oox/inc/oox/helper/propertyset.hxx @@ -30,6 +30,7 @@ #include #include +#include "oox/token/properties.hxx" namespace oox { diff --git a/oox/inc/oox/ole/axbinaryreader.hxx b/oox/inc/oox/ole/axbinaryreader.hxx old mode 100755 new mode 100644 index 9b3cfae723b8..36346402a0e3 --- a/oox/inc/oox/ole/axbinaryreader.hxx +++ b/oox/inc/oox/ole/axbinaryreader.hxx @@ -296,4 +296,3 @@ private: } // namespace oox #endif - diff --git a/oox/inc/oox/ole/axcontrolfragment.hxx b/oox/inc/oox/ole/axcontrolfragment.hxx index 3c9aed61bd3e..a5273070ba8f 100644 --- a/oox/inc/oox/ole/axcontrolfragment.hxx +++ b/oox/inc/oox/ole/axcontrolfragment.hxx @@ -78,4 +78,3 @@ private: } // namespace oox #endif - diff --git a/oox/inc/oox/ole/olehelper.hxx b/oox/inc/oox/ole/olehelper.hxx index f19efa835f4e..98085e66cfd8 100644 --- a/oox/inc/oox/ole/olehelper.hxx +++ b/oox/inc/oox/ole/olehelper.hxx @@ -144,4 +144,3 @@ private: } // namespace oox #endif - diff --git a/oox/inc/oox/ole/oleobjecthelper.hxx b/oox/inc/oox/ole/oleobjecthelper.hxx index ef3570c4fa20..c3a58213abc9 100644 --- a/oox/inc/oox/ole/oleobjecthelper.hxx +++ b/oox/inc/oox/ole/oleobjecthelper.hxx @@ -32,8 +32,8 @@ namespace com { namespace sun { namespace star { namespace awt { struct Size; } - namespace lang { class XMultiServiceFactory; } namespace document { class XEmbeddedObjectResolver; } + namespace lang { class XMultiServiceFactory; } } } } namespace oox { class PropertyMap; } @@ -83,4 +83,3 @@ private: } // namespace oox #endif - diff --git a/oox/inc/oox/ole/olestorage.hxx b/oox/inc/oox/ole/olestorage.hxx old mode 100755 new mode 100644 index a84fadfadc92..eabcfd4d0f87 --- a/oox/inc/oox/ole/olestorage.hxx +++ b/oox/inc/oox/ole/olestorage.hxx @@ -31,8 +31,8 @@ #include "oox/helper/storagebase.hxx" namespace com { namespace sun { namespace star { - namespace lang { class XMultiServiceFactory; } namespace container { class XNameContainer; } + namespace lang { class XMultiServiceFactory; } } } } namespace oox { diff --git a/oox/inc/oox/ole/vbainputstream.hxx b/oox/inc/oox/ole/vbainputstream.hxx index 4de0a91a622f..858698518968 100644 --- a/oox/inc/oox/ole/vbainputstream.hxx +++ b/oox/inc/oox/ole/vbainputstream.hxx @@ -69,4 +69,3 @@ private: } // namespace oox #endif - diff --git a/oox/inc/oox/ole/vbamodule.hxx b/oox/inc/oox/ole/vbamodule.hxx old mode 100755 new mode 100644 index 377c7abc335a..52b2261e55b5 --- a/oox/inc/oox/ole/vbamodule.hxx +++ b/oox/inc/oox/ole/vbamodule.hxx @@ -28,8 +28,8 @@ #ifndef OOX_OLE_VBAMODULE_HXX #define OOX_OLE_VBAMODULE_HXX -#include #include +#include namespace com { namespace sun { namespace star { namespace container { class XNameAccess; } diff --git a/oox/inc/oox/ppt/pptimport.hxx b/oox/inc/oox/ppt/pptimport.hxx index d3a4b1bbd7b3..158584eeb3f5 100644 --- a/oox/inc/oox/ppt/pptimport.hxx +++ b/oox/inc/oox/ppt/pptimport.hxx @@ -34,7 +34,6 @@ #include #include "oox/ppt/presentationfragmenthandler.hxx" #include "oox/ppt/slidepersist.hxx" -#include "tokens.hxx" #include #include diff --git a/oox/inc/oox/ppt/slidepersist.hxx b/oox/inc/oox/ppt/slidepersist.hxx index e8c5d21448ce..29f857c8340e 100644 --- a/oox/inc/oox/ppt/slidepersist.hxx +++ b/oox/inc/oox/ppt/slidepersist.hxx @@ -28,7 +28,6 @@ #ifndef OOX_POWERPOINT_SLIDEPERSIST_HXX #define OOX_POWERPOINT_SLIDEPERSIST_HXX -#include "tokens.hxx" #include #include "oox/drawingml/shape.hxx" #include "oox/drawingml/theme.hxx" diff --git a/oox/inc/oox/token/namespacemap.hxx b/oox/inc/oox/token/namespacemap.hxx new file mode 100755 index 000000000000..e4daa18f6b56 --- /dev/null +++ b/oox/inc/oox/token/namespacemap.hxx @@ -0,0 +1,49 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef OOX_TOKEN_NAMESPACEMAP_HXX +#define OOX_TOKEN_NAMESPACEMAP_HXX + +#include +#include +#include + +namespace oox { + +// ============================================================================ + +/** A map that contains all XML namespace URLs used in the filters. */ +struct NamespaceMap : public ::std::map< sal_Int32, ::rtl::OUString > { NamespaceMap(); }; + +/** Thread-save singleton of a map of all supported XML namespace URLs. */ +struct StaticNamespaceMap : public ::rtl::Static< NamespaceMap, StaticNamespaceMap > {}; + +// ============================================================================ + +} // namespace oox + +#endif diff --git a/oox/inc/oox/token/propertylist.hxx b/oox/inc/oox/token/propertylist.hxx deleted file mode 100644 index 5f75b13e10c4..000000000000 --- a/oox/inc/oox/token/propertylist.hxx +++ /dev/null @@ -1,50 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#ifndef OOX_TOKEN_PROPERTYLIST_HXX -#define OOX_TOKEN_PROPERTYLIST_HXX - -#include -#include - -namespace oox { - -// ============================================================================ - -/** A vector that contains all predefined property names used in the filters. */ -struct PropertyList : public ::std::vector< ::rtl::OUString > -{ - explicit PropertyList(); - ~PropertyList(); -}; - -// ============================================================================ - -} // namespace oox - -#endif - diff --git a/oox/inc/oox/token/propertynames.hxx b/oox/inc/oox/token/propertynames.hxx new file mode 100644 index 000000000000..5f94e74c2b96 --- /dev/null +++ b/oox/inc/oox/token/propertynames.hxx @@ -0,0 +1,49 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef OOX_TOKEN_PROPERTYNAMES_HXX +#define OOX_TOKEN_PROPERTYNAMES_HXX + +#include +#include +#include + +namespace oox { + +// ============================================================================ + +/** A vector that contains all predefined property names used in the filters. */ +struct PropertyNameVector : public ::std::vector< ::rtl::OUString > { PropertyNameVector(); }; + +/** Thread-save singleton of a vector of all supported property names. */ +struct StaticPropertyNameVector : public ::rtl::Static< PropertyNameVector, StaticPropertyNameVector > {}; + +// ============================================================================ + +} // namespace oox + +#endif diff --git a/oox/inc/oox/xls/autofilterbuffer.hxx b/oox/inc/oox/xls/autofilterbuffer.hxx index 105afa606f47..31aeca252414 100755 --- a/oox/inc/oox/xls/autofilterbuffer.hxx +++ b/oox/inc/oox/xls/autofilterbuffer.hxx @@ -133,10 +133,10 @@ private: /** A filter criterion for a custom filter. */ struct FilterCriterionModel { - ::com::sun::star::uno::Any maValue; /// The comparison operator. + ::com::sun::star::uno::Any maValue; /// Comparison operand. sal_Int32 mnOperator; /// Comparison operator. - sal_uInt8 mnDataType; /// Operator data type (BIFF only). - sal_uInt8 mnStrLen; /// Length of string operator (BIFF5-BIFF8 only). + sal_uInt8 mnDataType; /// Operand data type (BIFF only). + sal_uInt8 mnStrLen; /// Length of string operand (BIFF5-BIFF8 only). explicit FilterCriterionModel(); diff --git a/oox/prj/d.lst b/oox/prj/d.lst index 482a270926a3..41cadacbecd5 100644 --- a/oox/prj/d.lst +++ b/oox/prj/d.lst @@ -1,10 +1,11 @@ mkdir: %_DEST%\inc%_EXT%\oox -mkdir: %_DEST%\inc%_EXT%\oox\helper mkdir: %_DEST%\inc%_EXT%\oox\core mkdir: %_DEST%\inc%_EXT%\oox\drawingml mkdir: %_DEST%\inc%_EXT%\oox\drawingml\chart mkdir: %_DEST%\inc%_EXT%\oox\drawingml\table +mkdir: %_DEST%\inc%_EXT%\oox\helper mkdir: %_DEST%\inc%_EXT%\oox\ole +mkdir: %_DEST%\inc%_EXT%\oox\token mkdir: %_DEST%\inc%_EXT%\oox\vml mkdir: %_DEST%\inc%_EXT%\oox\xls @@ -17,10 +18,10 @@ mkdir: %_DEST%\inc%_EXT%\oox\xls ..\%__SRC%\lib\i*.lib %_DEST%\lib%_EXT%\i*.lib ..\%__SRC%\lib\*.dylib %_DEST%\lib%_EXT%\*.dylib -..\%__SRC%\inc\tokens.hxx %_DEST%\inc%_EXT%\oox\core\tokens.hxx +..\%__SRC%\inc\oox\token\tokens.hxx %_DEST%\inc%_EXT%\oox\token\tokens.hxx +..\%__SRC%\misc\namespaces.txt %_DEST%\inc%_EXT%\oox\namespaces.txt ..\source\token\tokens.txt %_DEST%\inc%_EXT%\oox\token.txt -..\source\token\namespaces.txt %_DEST%\inc%_EXT%\oox\namespaces.txt ..\inc\oox\dllapi.h %_DEST%\inc%_EXT%\oox\dllapi.h ..\inc\oox\helper\binarystreambase.hxx %_DEST%\inc%_EXT%\oox\helper\binarystreambase.hxx ..\inc\oox\helper\helper.hxx %_DEST%\inc%_EXT%\oox\helper\helper.hxx diff --git a/oox/source/core/contexthandler2.cxx b/oox/source/core/contexthandler2.cxx index 0cb7017372da..8ba5dd65cd9b 100644 --- a/oox/source/core/contexthandler2.cxx +++ b/oox/source/core/contexthandler2.cxx @@ -102,7 +102,7 @@ Reference< XFastContextHandler > ContextHandler2Helper::implCreateChildContext( void ContextHandler2Helper::implStartElement( sal_Int32 nElement, const Reference< XFastAttributeList >& rxAttribs ) { AttributeList aAttribs( rxAttribs ); - pushElementInfo( nElement ).mbTrimSpaces = aAttribs.getToken( NMSP_XML | XML_space, XML_TOKEN_INVALID ) != XML_preserve; + pushElementInfo( nElement ).mbTrimSpaces = aAttribs.getToken( XML_TOKEN( space ), XML_TOKEN_INVALID ) != XML_preserve; onStartElement( aAttribs ); } diff --git a/oox/source/core/facreg.cxx b/oox/source/core/facreg.cxx deleted file mode 100644 index 3ae1be13defa..000000000000 --- a/oox/source/core/facreg.cxx +++ /dev/null @@ -1,102 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#include - -using ::rtl::OUString; -using namespace ::com::sun::star::uno; - -// Declare static functions providing service information ===================== - -#define DECLARE_FUNCTIONS( className ) \ -extern OUString SAL_CALL className##_getImplementationName() throw(); \ -extern Sequence< OUString > SAL_CALL className##_getSupportedServiceNames() throw(); \ -extern Reference< XInterface > SAL_CALL className##_createInstance( \ - const Reference< XComponentContext >& rxContext ) throw (Exception) - -namespace oox { - namespace core { DECLARE_FUNCTIONS( FilterDetect ); } - namespace docprop { DECLARE_FUNCTIONS( OOXMLDocPropImportImpl ); } - namespace ole { DECLARE_FUNCTIONS( WordVbaProjectFilter ); } - namespace ppt { DECLARE_FUNCTIONS( PowerPointImport ); } - namespace shape { DECLARE_FUNCTIONS( FastTokenHandlerService ); } - namespace shape { DECLARE_FUNCTIONS( ShapeContextHandler ); } - namespace xls { DECLARE_FUNCTIONS( BiffDetector ); } - namespace xls { DECLARE_FUNCTIONS( ExcelFilter ); } - namespace xls { DECLARE_FUNCTIONS( ExcelBiffFilter ); } - namespace xls { DECLARE_FUNCTIONS( ExcelVbaProjectFilter ); } - namespace xls { DECLARE_FUNCTIONS( OOXMLFormulaParser ); } -} - -#undef DECLARE_FUNCTIONS - -// ============================================================================ - -namespace { - -#define IMPLEMENTATION_ENTRY( className ) \ - { &className##_createInstance, &className##_getImplementationName, &className##_getSupportedServiceNames, ::cppu::createSingleComponentFactory, 0, 0 } - -static ::cppu::ImplementationEntry const spServices[] = -{ - IMPLEMENTATION_ENTRY( ::oox::core::FilterDetect ), - IMPLEMENTATION_ENTRY( ::oox::docprop::OOXMLDocPropImportImpl ), - IMPLEMENTATION_ENTRY( ::oox::ole::WordVbaProjectFilter ), - IMPLEMENTATION_ENTRY( ::oox::ppt::PowerPointImport ), - IMPLEMENTATION_ENTRY( ::oox::shape::FastTokenHandlerService ), - IMPLEMENTATION_ENTRY( ::oox::shape::ShapeContextHandler ), - IMPLEMENTATION_ENTRY( ::oox::xls::BiffDetector ), - IMPLEMENTATION_ENTRY( ::oox::xls::ExcelFilter ), - IMPLEMENTATION_ENTRY( ::oox::xls::ExcelBiffFilter ), - IMPLEMENTATION_ENTRY( ::oox::xls::ExcelVbaProjectFilter ), - IMPLEMENTATION_ENTRY( ::oox::xls::OOXMLFormulaParser ), - { 0, 0, 0, 0, 0, 0 } -}; - -#undef IMPLEMENTATION_ENTRY - -} // namespace - -// ---------------------------------------------------------------------------- - -extern "C" SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment( - const sal_Char** ppEnvironmentTypeName, uno_Environment** /*ppEnvironment*/ ) -{ - *ppEnvironmentTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; -} - -extern "C" SAL_DLLPUBLIC_EXPORT void* SAL_CALL component_getFactory( const char* pImplName, void* pServiceManager, void* pRegistryKey ) -{ - return ::cppu::component_getFactoryHelper( pImplName, pServiceManager, pRegistryKey, spServices ); -} - -extern "C" SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo( void* pServiceManager, void* pRegistryKey ) -{ - return ::cppu::component_writeInfoHelper( pServiceManager, pRegistryKey, spServices ); -} - -// ============================================================================ diff --git a/oox/source/core/fastparser.cxx b/oox/source/core/fastparser.cxx new file mode 100755 index 000000000000..eaf8c428b92c --- /dev/null +++ b/oox/source/core/fastparser.cxx @@ -0,0 +1,136 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include "oox/core/fastparser.hxx" + +#include "oox/core/fasttokenhandler.hxx" +#include "oox/helper/containerhelper.hxx" +#include "oox/helper/helper.hxx" +#include "oox/helper/storagebase.hxx" +#include "oox/token/namespacemap.hxx" + +namespace oox { +namespace core { + +// ============================================================================ + +using namespace ::com::sun::star::io; +using namespace ::com::sun::star::lang; +using namespace ::com::sun::star::uno; +using namespace ::com::sun::star::xml::sax; + +using ::rtl::OUString; + +// ============================================================================ + +namespace { + +class InputStreamCloseGuard +{ +public: + explicit InputStreamCloseGuard( const Reference< XInputStream >& rxInStream, bool bCloseStream ); + ~InputStreamCloseGuard(); +private: + Reference< XInputStream > mxInStream; + bool mbCloseStream; +}; + +InputStreamCloseGuard::InputStreamCloseGuard( const Reference< XInputStream >& rxInStream, bool bCloseStream ) : + mxInStream( rxInStream ), + mbCloseStream( bCloseStream ) +{ +} + +InputStreamCloseGuard::~InputStreamCloseGuard() +{ + if( mxInStream.is() && mbCloseStream ) try { mxInStream->closeInput(); } catch( Exception& ) {} +} + +} // namespace + +// ============================================================================ + +FastParser::FastParser( const Reference< XComponentContext >& rxContext ) throw( RuntimeException ) : + mrNamespaceMap( StaticNamespaceMap::get() ) +{ + // create a fast parser instance + Reference< XMultiComponentFactory > xFactory( rxContext->getServiceManager(), UNO_SET_THROW ); + mxParser.set( xFactory->createInstanceWithContext( CREATE_OUSTRING( "com.sun.star.xml.sax.FastParser" ), rxContext ), UNO_QUERY_THROW ); + + // create the fast token handler based on the OOXML token list + mxParser->setTokenHandler( new FastTokenHandler ); +} + +FastParser::~FastParser() +{ +} + +void FastParser::registerNamespace( sal_Int32 nNamespaceId ) throw( IllegalArgumentException, RuntimeException ) +{ + if( !mxParser.is() ) + throw RuntimeException(); + + const OUString* pNamespaceUrl = ContainerHelper::getMapElement( mrNamespaceMap, nNamespaceId ); + if( !pNamespaceUrl ) + throw IllegalArgumentException(); + + mxParser->registerNamespace( *pNamespaceUrl, nNamespaceId ); +} + +void FastParser::setDocumentHandler( const Reference< XFastDocumentHandler >& rxDocHandler ) throw( RuntimeException ) +{ + if( !mxParser.is() ) + throw RuntimeException(); + mxParser->setFastDocumentHandler( rxDocHandler ); +} + +void FastParser::parseStream( const InputSource& rInputSource, bool bCloseStream ) throw( SAXException, IOException, RuntimeException ) +{ + // guard closing the input stream also when exceptions are thrown + InputStreamCloseGuard aGuard( rInputSource.aInputStream, bCloseStream ); + if( !mxParser.is() ) + throw RuntimeException(); + mxParser->parseStream( rInputSource ); +} + +void FastParser::parseStream( const Reference< XInputStream >& rxInStream, const OUString& rStreamName, bool bCloseStream ) throw( SAXException, IOException, RuntimeException ) +{ + InputSource aInputSource; + aInputSource.sSystemId = rStreamName; + aInputSource.aInputStream = rxInStream; + parseStream( aInputSource, bCloseStream ); +} + +void FastParser::parseStream( StorageBase& rStorage, const OUString& rStreamName, bool bCloseStream ) throw( SAXException, IOException, RuntimeException ) +{ + parseStream( rStorage.openInputStream( rStreamName ), rStreamName, bCloseStream ); +} + +// ============================================================================ + +} // namespace core +} // namespace oox diff --git a/oox/source/core/fasttokenhandler.cxx b/oox/source/core/fasttokenhandler.cxx index 547570e29439..e09687cc5470 100644 --- a/oox/source/core/fasttokenhandler.cxx +++ b/oox/source/core/fasttokenhandler.cxx @@ -27,7 +27,8 @@ #include "oox/core/fasttokenhandler.hxx" -#include +#include +#include "oox/helper/helper.hxx" #include "oox/token/tokenmap.hxx" namespace oox { @@ -37,21 +38,26 @@ namespace core { using namespace ::com::sun::star::uno; -using ::osl::Mutex; -using ::osl::MutexGuard; using ::rtl::OUString; // ============================================================================ -namespace { +OUString SAL_CALL FastTokenHandler_getImplementationName() +{ + return CREATE_OUSTRING( "com.sun.star.comp.oox.core.FastTokenHandler" ); +} -Mutex& lclGetTokenMutex() +Sequence< OUString > SAL_CALL FastTokenHandler_getSupportedServiceNames() { - static Mutex aMutex; - return aMutex; + Sequence< OUString > aServiceNames( 1 ); + aServiceNames[ 0 ] = CREATE_OUSTRING( "com.sun.star.xml.sax.FastTokenHandler" ); + return aServiceNames; } -} // namespace +Reference< XInterface > SAL_CALL FastTokenHandler_createInstance( const Reference< XComponentContext >& /*rxContext*/ ) throw (Exception) +{ + return static_cast< ::cppu::OWeakObject* >( new FastTokenHandler ); +} // ============================================================================ @@ -64,27 +70,46 @@ FastTokenHandler::~FastTokenHandler() { } +// XServiceInfo + +OUString SAL_CALL FastTokenHandler::getImplementationName() throw (RuntimeException) +{ + return FastTokenHandler_getImplementationName(); +} + +sal_Bool SAL_CALL FastTokenHandler::supportsService( const OUString& rServiceName ) throw (RuntimeException) +{ + Sequence< OUString > aServiceNames = FastTokenHandler_getSupportedServiceNames(); + for( sal_Int32 nIndex = 0, nLength = aServiceNames.getLength(); nIndex < nLength; ++nIndex ) + if( aServiceNames[ nIndex ] == rServiceName ) + return sal_True; + return sal_False; +} + +Sequence< OUString > SAL_CALL FastTokenHandler::getSupportedServiceNames() throw (RuntimeException) +{ + return FastTokenHandler_getSupportedServiceNames(); +} + +// XFastTokenHandler + sal_Int32 FastTokenHandler::getToken( const OUString& rIdentifier ) throw( RuntimeException ) { - MutexGuard aGuard( lclGetTokenMutex() ); return mrTokenMap.getTokenFromUnicode( rIdentifier ); } OUString FastTokenHandler::getIdentifier( sal_Int32 nToken ) throw( RuntimeException ) { - MutexGuard aGuard( lclGetTokenMutex() ); return mrTokenMap.getUnicodeTokenName( nToken ); } Sequence< sal_Int8 > FastTokenHandler::getUTF8Identifier( sal_Int32 nToken ) throw( RuntimeException ) { - MutexGuard aGuard( lclGetTokenMutex() ); return mrTokenMap.getUtf8TokenName( nToken ); } sal_Int32 FastTokenHandler::getTokenFromUTF8( const Sequence< sal_Int8 >& rIdentifier ) throw( RuntimeException ) { - MutexGuard aGuard( lclGetTokenMutex() ); return mrTokenMap.getTokenFromUtf8( rIdentifier ); } diff --git a/oox/source/core/filterbase.cxx b/oox/source/core/filterbase.cxx index f17fb3f5014d..9eaf5fb29a14 100644 --- a/oox/source/core/filterbase.cxx +++ b/oox/source/core/filterbase.cxx @@ -42,7 +42,6 @@ #include "oox/helper/modelobjecthelper.hxx" #include "oox/ole/oleobjecthelper.hxx" #include "oox/ole/vbaproject.hxx" -#include "tokens.hxx" namespace oox { namespace core { diff --git a/oox/source/core/filterdetect.cxx b/oox/source/core/filterdetect.cxx index fb17c69155ef..4f8bd8ef2463 100644 --- a/oox/source/core/filterdetect.cxx +++ b/oox/source/core/filterdetect.cxx @@ -28,13 +28,11 @@ #include "oox/core/filterdetect.hxx" #include -#include #include #include #include #include -#include "oox/core/fasttokenhandler.hxx" -#include "oox/core/namespaces.hxx" +#include "oox/core/fastparser.hxx" #include "oox/helper/attributelist.hxx" #include "oox/helper/binaryinputstream.hxx" #include "oox/helper/binaryoutputstream.hxx" @@ -91,22 +89,22 @@ void SAL_CALL FilterDetectDocHandler::startFastElement( switch ( nElement ) { // cases for _rels/.rels - case NMSP_PACKAGE_RELATIONSHIPS|XML_Relationships: + case PR_TOKEN( Relationships ): break; - case NMSP_PACKAGE_RELATIONSHIPS|XML_Relationship: - if( !maContextStack.empty() && (maContextStack.back() == (NMSP_PACKAGE_RELATIONSHIPS|XML_Relationships)) ) + case PR_TOKEN( Relationship ): + if( !maContextStack.empty() && (maContextStack.back() == PR_TOKEN( Relationships )) ) parseRelationship( aAttribs ); break; // cases for [Content_Types].xml - case NMSP_CONTENT_TYPES|XML_Types: + case PC_TOKEN( Types ): break; - case NMSP_CONTENT_TYPES|XML_Default: - if( !maContextStack.empty() && (maContextStack.back() == (NMSP_CONTENT_TYPES|XML_Types)) ) + case PC_TOKEN( Default ): + if( !maContextStack.empty() && (maContextStack.back() == PC_TOKEN( Types )) ) parseContentTypesDefault( aAttribs ); break; - case NMSP_CONTENT_TYPES|XML_Override: - if( !maContextStack.empty() && (maContextStack.back() == (NMSP_CONTENT_TYPES|XML_Types)) ) + case PC_TOKEN( Override ): + if( !maContextStack.empty() && (maContextStack.back() == PC_TOKEN( Types )) ) parseContentTypesOverride( aAttribs ); break; } @@ -604,30 +602,21 @@ OUString SAL_CALL FilterDetect::detect( Sequence< PropertyValue >& rMediaDescSeq descriptor. */ Reference< XInputStream > xInStrm( extractUnencryptedPackage( aMediaDesc ), UNO_SET_THROW ); - // try to detect the file type, must be a ZIP package + // stream must be a ZIP package ZipStorage aZipStorage( xFactory, xInStrm ); if( aZipStorage.isStorage() ) { - Reference< XFastParser > xParser( xFactory->createInstance( - CREATE_OUSTRING( "com.sun.star.xml.sax.FastParser" ) ), UNO_QUERY_THROW ); - - xParser->setFastDocumentHandler( new FilterDetectDocHandler( aFilterName ) ); - xParser->setTokenHandler( new FastTokenHandler ); - - xParser->registerNamespace( CREATE_OUSTRING( "http://schemas.openxmlformats.org/package/2006/relationships" ), NMSP_PACKAGE_RELATIONSHIPS ); - xParser->registerNamespace( CREATE_OUSTRING( "http://schemas.openxmlformats.org/officeDocument/2006/relationships" ), NMSP_RELATIONSHIPS ); - xParser->registerNamespace( CREATE_OUSTRING( "http://schemas.openxmlformats.org/package/2006/content-types" ), NMSP_CONTENT_TYPES ); - - // Parse _rels/.rels to get the target path. - InputSource aParserInput; - aParserInput.sSystemId = CREATE_OUSTRING( "_rels/.rels" ); - aParserInput.aInputStream = aZipStorage.openInputStream( aParserInput.sSystemId ); - xParser->parseStream( aParserInput ); - - // Parse [Content_Types].xml to determine the content type of the part at the target path. - aParserInput.sSystemId = CREATE_OUSTRING( "[Content_Types].xml" ); - aParserInput.aInputStream = aZipStorage.openInputStream( aParserInput.sSystemId ); - xParser->parseStream( aParserInput ); + // create the fast parser, register the XML namespaces, set document handler + FastParser aParser( mxContext ); + aParser.registerNamespace( NMSP_packageRel ); + aParser.registerNamespace( NMSP_officeRel ); + aParser.registerNamespace( NMSP_packageContentTypes ); + aParser.setDocumentHandler( new FilterDetectDocHandler( aFilterName ) ); + + /* Parse '_rels/.rels' to get the target path and '[Content_Types].xml' + to determine the content type of the part at the target path. */ + aParser.parseStream( aZipStorage, CREATE_OUSTRING( "_rels/.rels" ) ); + aParser.parseStream( aZipStorage, CREATE_OUSTRING( "[Content_Types].xml" ) ); } } catch( Exception& ) diff --git a/oox/source/core/makefile.mk b/oox/source/core/makefile.mk index 2e29cf01543a..2b58b95777df 100644 --- a/oox/source/core/makefile.mk +++ b/oox/source/core/makefile.mk @@ -49,7 +49,7 @@ SLOFILES = \ $(SLO)$/binaryfilterbase.obj \ $(SLO)$/contexthandler.obj \ $(SLO)$/contexthandler2.obj \ - $(SLO)$/facreg.obj \ + $(SLO)$/fastparser.obj \ $(SLO)$/fasttokenhandler.obj \ $(SLO)$/filterbase.obj \ $(SLO)$/filterdetect.obj \ @@ -58,6 +58,7 @@ SLOFILES = \ $(SLO)$/recordparser.obj \ $(SLO)$/relations.obj \ $(SLO)$/relationshandler.obj \ + $(SLO)$/services.obj \ $(SLO)$/xmlfilterbase.obj # --- Targets ------------------------------------------------------- diff --git a/oox/source/core/relations.cxx b/oox/source/core/relations.cxx index db3420906f30..f6cade391a0f 100644 --- a/oox/source/core/relations.cxx +++ b/oox/source/core/relations.cxx @@ -71,7 +71,7 @@ const Relation* Relations::getRelationFromRelId( const OUString& rId ) const const Relation* Relations::getRelationFromFirstType( const OUString& rType ) const { for( const_iterator aIt = begin(), aEnd = end(); aIt != aEnd; ++aIt ) - if( aIt->second.maType == rType ) + if( aIt->second.maType.equalsIgnoreAsciiCase( rType ) ) return &aIt->second; return 0; } @@ -80,7 +80,7 @@ RelationsRef Relations::getRelationsFromType( const OUString& rType ) const { RelationsRef xRelations( new Relations( maFragmentPath ) ); for( const_iterator aIt = begin(), aEnd = end(); aIt != aEnd; ++aIt ) - if( aIt->second.maType == rType ) + if( aIt->second.maType.equalsIgnoreAsciiCase( rType ) ) (*xRelations)[ aIt->first ] = aIt->second; return xRelations; } diff --git a/oox/source/core/relationshandler.cxx b/oox/source/core/relationshandler.cxx index 5ff41b6613f7..6812a4acada6 100644 --- a/oox/source/core/relationshandler.cxx +++ b/oox/source/core/relationshandler.cxx @@ -28,9 +28,7 @@ #include "oox/core/relationshandler.hxx" #include -#include "oox/core/namespaces.hxx" #include "oox/helper/attributelist.hxx" -#include "tokens.hxx" namespace oox { namespace core { @@ -80,7 +78,7 @@ Reference< XFastContextHandler > RelationsFragment::createFastChildContext( AttributeList aAttribs( rxAttribs ); switch( nElement ) { - case NMSP_PACKAGE_RELATIONSHIPS|XML_Relationship: + case PR_TOKEN( Relationship ): { Relation aRelation; aRelation.maId = aAttribs.getString( XML_Id, OUString() ); @@ -99,7 +97,7 @@ Reference< XFastContextHandler > RelationsFragment::createFastChildContext( } } break; - case NMSP_PACKAGE_RELATIONSHIPS|XML_Relationships: + case PR_TOKEN( Relationships ): xRet = getFastContextHandler(); break; } diff --git a/oox/source/core/services.cxx b/oox/source/core/services.cxx new file mode 100644 index 000000000000..29b31e4672ab --- /dev/null +++ b/oox/source/core/services.cxx @@ -0,0 +1,102 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include + +using ::rtl::OUString; +using namespace ::com::sun::star::uno; + +// Declare static functions providing service information ===================== + +#define DECLARE_FUNCTIONS( className ) \ +extern OUString SAL_CALL className##_getImplementationName() throw(); \ +extern Sequence< OUString > SAL_CALL className##_getSupportedServiceNames() throw(); \ +extern Reference< XInterface > SAL_CALL className##_createInstance( \ + const Reference< XComponentContext >& rxContext ) throw (Exception) + +namespace oox { + namespace core { DECLARE_FUNCTIONS( FastTokenHandler ); } + namespace core { DECLARE_FUNCTIONS( FilterDetect ); } + namespace docprop { DECLARE_FUNCTIONS( DocumentPropertiesImport ); } + namespace ole { DECLARE_FUNCTIONS( WordVbaProjectFilter ); } + namespace ppt { DECLARE_FUNCTIONS( PowerPointImport ); } + namespace shape { DECLARE_FUNCTIONS( ShapeContextHandler ); } + namespace xls { DECLARE_FUNCTIONS( BiffDetector ); } + namespace xls { DECLARE_FUNCTIONS( ExcelFilter ); } + namespace xls { DECLARE_FUNCTIONS( ExcelBiffFilter ); } + namespace xls { DECLARE_FUNCTIONS( ExcelVbaProjectFilter ); } + namespace xls { DECLARE_FUNCTIONS( OOXMLFormulaParser ); } +} + +#undef DECLARE_FUNCTIONS + +// ============================================================================ + +namespace { + +#define IMPLEMENTATION_ENTRY( className ) \ + { &className##_createInstance, &className##_getImplementationName, &className##_getSupportedServiceNames, ::cppu::createSingleComponentFactory, 0, 0 } + +static ::cppu::ImplementationEntry const spServices[] = +{ + IMPLEMENTATION_ENTRY( ::oox::core::FastTokenHandler ), + IMPLEMENTATION_ENTRY( ::oox::core::FilterDetect ), + IMPLEMENTATION_ENTRY( ::oox::docprop::DocumentPropertiesImport ), + IMPLEMENTATION_ENTRY( ::oox::ole::WordVbaProjectFilter ), + IMPLEMENTATION_ENTRY( ::oox::ppt::PowerPointImport ), + IMPLEMENTATION_ENTRY( ::oox::shape::ShapeContextHandler ), + IMPLEMENTATION_ENTRY( ::oox::xls::BiffDetector ), + IMPLEMENTATION_ENTRY( ::oox::xls::ExcelFilter ), + IMPLEMENTATION_ENTRY( ::oox::xls::ExcelBiffFilter ), + IMPLEMENTATION_ENTRY( ::oox::xls::ExcelVbaProjectFilter ), + IMPLEMENTATION_ENTRY( ::oox::xls::OOXMLFormulaParser ), + { 0, 0, 0, 0, 0, 0 } +}; + +#undef IMPLEMENTATION_ENTRY + +} // namespace + +// ---------------------------------------------------------------------------- + +extern "C" SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment( + const sal_Char** ppEnvironmentTypeName, uno_Environment** /*ppEnvironment*/ ) +{ + *ppEnvironmentTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; +} + +extern "C" SAL_DLLPUBLIC_EXPORT void* SAL_CALL component_getFactory( const char* pImplName, void* pServiceManager, void* pRegistryKey ) +{ + return ::cppu::component_getFactoryHelper( pImplName, pServiceManager, pRegistryKey, spServices ); +} + +extern "C" SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo( void* pServiceManager, void* pRegistryKey ) +{ + return ::cppu::component_writeInfoHelper( pServiceManager, pRegistryKey, spServices ); +} + +// ============================================================================ diff --git a/oox/source/core/xmlfilterbase.cxx b/oox/source/core/xmlfilterbase.cxx index 8cb35e6d090f..f678bb17b1b2 100644 --- a/oox/source/core/xmlfilterbase.cxx +++ b/oox/source/core/xmlfilterbase.cxx @@ -37,17 +37,14 @@ #include #include #include -#include "oox/core/fasttokenhandler.hxx" +#include "oox/core/fastparser.hxx" #include "oox/core/filterdetect.hxx" #include "oox/core/fragmenthandler.hxx" -#include "oox/core/namespaces.hxx" #include "oox/core/recordparser.hxx" #include "oox/core/relationshandler.hxx" #include "oox/helper/containerhelper.hxx" #include "oox/helper/propertyset.hxx" #include "oox/helper/zipstorage.hxx" -#include "properties.hxx" -#include "tokens.hxx" namespace oox { namespace core { @@ -89,63 +86,54 @@ struct XmlFilterBaseImpl { typedef RefMap< OUString, Relations > RelationsMap; - Reference< XFastParser > mxFastParser; - OUString maBinSuffix; - OUString maVmlSuffix; + FastParser maFastParser; + const OUString maBinSuffix; + const OUString maVmlSuffix; RelationsMap maRelationsMap; TextFieldStack maTextFieldStack; - explicit XmlFilterBaseImpl(); + + explicit XmlFilterBaseImpl( const Reference< XComponentContext >& rxContext ) throw( RuntimeException ); }; // ---------------------------------------------------------------------------- -XmlFilterBaseImpl::XmlFilterBaseImpl() : +XmlFilterBaseImpl::XmlFilterBaseImpl( const Reference< XComponentContext >& rxContext ) : + maFastParser( rxContext ), maBinSuffix( CREATE_OUSTRING( ".bin" ) ), maVmlSuffix( CREATE_OUSTRING( ".vml" ) ) { + // register XML namespaces + maFastParser.registerNamespace( NMSP_xml ); + maFastParser.registerNamespace( NMSP_packageRel ); + maFastParser.registerNamespace( NMSP_officeRel ); + + maFastParser.registerNamespace( NMSP_dml ); + maFastParser.registerNamespace( NMSP_dmlDiagram ); + maFastParser.registerNamespace( NMSP_dmlChart ); + maFastParser.registerNamespace( NMSP_dmlChartDr ); + maFastParser.registerNamespace( NMSP_dmlSpreadDr ); + + maFastParser.registerNamespace( NMSP_vml ); + maFastParser.registerNamespace( NMSP_vmlOffice ); + maFastParser.registerNamespace( NMSP_vmlWord ); + maFastParser.registerNamespace( NMSP_vmlExcel ); + maFastParser.registerNamespace( NMSP_vmlPowerpoint ); + + maFastParser.registerNamespace( NMSP_xls ); + maFastParser.registerNamespace( NMSP_ppt ); + + maFastParser.registerNamespace( NMSP_ax ); + maFastParser.registerNamespace( NMSP_xm ); } // ============================================================================ XmlFilterBase::XmlFilterBase( const Reference< XComponentContext >& rxContext ) throw( RuntimeException ) : FilterBase( rxContext ), - mxImpl( new XmlFilterBaseImpl ), + mxImpl( new XmlFilterBaseImpl( rxContext ) ), mnRelId( 1 ), mnMaxDocId( 0 ) { - try - { - // create the fast parser - mxImpl->mxFastParser.set( getServiceFactory()->createInstance( CREATE_OUSTRING( "com.sun.star.xml.sax.FastParser" ) ), UNO_QUERY_THROW ); - mxImpl->mxFastParser->setTokenHandler( new FastTokenHandler ); - - // register XML namespaces - mxImpl->mxFastParser->registerNamespace( CREATE_OUSTRING( "http://www.w3.org/XML/1998/namespace" ), NMSP_XML ); - mxImpl->mxFastParser->registerNamespace( CREATE_OUSTRING( "http://schemas.openxmlformats.org/package/2006/relationships" ), NMSP_PACKAGE_RELATIONSHIPS ); - mxImpl->mxFastParser->registerNamespace( CREATE_OUSTRING( "http://schemas.openxmlformats.org/officeDocument/2006/relationships" ), NMSP_RELATIONSHIPS ); - - mxImpl->mxFastParser->registerNamespace( CREATE_OUSTRING( "http://schemas.openxmlformats.org/drawingml/2006/main" ), NMSP_DRAWINGML ); - mxImpl->mxFastParser->registerNamespace( CREATE_OUSTRING( "http://schemas.openxmlformats.org/drawingml/2006/diagram" ), NMSP_DIAGRAM ); - mxImpl->mxFastParser->registerNamespace( CREATE_OUSTRING( "http://schemas.openxmlformats.org/drawingml/2006/chart" ), NMSP_CHART ); - mxImpl->mxFastParser->registerNamespace( CREATE_OUSTRING( "http://schemas.openxmlformats.org/drawingml/2006/chartDrawing" ), NMSP_CDR ); - - mxImpl->mxFastParser->registerNamespace( CREATE_OUSTRING( "urn:schemas-microsoft-com:vml" ), NMSP_VML ); - mxImpl->mxFastParser->registerNamespace( CREATE_OUSTRING( "urn:schemas-microsoft-com:office:office" ), NMSP_OFFICE ); - mxImpl->mxFastParser->registerNamespace( CREATE_OUSTRING( "urn:schemas-microsoft-com:office:word" ), NMSP_VML_DOC ); - mxImpl->mxFastParser->registerNamespace( CREATE_OUSTRING( "urn:schemas-microsoft-com:office:excel" ), NMSP_VML_XLS ); - mxImpl->mxFastParser->registerNamespace( CREATE_OUSTRING( "urn:schemas-microsoft-com:office:powerpoint" ), NMSP_VML_PPT ); - mxImpl->mxFastParser->registerNamespace( CREATE_OUSTRING( "http://schemas.microsoft.com/office/2006/activeX" ), NMSP_AX ); - - mxImpl->mxFastParser->registerNamespace( CREATE_OUSTRING( "http://schemas.openxmlformats.org/spreadsheetml/2006/main"), NMSP_XLS ); - mxImpl->mxFastParser->registerNamespace( CREATE_OUSTRING( "http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing" ), NMSP_XDR ); - mxImpl->mxFastParser->registerNamespace( CREATE_OUSTRING( "http://schemas.microsoft.com/office/excel/2006/main" ), NMSP_XM ); - - mxImpl->mxFastParser->registerNamespace( CREATE_OUSTRING( "http://schemas.openxmlformats.org/presentationml/2006/main"), NMSP_PPT ); - } - catch( Exception& ) - { - throw RuntimeException(); - } } XmlFilterBase::~XmlFilterBase() @@ -202,25 +190,20 @@ bool XmlFilterBase::importFragment( const ::rtl::Reference< FragmentHandler >& r if( !xDocHandler.is() ) return false; - // check that the fast parser exists - if( !mxImpl->mxFastParser.is() ) - return false; - // try to import XML stream try { - // try to open the fragment stream (this may fail - do not assert) - Reference< XInputStream > xInStrm( rxHandler->openFragmentStream(), UNO_SET_THROW ); + /* Try to open the fragment stream (may fail, do not throw/assert). + Using the virtual function openFragmentStream() allows a document + handler to create specialized input streams, e.g. VML streams that + have to preprocess the raw input data. */ + Reference< XInputStream > xInStrm = rxHandler->openFragmentStream(); - // create the input source and parse the stream - InputSource aSource; - aSource.aInputStream = xInStrm; - aSource.sSystemId = aFragmentPath; // own try/catch block for showing parser failure assertion with fragment path - try + if( xInStrm.is() ) try { - mxImpl->mxFastParser->setFastDocumentHandler( xDocHandler ); - mxImpl->mxFastParser->parseStream( aSource ); + mxImpl->maFastParser.setDocumentHandler( xDocHandler ); + mxImpl->maFastParser.parseStream( xInStrm, aFragmentPath ); return true; } catch( Exception& ) diff --git a/oox/source/docprop/docprophandler.cxx b/oox/source/docprop/docprophandler.cxx index 1830a8c5d5f9..560fcf141c19 100644 --- a/oox/source/docprop/docprophandler.cxx +++ b/oox/source/docprop/docprophandler.cxx @@ -33,9 +33,7 @@ #include -#include "tokens.hxx" #include "oox/helper/attributelist.hxx" -#include "oox/core/namespaces.hxx" using namespace ::com::sun::star; @@ -226,19 +224,19 @@ void OOXMLDocPropHandler::UpdateDocStatistic( const ::rtl::OUString& aChars ) switch( m_nBlock ) { - case XML_Characters|NMSP_EXTPR: + case EXTPR_TOKEN( Characters ): aName = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "CharacterCount" ) ); break; - case XML_Pages|NMSP_EXTPR: + case EXTPR_TOKEN( Pages ): aName = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PageCount" ) ); break; - case XML_Words|NMSP_EXTPR: + case EXTPR_TOKEN( Words ): aName = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "WordCount" ) ); break; - case XML_Paragraphs|NMSP_EXTPR: + case EXTPR_TOKEN( Paragraphs ): aName = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ParagraphCount" ) ); break; @@ -299,9 +297,9 @@ void SAL_CALL OOXMLDocPropHandler::startFastElement( ::sal_Int32 nElement, const { if ( !m_nInBlock && !m_nState ) { - if ( nElement == ( XML_coreProperties|NMSP_COREPR ) - || nElement == ( XML_Properties|NMSP_EXTPR ) - || nElement == ( XML_Properties|NMSP_CUSTPR ) ) + if ( nElement == COREPR_TOKEN( coreProperties ) + || nElement == EXTPR_TOKEN( Properties ) + || nElement == CUSTPR_TOKEN( Properties ) ) { m_nState = nElement; } @@ -320,7 +318,7 @@ void SAL_CALL OOXMLDocPropHandler::startFastElement( ::sal_Int32 nElement, const if ( xAttribs.is() && xAttribs->hasAttribute( XML_name ) ) m_aCustomPropertyName = xAttribs->getValue( XML_name ); } - else if ( m_nState && m_nInBlock && m_nInBlock == 2 && ( nElement >> 16 ) == ( NMSP_VT >> 16 ) ) + else if ( m_nState && m_nInBlock && m_nInBlock == 2 && getNamespace( nElement ) == NMSP_officeDocPropsVT ) { m_nType = nElement; } @@ -402,72 +400,72 @@ void SAL_CALL OOXMLDocPropHandler::characters( const ::rtl::OUString& aChars ) { if ( (m_nInBlock == 2) || ((m_nInBlock == 3) && m_nType) ) { - if ( m_nState == ( XML_coreProperties|NMSP_COREPR ) ) + if ( m_nState == COREPR_TOKEN( coreProperties ) ) { switch( m_nBlock ) { - case XML_category|NMSP_COREPR: + case COREPR_TOKEN( category ): m_aCustomPropertyName = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "category" ) ); AddCustomProperty( uno::makeAny( aChars ) ); // the property has string type break; - case XML_contentStatus|NMSP_COREPR: + case COREPR_TOKEN( contentStatus ): m_aCustomPropertyName = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "contentStatus" ) ); AddCustomProperty( uno::makeAny( aChars ) ); // the property has string type break; - case XML_contentType|NMSP_COREPR: + case COREPR_TOKEN( contentType ): m_aCustomPropertyName = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "contentType" ) ); AddCustomProperty( uno::makeAny( aChars ) ); // the property has string type break; - case XML_identifier|NMSP_COREPR: + case COREPR_TOKEN( identifier ): m_aCustomPropertyName = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "identifier" ) ); AddCustomProperty( uno::makeAny( aChars ) ); // the property has string type break; - case XML_version|NMSP_COREPR: + case COREPR_TOKEN( version ): m_aCustomPropertyName = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "version" ) ); AddCustomProperty( uno::makeAny( aChars ) ); // the property has string type break; - case XML_created|NMSP_DCTERMS: + case DCT_TOKEN( created ): if ( aChars.getLength() >= 4 ) m_xDocProp->setCreationDate( GetDateTimeFromW3CDTF( aChars ) ); break; - case XML_creator|NMSP_DC: + case DC_TOKEN( creator ): m_xDocProp->setAuthor( aChars ); break; - case XML_description|NMSP_DC: + case DC_TOKEN( description ): m_xDocProp->setDescription( aChars ); break; - case XML_keywords|NMSP_COREPR: + case COREPR_TOKEN( keywords ): m_xDocProp->setKeywords( GetKeywordsSet( aChars ) ); break; - case XML_language|NMSP_DC: + case DC_TOKEN( language ): if ( aChars.getLength() >= 2 ) m_xDocProp->setLanguage( GetLanguage( aChars ) ); break; - case XML_lastModifiedBy|NMSP_COREPR: + case COREPR_TOKEN( lastModifiedBy ): m_xDocProp->setModifiedBy( aChars ); break; - case XML_lastPrinted|NMSP_COREPR: + case COREPR_TOKEN( lastPrinted ): if ( aChars.getLength() >= 4 ) m_xDocProp->setPrintDate( GetDateTimeFromW3CDTF( aChars ) ); break; - case XML_modified|NMSP_DCTERMS: + case DCT_TOKEN( modified ): if ( aChars.getLength() >= 4 ) m_xDocProp->setModificationDate( GetDateTimeFromW3CDTF( aChars ) ); break; - case XML_revision|NMSP_COREPR: + case COREPR_TOKEN( revision ): try { m_xDocProp->setEditingCycles( @@ -479,11 +477,11 @@ void SAL_CALL OOXMLDocPropHandler::characters( const ::rtl::OUString& aChars ) } break; - case XML_subject|NMSP_DC: + case DC_TOKEN( subject ): m_xDocProp->setSubject( aChars ); break; - case XML_title|NMSP_DC: + case DC_TOKEN( title ): m_xDocProp->setTitle( aChars ); break; @@ -491,19 +489,19 @@ void SAL_CALL OOXMLDocPropHandler::characters( const ::rtl::OUString& aChars ) OSL_ASSERT( "Unexpected core property!" ); } } - else if ( m_nState == ( XML_Properties|NMSP_EXTPR ) ) + else if ( m_nState == EXTPR_TOKEN( Properties ) ) { switch( m_nBlock ) { - case XML_Application|NMSP_EXTPR: + case EXTPR_TOKEN( Application ): m_xDocProp->setGenerator( aChars ); break; - case XML_Template|NMSP_EXTPR: + case EXTPR_TOKEN( Template ): m_xDocProp->setTemplateName( aChars ); break; - case XML_TotalTime|NMSP_EXTPR: + case EXTPR_TOKEN( TotalTime ): try { m_xDocProp->setEditingDuration( aChars.toInt32() ); @@ -514,89 +512,89 @@ void SAL_CALL OOXMLDocPropHandler::characters( const ::rtl::OUString& aChars ) } break; - case XML_Characters|NMSP_EXTPR: - case XML_Pages|NMSP_EXTPR: - case XML_Words|NMSP_EXTPR: - case XML_Paragraphs|NMSP_EXTPR: + case EXTPR_TOKEN( Characters ): + case EXTPR_TOKEN( Pages ): + case EXTPR_TOKEN( Words ): + case EXTPR_TOKEN( Paragraphs ): UpdateDocStatistic( aChars ); break; - case XML_HyperlinksChanged|NMSP_EXTPR: + case EXTPR_TOKEN( HyperlinksChanged ): m_aCustomPropertyName = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "HyperlinksChanged" ) ); AddCustomProperty( uno::makeAny( aChars.toBoolean() ) ); // the property has boolean type break; - case XML_LinksUpToDate|NMSP_EXTPR: + case EXTPR_TOKEN( LinksUpToDate ): m_aCustomPropertyName = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "LinksUpToDate" ) ); AddCustomProperty( uno::makeAny( aChars.toBoolean() ) ); // the property has boolean type break; - case XML_ScaleCrop|NMSP_EXTPR: + case EXTPR_TOKEN( ScaleCrop ): m_aCustomPropertyName = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ScaleCrop" ) ); AddCustomProperty( uno::makeAny( aChars.toBoolean() ) ); // the property has boolean type break; - case XML_SharedDoc|NMSP_EXTPR: + case EXTPR_TOKEN( SharedDoc ): m_aCustomPropertyName = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ShareDoc" ) ); AddCustomProperty( uno::makeAny( aChars.toBoolean() ) ); // the property has boolean type break; - case XML_DocSecurity|NMSP_EXTPR: + case EXTPR_TOKEN( DocSecurity ): m_aCustomPropertyName = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DocSecurity" ) ); AddCustomProperty( uno::makeAny( aChars.toInt32() ) ); // the property has sal_Int32 type break; - case XML_HiddenSlides|NMSP_EXTPR: + case EXTPR_TOKEN( HiddenSlides ): m_aCustomPropertyName = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "HiddenSlides" ) ); AddCustomProperty( uno::makeAny( aChars.toInt32() ) ); // the property has sal_Int32 type break; - case XML_MMClips|NMSP_EXTPR: + case EXTPR_TOKEN( MMClips ): m_aCustomPropertyName = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "MMClips" ) ); AddCustomProperty( uno::makeAny( aChars.toInt32() ) ); // the property has sal_Int32 type break; - case XML_Notes|NMSP_EXTPR: + case EXTPR_TOKEN( Notes ): m_aCustomPropertyName = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Notes" ) ); AddCustomProperty( uno::makeAny( aChars.toInt32() ) ); // the property has sal_Int32 type break; - case XML_Slides|NMSP_EXTPR: + case EXTPR_TOKEN( Slides ): m_aCustomPropertyName = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Slides" ) ); AddCustomProperty( uno::makeAny( aChars.toInt32() ) ); // the property has sal_Int32 type break; - case XML_AppVersion|NMSP_EXTPR: + case EXTPR_TOKEN( AppVersion ): m_aCustomPropertyName = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "AppVersion" ) ); AddCustomProperty( uno::makeAny( aChars ) ); // the property has string type break; - case XML_Company|NMSP_EXTPR: + case EXTPR_TOKEN( Company ): m_aCustomPropertyName = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Company" ) ); AddCustomProperty( uno::makeAny( aChars ) ); // the property has string type break; - case XML_HyperlinkBase|NMSP_EXTPR: + case EXTPR_TOKEN( HyperlinkBase ): m_aCustomPropertyName = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "HyperlinkBase" ) ); AddCustomProperty( uno::makeAny( aChars ) ); // the property has string type break; - case XML_Manager|NMSP_EXTPR: + case EXTPR_TOKEN( Manager ): m_aCustomPropertyName = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Manager" ) ); AddCustomProperty( uno::makeAny( aChars ) ); // the property has string type break; - case XML_PresentationFormat|NMSP_EXTPR: + case EXTPR_TOKEN( PresentationFormat ): m_aCustomPropertyName = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PresentationFormat" ) ); AddCustomProperty( uno::makeAny( aChars ) ); // the property has string type break; - case XML_CharactersWithSpaces|NMSP_EXTPR: - case XML_Lines|NMSP_EXTPR: - case XML_DigSig|NMSP_EXTPR: - case XML_HeadingPairs|NMSP_EXTPR: - case XML_HLinks|NMSP_EXTPR: - case XML_TitlesOfParts|NMSP_EXTPR: + case EXTPR_TOKEN( CharactersWithSpaces ): + case EXTPR_TOKEN( Lines ): + case EXTPR_TOKEN( DigSig ): + case EXTPR_TOKEN( HeadingPairs ): + case EXTPR_TOKEN( HLinks ): + case EXTPR_TOKEN( TitlesOfParts ): // ignored during the import currently break; @@ -604,46 +602,46 @@ void SAL_CALL OOXMLDocPropHandler::characters( const ::rtl::OUString& aChars ) OSL_ASSERT( "Unexpected extended property!" ); } } - else if ( m_nState == ( XML_Properties|NMSP_CUSTPR ) ) + else if ( m_nState == CUSTPR_TOKEN( Properties ) ) { - if ( m_nBlock == ( XML_property|NMSP_CUSTPR ) ) + if ( m_nBlock == CUSTPR_TOKEN( property ) ) { // this is a custom property switch( m_nType ) { - case XML_bool|NMSP_VT: + case VT_TOKEN( bool ): AddCustomProperty( uno::makeAny( aChars.toBoolean() ) ); break; - case XML_bstr|NMSP_VT: - case XML_lpstr|NMSP_VT: - case XML_lpwstr|NMSP_VT: + case VT_TOKEN( bstr ): + case VT_TOKEN( lpstr ): + case VT_TOKEN( lpwstr ): AddCustomProperty( uno::makeAny( AttributeConversion::decodeXString( aChars ) ) ); // the property has string type break; - case XML_date|NMSP_VT: - case XML_filetime|NMSP_VT: + case VT_TOKEN( date ): + case VT_TOKEN( filetime ): AddCustomProperty( uno::makeAny( GetDateTimeFromW3CDTF( aChars ) ) ); - case XML_i1|NMSP_VT: - case XML_i2|NMSP_VT: + case VT_TOKEN( i1 ): + case VT_TOKEN( i2 ): AddCustomProperty( uno::makeAny( (sal_Int16)aChars.toInt32() ) ); break; - case XML_i4|NMSP_VT: - case XML_int|NMSP_VT: + case VT_TOKEN( i4 ): + case VT_TOKEN( int ): AddCustomProperty( uno::makeAny( aChars.toInt32() ) ); break; - case XML_i8|NMSP_VT: + case VT_TOKEN( i8 ): AddCustomProperty( uno::makeAny( aChars.toInt64() ) ); break; - case XML_r4|NMSP_VT: + case VT_TOKEN( r4 ): AddCustomProperty( uno::makeAny( aChars.toFloat() ) ); break; - case XML_r8|NMSP_VT: + case VT_TOKEN( r8 ): AddCustomProperty( uno::makeAny( aChars.toDouble() ) ); break; diff --git a/oox/source/docprop/docprophandler.hxx b/oox/source/docprop/docprophandler.hxx index bb2cff323159..13e6e47b025e 100644 --- a/oox/source/docprop/docprophandler.hxx +++ b/oox/source/docprop/docprophandler.hxx @@ -34,9 +34,19 @@ #include +#include "oox/token/namespaces.hxx" +#include "oox/token/tokens.hxx" + namespace oox { namespace docprop { +#define COREPR_TOKEN( token ) (::oox::NMSP_packageMetaCorePr | XML_##token) +#define CUSTPR_TOKEN( token ) (::oox::NMSP_officeCustomPr | XML_##token) +#define EXTPR_TOKEN( token ) (::oox::NMSP_officeExtPr | XML_##token) +#define VT_TOKEN( token ) (::oox::NMSP_officeDocPropsVT | XML_##token) +#define DC_TOKEN( token ) (::oox::NMSP_dc | XML_##token) +#define DCT_TOKEN( token ) (::oox::NMSP_dcTerms | XML_##token) + class OOXMLDocPropHandler : public ::cppu::WeakImplHelper1< ::com::sun::star::xml::sax::XFastDocumentHandler > { ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > m_xContext; diff --git a/oox/source/docprop/ooxmldocpropimport.cxx b/oox/source/docprop/ooxmldocpropimport.cxx index de34f592e98a..794950e0fbf3 100644 --- a/oox/source/docprop/ooxmldocpropimport.cxx +++ b/oox/source/docprop/ooxmldocpropimport.cxx @@ -25,203 +25,166 @@ * ************************************************************************/ -#include +#include "ooxmldocpropimport.hxx" + +#include +#include #include #include -#include -#include -#include -#include - -#include -#include - -#include +#include +#include "oox/core/fastparser.hxx" +#include "oox/core/relations.hxx" +#include "oox/helper/containerhelper.hxx" +#include "oox/helper/helper.hxx" #include "docprophandler.hxx" -#include "ooxmldocpropimport.hxx" - -using namespace ::com::sun::star; namespace oox { namespace docprop { -// ----------------------------------------------------------- -::rtl::OUString SAL_CALL OOXMLDocPropImportImpl_getImplementationName() +// ============================================================================ + +using namespace ::com::sun::star::beans; +using namespace ::com::sun::star::document; +using namespace ::com::sun::star::embed; +using namespace ::com::sun::star::io; +using namespace ::com::sun::star::lang; +using namespace ::com::sun::star::uno; +using namespace ::com::sun::star::xml::sax; + +using ::rtl::OUString; + +// ============================================================================ + +OUString SAL_CALL DocumentPropertiesImport_getImplementationName() { - return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( - "com.sun.star.comp.oox.docprop.OOXMLDocumentPropertiesImporter")); + return CREATE_OUSTRING( "com.sun.star.comp.oox.docprop.DocumentPropertiesImport" ); } -// ----------------------------------------------------------- -uno::Sequence< ::rtl::OUString > SAL_CALL OOXMLDocPropImportImpl_getSupportedServiceNames() +Sequence< OUString > SAL_CALL DocumentPropertiesImport_getSupportedServiceNames() { - uno::Sequence< ::rtl::OUString > s(1); - s[0] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( - "com.sun.star.document.OOXMLDocumentPropertiesImporter")); - return s; + Sequence< OUString > aServices( 1 ); + aServices[ 0 ] = CREATE_OUSTRING( "com.sun.star.document.OOXMLDocumentPropertiesImporter" ); + return aServices; } -// ----------------------------------------------------------- -uno::Reference< uno::XInterface > SAL_CALL OOXMLDocPropImportImpl_createInstance( - const uno::Reference< uno::XComponentContext > & context) - SAL_THROW((uno::Exception)) +Reference< XInterface > SAL_CALL DocumentPropertiesImport_createInstance( const Reference< XComponentContext >& rxContext ) SAL_THROW((Exception)) { - return static_cast< ::cppu::OWeakObject * >(new OOXMLDocPropImportImpl(context)); + return static_cast< ::cppu::OWeakObject* >( new DocumentPropertiesImport( rxContext ) ); } +// ============================================================================ -// ----------------------------------------------------------- -OOXMLDocPropImportImpl::OOXMLDocPropImportImpl(uno::Reference< uno::XComponentContext > const & xContext) : - m_xContext( xContext ) -{} +namespace { -// ----------------------------------------------------------- -uno::Sequence< xml::sax::InputSource > OOXMLDocPropImportImpl::GetRelatedStreams( const uno::Reference< embed::XStorage > xStorage, const ::rtl::OUString& aStreamType ) +Sequence< InputSource > lclGetRelatedStreams( const Reference< XStorage >& rxStorage, const OUString& rStreamType ) throw (RuntimeException) { - if ( !xStorage.is() ) - throw uno::RuntimeException(); + Reference< XRelationshipAccess > xRelation( rxStorage, UNO_QUERY_THROW ); + Reference< XHierarchicalStorageAccess > xHierarchy( rxStorage, UNO_QUERY_THROW ); - uno::Reference< embed::XRelationshipAccess > xRelation( xStorage, uno::UNO_QUERY_THROW ); - uno::Reference< embed::XHierarchicalStorageAccess > xHierarchy( xStorage, uno::UNO_QUERY_THROW ); - - uno::Sequence< uno::Sequence< beans::StringPair > > aPropsInfo = xRelation->getRelationshipsByType( aStreamType ); + Sequence< Sequence< StringPair > > aPropsInfo = xRelation->getRelationshipsByType( rStreamType ); sal_Int32 nLength = 0; - uno::Sequence< xml::sax::InputSource > aResult( aPropsInfo.getLength() ); - if ( aPropsInfo.getLength() ) + ::std::vector< InputSource > aResult; + + for( sal_Int32 nIndex = 0, nLength = aPropsInfo.getLength(); nIndex < nLength; ++nIndex ) { - for ( sal_Int32 nInd = 0; nInd < aPropsInfo.getLength(); nInd++ ) - for ( sal_Int32 nEntryInd = 0; nEntryInd < aPropsInfo[nInd].getLength(); nEntryInd++ ) - if ( aPropsInfo[nInd][nEntryInd].First.equals( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Target" ) ) ) ) + const Sequence< StringPair >& rEntries = aPropsInfo[ nIndex ]; + for( sal_Int32 nEntryIndex = 0, nEntryLength = rEntries.getLength(); nEntryIndex < nEntryLength; ++nEntryIndex ) + { + const StringPair& rEntry = rEntries[ nEntryIndex ]; + if( rEntry.First.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Target" ) ) ) + { + Reference< XExtendedStorageStream > xExtStream( + xHierarchy->openStreamElementByHierarchicalName( rEntry.Second, ElementModes::READ ), UNO_QUERY_THROW ); + Reference< XInputStream > xInStream = xExtStream->getInputStream(); + if( xInStream.is() ) { - uno::Reference< embed::XExtendedStorageStream > xExtStream = xHierarchy->openStreamElementByHierarchicalName( aPropsInfo[nInd][nEntryInd].Second, embed::ElementModes::READ ); - if ( !xExtStream.is() ) - throw uno::RuntimeException(); - - aResult[nLength].sSystemId = aPropsInfo[nInd][nEntryInd].Second; - aResult[nLength++].aInputStream = xExtStream->getInputStream(); - break; + aResult.resize( aResult.size() + 1 ); + aResult.back().sSystemId = rEntry.Second; + aResult.back().aInputStream = xExtStream->getInputStream(); } - - aResult.realloc( nLength ); + break; + } + } } - return aResult; + return ContainerHelper::vectorToSequence( aResult ); } -// com.sun.star.uno.XServiceInfo: -// ----------------------------------------------------------- -::rtl::OUString SAL_CALL OOXMLDocPropImportImpl::getImplementationName() throw (uno::RuntimeException) +} // namespace + +// ============================================================================ + +DocumentPropertiesImport::DocumentPropertiesImport( const Reference< XComponentContext >& rxContext ) : + mxContext( rxContext ) { - return OOXMLDocPropImportImpl_getImplementationName(); } -// ----------------------------------------------------------- -::sal_Bool SAL_CALL OOXMLDocPropImportImpl::supportsService(::rtl::OUString const & serviceName) throw (uno::RuntimeException) -{ - uno::Sequence< ::rtl::OUString > serviceNames = OOXMLDocPropImportImpl_getSupportedServiceNames(); - for (::sal_Int32 i = 0; i < serviceNames.getLength(); ++i) - { - if (serviceNames[i] == serviceName) - return sal_True; - } +// XServiceInfo - return sal_False; +OUString SAL_CALL DocumentPropertiesImport::getImplementationName() throw (RuntimeException) +{ + return DocumentPropertiesImport_getImplementationName(); } -// ----------------------------------------------------------- -uno::Sequence< ::rtl::OUString > SAL_CALL OOXMLDocPropImportImpl::getSupportedServiceNames() throw (uno::RuntimeException) +sal_Bool SAL_CALL DocumentPropertiesImport::supportsService( const OUString& rServiceName ) throw (RuntimeException) { - return OOXMLDocPropImportImpl_getSupportedServiceNames(); + Sequence< OUString > aServiceNames = DocumentPropertiesImport_getSupportedServiceNames(); + for( sal_Int32 nIndex = 0, nLength = aServiceNames.getLength(); nIndex < nLength; ++nIndex ) + if( aServiceNames[ nIndex ] == rServiceName ) + return sal_True; + return sal_False; } -// ----------------------------------------------------------- -// ::com::sun::star::document::XOOXMLDocumentPropertiesImporter: -void SAL_CALL OOXMLDocPropImportImpl::importProperties(const uno::Reference< embed::XStorage > & xSource, const uno::Reference< document::XDocumentProperties > & xDocumentProperties) throw (uno::RuntimeException, lang::IllegalArgumentException, xml::sax::SAXException, uno::Exception) +Sequence< OUString > SAL_CALL DocumentPropertiesImport::getSupportedServiceNames() throw (RuntimeException) { - // TODO: Insert your implementation for "importProperties" here. - if ( !m_xContext.is() ) - throw uno::RuntimeException(); + return DocumentPropertiesImport_getSupportedServiceNames(); +} - if ( !xSource.is() || !xDocumentProperties.is() ) - throw lang::IllegalArgumentException(); +// XOOXMLDocumentPropertiesImporter - // the MS Office seems to have a bug, so we have to do similar handling - ::rtl::OUString aCoreType( RTL_CONSTASCII_USTRINGPARAM( "http://schemas.openxmlformats.org/officedocument/2006/relationships/metadata/core-properties" ) ); - ::rtl::OUString aCoreWorkaroundType( RTL_CONSTASCII_USTRINGPARAM( "http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties" ) ); +void SAL_CALL DocumentPropertiesImport::importProperties( + const Reference< XStorage >& rxSource, const Reference< XDocumentProperties >& rxDocumentProperties ) + throw (RuntimeException, IllegalArgumentException, SAXException, Exception) +{ + if( !mxContext.is() ) + throw RuntimeException(); - ::rtl::OUString aExtType( RTL_CONSTASCII_USTRINGPARAM( "http://schemas.openxmlformats.org/officedocument/2006/relationships/extended-properties" ) ); - ::rtl::OUString aCustomType( RTL_CONSTASCII_USTRINGPARAM( "http://schemas.openxmlformats.org/officedocument/2006/relationships/custom-properties" ) ); + if( !rxSource.is() || !rxDocumentProperties.is() ) + throw IllegalArgumentException(); - uno::Sequence< xml::sax::InputSource > aCoreStreams = GetRelatedStreams( xSource, aCoreType ); - if ( !aCoreStreams.getLength() ) - aCoreStreams = GetRelatedStreams( xSource, aCoreWorkaroundType ); + Sequence< InputSource > aCoreStreams = lclGetRelatedStreams( rxSource, CREATE_OFFICEDOC_RELATION_TYPE( "metadata/core-properties" ) ); + // MS Office seems to have a bug, so we have to do similar handling + if( !aCoreStreams.hasElements() ) + aCoreStreams = lclGetRelatedStreams( rxSource, CREATE_PACKAGE_RELATION_TYPE( "metadata/core-properties" ) ); - uno::Sequence< xml::sax::InputSource > aExtStreams = GetRelatedStreams( xSource, aExtType ); - uno::Sequence< xml::sax::InputSource > aCustomStreams = GetRelatedStreams( xSource, aCustomType ); + Sequence< InputSource > aExtStreams = lclGetRelatedStreams( rxSource, CREATE_OFFICEDOC_RELATION_TYPE( "extended-properties" ) ); + Sequence< InputSource > aCustomStreams = lclGetRelatedStreams( rxSource, CREATE_OFFICEDOC_RELATION_TYPE( "custom-properties" ) ); - if ( aCoreStreams.getLength() || aExtStreams.getLength() || aCustomStreams.getLength() ) + if( aCoreStreams.hasElements() || aExtStreams.hasElements() || aCustomStreams.hasElements() ) { - if ( aCoreStreams.getLength() > 1 ) - throw io::IOException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Unexpected core properties stream!" ) ), uno::Reference< uno::XInterface >() ); - - uno::Reference< lang::XMultiComponentFactory > xFactory( m_xContext->getServiceManager(), uno::UNO_QUERY_THROW ); - - uno::Reference< xml::sax::XFastParser > xParser( - xFactory->createInstanceWithContext( - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.xml.sax.FastParser" ) ), - m_xContext ), - uno::UNO_QUERY_THROW ); - - uno::Reference< xml::sax::XFastTokenHandler > xTokenHandler( - xFactory->createInstanceWithContext( - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.oox.FastTokenHandlerService" ) ), - m_xContext ), - uno::UNO_QUERY_THROW ); - - uno::Reference< xml::sax::XFastDocumentHandler > xDocHandler( static_cast< xml::sax::XFastDocumentHandler* >( new OOXMLDocPropHandler( m_xContext, xDocumentProperties ) ) ); - - xParser->setFastDocumentHandler( xDocHandler ); - xParser->setTokenHandler( xTokenHandler ); - - xParser->registerNamespace( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "http://schemas.openxmlformats.org/package/2006/metadata/core-properties" ) ), NMSP_COREPR ); - xParser->registerNamespace( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "http://purl.org/dc/elements/1.1/" ) ), NMSP_DC ); - xParser->registerNamespace( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "http://purl.org/dc/terms/" ) ), NMSP_DCTERMS ); - xParser->registerNamespace( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "http://schemas.openxmlformats.org/officeDocument/2006/extended-properties" ) ), NMSP_EXTPR ); - xParser->registerNamespace( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "http://schemas.openxmlformats.org/officeDocument/2006/custom-properties" ) ), NMSP_CUSTPR ); - xParser->registerNamespace( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes" ) ), NMSP_VT ); - - // #158414# XFastParser::parseStream() throws on invalid XML - if ( aCoreStreams.getLength() ) try - { - if ( aCoreStreams[0].aInputStream.is() ) - { - xParser->parseStream( aCoreStreams[0] ); - aCoreStreams[0].aInputStream->closeInput(); - } - } - catch( uno::Exception& ) - { - } - - sal_Int32 nInd = 0; - for ( nInd = 0; nInd < aExtStreams.getLength(); nInd++ ) - { - xParser->parseStream( aExtStreams[nInd] ); - if ( aExtStreams[nInd].aInputStream.is() ) - aExtStreams[nInd].aInputStream->closeInput(); - } - - for ( nInd = 0; nInd < aCustomStreams.getLength(); nInd++ ) - { - xParser->parseStream( aCustomStreams[nInd] ); - if ( aCustomStreams[nInd].aInputStream.is() ) - aCustomStreams[nInd].aInputStream->closeInput(); - } + if( aCoreStreams.getLength() > 1 ) + throw IOException( CREATE_OUSTRING( "Unexpected core properties stream!" ), Reference< XInterface >() ); + + ::oox::core::FastParser aParser( mxContext ); + aParser.registerNamespace( NMSP_packageMetaCorePr ); + aParser.registerNamespace( NMSP_dc ); + aParser.registerNamespace( NMSP_dcTerms ); + aParser.registerNamespace( NMSP_officeExtPr ); + aParser.registerNamespace( NMSP_officeCustomPr ); + aParser.registerNamespace( NMSP_officeDocPropsVT ); + aParser.setDocumentHandler( new OOXMLDocPropHandler( mxContext, rxDocumentProperties ) ); + + if( aCoreStreams.hasElements() ) + aParser.parseStream( aCoreStreams[ 0 ], true ); + for( sal_Int32 nIndex = 0; nIndex < aExtStreams.getLength(); ++nIndex ) + aParser.parseStream( aExtStreams[ nIndex ], true ); + for( sal_Int32 nIndex = 0; nIndex < aCustomStreams.getLength(); ++nIndex ) + aParser.parseStream( aCustomStreams[ nIndex ], true ); } } +// ============================================================================ + } // namespace docprop } // namespace oox - - diff --git a/oox/source/docprop/ooxmldocpropimport.hxx b/oox/source/docprop/ooxmldocpropimport.hxx index a10eafbe1eb4..79f4d1f7e60b 100644 --- a/oox/source/docprop/ooxmldocpropimport.hxx +++ b/oox/source/docprop/ooxmldocpropimport.hxx @@ -28,44 +28,44 @@ #ifndef OOX_DOCPROP_OOXMLDOCPROPIMPORT_HXX #define OOX_DOCPROP_OOXMLDOCPROPIMPORT_HXX -#include -#include +#include #include +#include #include -#include +#include namespace oox { namespace docprop { -class OOXMLDocPropImportImpl: +// ============================================================================ + +class DocumentPropertiesImport : public ::cppu::WeakImplHelper2< ::com::sun::star::lang::XServiceInfo, - ::com::sun::star::document::XOOXMLDocumentPropertiesImporter> + ::com::sun::star::document::XOOXMLDocumentPropertiesImporter > { -private: - ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > m_xContext; - - OOXMLDocPropImportImpl(const OOXMLDocPropImportImpl &); // not defined - OOXMLDocPropImportImpl& operator=(const OOXMLDocPropImportImpl &); // not defined - public: - explicit OOXMLDocPropImportImpl(::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > const & context); - virtual ~OOXMLDocPropImportImpl() {} - - ::com::sun::star::uno::Sequence< ::com::sun::star::xml::sax::InputSource > GetRelatedStreams( const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage > xStorage, const ::rtl::OUString& aStreamType ); + explicit DocumentPropertiesImport( + const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext ); - // ::com::sun::star::lang::XServiceInfo: + // XServiceInfo virtual ::rtl::OUString SAL_CALL getImplementationName() throw (::com::sun::star::uno::RuntimeException); - virtual ::sal_Bool SAL_CALL supportsService(const ::rtl::OUString & ServiceName) throw (::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& rServiceName ) throw (::com::sun::star::uno::RuntimeException); virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() throw (::com::sun::star::uno::RuntimeException); - // ::com::sun::star::document::XOOXMLDocumentPropertiesImporter: - virtual void SAL_CALL importProperties(const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage > & xSource, const ::com::sun::star::uno::Reference< ::com::sun::star::document::XDocumentProperties > & xDocumentProperties) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::Exception); + // XOOXMLDocumentPropertiesImporter + virtual void SAL_CALL importProperties( + const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& rxSource, + const ::com::sun::star::uno::Reference< ::com::sun::star::document::XDocumentProperties >& rxDocumentProperties ) + throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::Exception); +private: + ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > mxContext; }; +// ============================================================================ + } // namespace docprop } // namespace oox #endif - 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 // 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 #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 #include -#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 #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 #include #include 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 #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 #include #include -#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 #include #include -#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 #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 - #include #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 #include #include -#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 // for the F_PI180 define #include 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 #include -#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 #include 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 #include #include -#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 #include #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 -#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( 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(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 -#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; */ } diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx index 5aeb56883d2d..85ef2519f029 100644 --- a/oox/source/export/drawingml.cxx +++ b/oox/source/export/drawingml.cxx @@ -25,7 +25,6 @@ * ************************************************************************/ -#include "tokens.hxx" #include "oox/core/xmlfilterbase.hxx" #include "oox/export/drawingml.hxx" #include "oox/export/utils.hxx" diff --git a/oox/source/export/shapes.cxx b/oox/source/export/shapes.cxx index d33572230f1d..0d07e6cf5226 100644 --- a/oox/source/export/shapes.cxx +++ b/oox/source/export/shapes.cxx @@ -25,7 +25,6 @@ * ************************************************************************/ -#include "tokens.hxx" #include "oox/core/xmlfilterbase.hxx" #include "oox/export/shapes.hxx" #include "oox/export/utils.hxx" diff --git a/oox/source/helper/graphichelper.cxx b/oox/source/helper/graphichelper.cxx index dc95cf71ee35..abd8ae826243 100644 --- a/oox/source/helper/graphichelper.cxx +++ b/oox/source/helper/graphichelper.cxx @@ -36,8 +36,8 @@ #include #include #include -#include "tokens.hxx" #include "oox/helper/containerhelper.hxx" +#include "oox/token/tokens.hxx" namespace oox { diff --git a/oox/source/helper/propertymap.cxx b/oox/source/helper/propertymap.cxx index 49a3547682b4..0c4e2cb07549 100644 --- a/oox/source/helper/propertymap.cxx +++ b/oox/source/helper/propertymap.cxx @@ -32,8 +32,7 @@ #include #include #include -#include "properties.hxx" -#include "oox/token/propertylist.hxx" +#include "oox/token/propertynames.hxx" namespace oox { @@ -50,19 +49,14 @@ using ::rtl::OUString; namespace { -/** Thread-save singleton of a vector of all supported property names. */ -struct StaticPropertyList : public ::rtl::Static< PropertyList, StaticPropertyList > {}; - -// ---------------------------------------------------------------------------- - -typedef ::cppu::WeakImplHelper2< XPropertySet, XPropertySetInfo > GenericPropertySetImplBase; +typedef ::cppu::WeakImplHelper2< XPropertySet, XPropertySetInfo > GenericPropertySetBase; /** This class implements a generic XPropertySet. Properties of all names and types can be set and later retrieved. TODO: move this to comphelper or better find an existing implementation */ -class GenericPropertySet : public GenericPropertySetImplBase, private ::osl::Mutex +class GenericPropertySet : public GenericPropertySetBase, private ::osl::Mutex { public: explicit GenericPropertySet(); @@ -95,7 +89,7 @@ GenericPropertySet::GenericPropertySet() GenericPropertySet::GenericPropertySet( const PropertyMap& rPropMap ) { - const PropertyList& rPropNames = StaticPropertyList::get(); + const PropertyNameVector& rPropNames = StaticPropertyNameVector::get(); for( PropertyMap::const_iterator aIt = rPropMap.begin(), aEnd = rPropMap.end(); aIt != aEnd; ++aIt ) maPropMap[ rPropNames[ aIt->first ] ] = aIt->second; } @@ -163,7 +157,7 @@ sal_Bool SAL_CALL GenericPropertySet::hasPropertyByName( const OUString& rProper // ============================================================================ PropertyMap::PropertyMap() : - mpPropNames( &StaticPropertyList::get() ) + mpPropNames( &StaticPropertyNameVector::get() ) // pointer instead reference to get compiler generated copy c'tor and operator= { } @@ -174,7 +168,7 @@ PropertyMap::~PropertyMap() /*static*/ const OUString& PropertyMap::getPropertyName( sal_Int32 nPropId ) { OSL_ENSURE( (0 <= nPropId) && (nPropId < PROP_COUNT), "PropertyMap::getPropertyName - invalid property identifier" ); - return StaticPropertyList::get()[ nPropId ]; + return StaticPropertyNameVector::get()[ nPropId ]; } const Any* PropertyMap::getProperty( sal_Int32 nPropId ) const diff --git a/oox/source/ole/axbinaryreader.cxx b/oox/source/ole/axbinaryreader.cxx old mode 100755 new mode 100644 index 0c4743be9e31..493d6b68c6ff --- a/oox/source/ole/axbinaryreader.cxx +++ b/oox/source/ole/axbinaryreader.cxx @@ -26,15 +26,18 @@ ************************************************************************/ #include "oox/ole/axbinaryreader.hxx" -#include "oox/ole/olehelper.hxx" -using ::rtl::OUString; +#include "oox/ole/olehelper.hxx" namespace oox { namespace ole { // ============================================================================ +using ::rtl::OUString; + +// ============================================================================ + namespace { const sal_uInt32 AX_STRING_SIZEMASK = 0x7FFFFFFF; @@ -343,4 +346,3 @@ bool AxBinaryPropertyReader::startNextProperty() } // namespace ole } // namespace oox - diff --git a/oox/source/ole/axcontrol.cxx b/oox/source/ole/axcontrol.cxx index a0d3d7340f57..105f5deea225 100644 --- a/oox/source/ole/axcontrol.cxx +++ b/oox/source/ole/axcontrol.cxx @@ -59,8 +59,6 @@ #include "oox/helper/binaryinputstream.hxx" #include "oox/helper/graphichelper.hxx" #include "oox/helper/propertymap.hxx" -#include "properties.hxx" -#include "tokens.hxx" namespace oox { namespace ole { diff --git a/oox/source/ole/axcontrolfragment.cxx b/oox/source/ole/axcontrolfragment.cxx index 8eed69b125bb..f45e8e2590c9 100644 --- a/oox/source/ole/axcontrolfragment.cxx +++ b/oox/source/ole/axcontrolfragment.cxx @@ -26,23 +26,27 @@ ************************************************************************/ #include "oox/ole/axcontrolfragment.hxx" + +#include "oox/core/xmlfilterbase.hxx" #include "oox/helper/binaryinputstream.hxx" #include "oox/helper/binaryoutputstream.hxx" -#include "oox/core/xmlfilterbase.hxx" #include "oox/ole/axcontrol.hxx" #include "oox/ole/olehelper.hxx" #include "oox/ole/olestorage.hxx" -using ::rtl::OUString; -using ::com::sun::star::io::XInputStream; -using ::com::sun::star::uno::Reference; +namespace oox { +namespace ole { + +// ============================================================================ + +using namespace ::com::sun::star::io; +using namespace ::com::sun::star::uno; + using ::oox::core::ContextHandler2; using ::oox::core::ContextHandlerRef; using ::oox::core::FragmentHandler2; using ::oox::core::XmlFilterBase; - -namespace oox { -namespace ole { +using ::rtl::OUString; // ============================================================================ diff --git a/oox/source/ole/olehelper.cxx b/oox/source/ole/olehelper.cxx index 8952350c8589..8dfe02283cb0 100644 --- a/oox/source/ole/olehelper.cxx +++ b/oox/source/ole/olehelper.cxx @@ -26,19 +26,22 @@ ************************************************************************/ #include "oox/ole/olehelper.hxx" + #include -#include "tokens.hxx" #include "oox/helper/binaryinputstream.hxx" #include "oox/helper/graphichelper.hxx" - -using ::rtl::OUString; -using ::rtl::OUStringBuffer; +#include "oox/token/tokens.hxx" namespace oox { namespace ole { // ============================================================================ +using ::rtl::OUString; +using ::rtl::OUStringBuffer; + +// ============================================================================ + namespace { const sal_uInt32 OLE_COLORTYPE_MASK = 0xFF000000; @@ -308,4 +311,3 @@ StdFontInfo::StdFontInfo( const ::rtl::OUString& rName, sal_uInt32 nHeight, } // namespace ole } // namespace oox - diff --git a/oox/source/ole/oleobjecthelper.cxx b/oox/source/ole/oleobjecthelper.cxx index 5ef65fe2292e..396cd6b53874 100644 --- a/oox/source/ole/oleobjecthelper.cxx +++ b/oox/source/ole/oleobjecthelper.cxx @@ -26,34 +26,32 @@ ************************************************************************/ #include "oox/ole/oleobjecthelper.hxx" -#include -#include -#include -#include + #include #include +#include #include #include -#include "properties.hxx" +#include +#include +#include #include "oox/helper/propertymap.hxx" -using ::rtl::OUString; -using ::com::sun::star::uno::Exception; -using ::com::sun::star::uno::Reference; -using ::com::sun::star::uno::UNO_QUERY; -using ::com::sun::star::uno::UNO_QUERY_THROW; -using ::com::sun::star::container::XNameAccess; -using ::com::sun::star::lang::XComponent; -using ::com::sun::star::lang::XMultiServiceFactory; -using ::com::sun::star::io::XOutputStream; -using ::com::sun::star::awt::Rectangle; -using ::com::sun::star::awt::Size; - namespace oox { namespace ole { // ============================================================================ +using namespace ::com::sun::star::awt; +using namespace ::com::sun::star::container; +using namespace ::com::sun::star::io; +using namespace ::com::sun::star::lang; +using namespace ::com::sun::star::uno; + +using ::rtl::OUString; + +// ============================================================================ + OleObjectInfo::OleObjectInfo() : mbLinked( false ), mbShowAsIcon( false ), @@ -138,4 +136,3 @@ bool OleObjectHelper::importOleObject( PropertyMap& rPropMap, const OleObjectInf } // namespace ole } // namespace oox - diff --git a/oox/source/ole/olestorage.cxx b/oox/source/ole/olestorage.cxx old mode 100755 new mode 100644 index 0ca2992d47ad..e9aa8f6a9ae8 --- a/oox/source/ole/olestorage.cxx +++ b/oox/source/ole/olestorage.cxx @@ -26,6 +26,7 @@ ************************************************************************/ #include "oox/ole/olestorage.hxx" + #include #include #include @@ -35,38 +36,26 @@ #include #include #include -#include "oox/helper/helper.hxx" #include "oox/helper/binaryinputstream.hxx" #include "oox/helper/binaryoutputstream.hxx" - -using ::rtl::OUString; -using ::com::sun::star::container::XNameContainer; -using ::com::sun::star::beans::PropertyValue; -using ::com::sun::star::embed::XStorage; -using ::com::sun::star::embed::XTransactedObject; -using ::com::sun::star::io::BufferSizeExceededException; -using ::com::sun::star::io::IOException; -using ::com::sun::star::io::NotConnectedException; -using ::com::sun::star::io::XInputStream; -using ::com::sun::star::io::XOutputStream; -using ::com::sun::star::io::XSeekable; -using ::com::sun::star::io::XStream; -using ::com::sun::star::lang::IllegalArgumentException; -using ::com::sun::star::lang::XMultiServiceFactory; -using ::com::sun::star::uno::Any; -using ::com::sun::star::uno::Exception; -using ::com::sun::star::uno::Reference; -using ::com::sun::star::uno::RuntimeException; -using ::com::sun::star::uno::Sequence; -using ::com::sun::star::uno::UNO_QUERY; -using ::com::sun::star::uno::UNO_QUERY_THROW; -using ::com::sun::star::uno::UNO_SET_THROW; +#include "oox/helper/helper.hxx" namespace oox { namespace ole { // ============================================================================ +using namespace ::com::sun::star::beans; +using namespace ::com::sun::star::container; +using namespace ::com::sun::star::embed; +using namespace ::com::sun::star::io; +using namespace ::com::sun::star::lang; +using namespace ::com::sun::star::uno; + +using ::rtl::OUString; + +// ============================================================================ + namespace { typedef ::cppu::WeakImplHelper2< XSeekable, XOutputStream > OleOutputStreamBase; diff --git a/oox/source/ole/vbacontrol.cxx b/oox/source/ole/vbacontrol.cxx index 684b40d1ad19..dc86c2dd82e5 100644 --- a/oox/source/ole/vbacontrol.cxx +++ b/oox/source/ole/vbacontrol.cxx @@ -43,8 +43,6 @@ #include "oox/helper/storagebase.hxx" #include "oox/helper/textinputstream.hxx" #include "oox/ole/vbahelper.hxx" -#include "properties.hxx" -#include "tokens.hxx" namespace oox { namespace ole { diff --git a/oox/source/ole/vbahelper.cxx b/oox/source/ole/vbahelper.cxx index 3bf72d30bfa5..82d38d83610c 100644 --- a/oox/source/ole/vbahelper.cxx +++ b/oox/source/ole/vbahelper.cxx @@ -32,9 +32,12 @@ namespace oox { namespace ole { +// ============================================================================ + +using namespace ::com::sun::star::uno; + using ::rtl::OUString; using ::rtl::OUStringBuffer; -using namespace ::com::sun::star::uno; // ============================================================================ diff --git a/oox/source/ole/vbainputstream.cxx b/oox/source/ole/vbainputstream.cxx index b2c8d5c64859..e56e8b5fbc89 100644 --- a/oox/source/ole/vbainputstream.cxx +++ b/oox/source/ole/vbainputstream.cxx @@ -31,6 +31,8 @@ namespace oox { namespace ole { +// ============================================================================ + namespace { const sal_uInt8 VBASTREAM_SIGNATURE = 1; diff --git a/oox/source/ole/vbaproject.cxx b/oox/source/ole/vbaproject.cxx index 0136a223ff6a..f51193fe30ba 100644 --- a/oox/source/ole/vbaproject.cxx +++ b/oox/source/ole/vbaproject.cxx @@ -50,8 +50,6 @@ #include "oox/ole/vbahelper.hxx" #include "oox/ole/vbainputstream.hxx" #include "oox/ole/vbamodule.hxx" -#include "properties.hxx" -#include "tokens.hxx" namespace oox { namespace ole { diff --git a/oox/source/ppt/animationspersist.cxx b/oox/source/ppt/animationspersist.cxx index 456b0616af1c..fdee865251af 100644 --- a/oox/source/ppt/animationspersist.cxx +++ b/oox/source/ppt/animationspersist.cxx @@ -25,8 +25,6 @@ * ************************************************************************/ - - #include "oox/ppt/animationspersist.hxx" #include @@ -38,8 +36,6 @@ #include "oox/drawingml/shape.hxx" -#include "tokens.hxx" - using rtl::OUString; using namespace ::com::sun::star::uno; using namespace ::com::sun::star::presentation; diff --git a/oox/source/ppt/animationtypes.cxx b/oox/source/ppt/animationtypes.cxx index 80d87dd49ad2..6346a8058c5d 100644 --- a/oox/source/ppt/animationtypes.cxx +++ b/oox/source/ppt/animationtypes.cxx @@ -32,8 +32,6 @@ #include "oox/helper/attributelist.hxx" -#include "tokens.hxx" - using namespace ::com::sun::star::uno; using namespace ::com::sun::star::animations; using namespace ::com::sun::star::xml::sax; diff --git a/oox/source/ppt/animvariantcontext.cxx b/oox/source/ppt/animvariantcontext.cxx index e2eca9a36dca..449c4ef73d11 100644 --- a/oox/source/ppt/animvariantcontext.cxx +++ b/oox/source/ppt/animvariantcontext.cxx @@ -35,12 +35,10 @@ #include #include "oox/helper/attributelist.hxx" -#include "oox/core/namespaces.hxx" #include "oox/core/fragmenthandler.hxx" #include "oox/core/xmlfilterbase.hxx" #include "oox/drawingml/colorchoicecontext.hxx" #include "pptfilterhelpers.hxx" -#include "tokens.hxx" using ::rtl::OUString; using namespace ::oox::core; @@ -80,29 +78,29 @@ namespace oox { namespace ppt { switch( aElementToken ) { - case NMSP_PPT|XML_boolVal: + case PPT_TOKEN( boolVal ): { bool val = attribs.getBool( XML_val, false ); maValue = makeAny( val ); break; } - case NMSP_PPT|XML_clrVal: + case PPT_TOKEN( clrVal ): xRet.set( new ::oox::drawingml::ColorContext( *this, maColor ) ); // we'll defer setting the Any until the end. break; - case NMSP_PPT|XML_fltVal: + case PPT_TOKEN( fltVal ): { double val = attribs.getDouble( XML_val, 0.0 ); maValue = makeAny( val ); break; } - case NMSP_PPT|XML_intVal: + case PPT_TOKEN( intVal ): { sal_Int32 val = attribs.getInteger( XML_val, 0 ); maValue = makeAny( val ); break; } - case NMSP_PPT|XML_strVal: + case PPT_TOKEN( strVal ): { OUString val = attribs.getString( XML_val, OUString() ); convertMeasure( val ); // ignore success or failure if it fails, use as is diff --git a/oox/source/ppt/backgroundproperties.cxx b/oox/source/ppt/backgroundproperties.cxx index 5b6fc4076a80..65664bdd3691 100644 --- a/oox/source/ppt/backgroundproperties.cxx +++ b/oox/source/ppt/backgroundproperties.cxx @@ -28,8 +28,6 @@ #include "oox/ppt/backgroundproperties.hxx" #include "oox/drawingml/fillpropertiesgroupcontext.hxx" #include "oox/drawingml/drawingmltypes.hxx" -#include "oox/core/namespaces.hxx" -#include "tokens.hxx" using ::rtl::OUString; using namespace ::oox::core; @@ -51,7 +49,7 @@ Reference< XFastContextHandler > BackgroundPropertiesContext::createFastChildCon switch( aElementToken ) { - case NMSP_PPT|XML_fill: // a:CT_FillEffect + case PPT_TOKEN( fill ): // a:CT_FillEffect break; } diff --git a/oox/source/ppt/buildlistcontext.cxx b/oox/source/ppt/buildlistcontext.cxx index 61148265dfbe..3352e202e057 100644 --- a/oox/source/ppt/buildlistcontext.cxx +++ b/oox/source/ppt/buildlistcontext.cxx @@ -28,7 +28,6 @@ #include "buildlistcontext.hxx" #include #include "oox/helper/attributelist.hxx" -#include "oox/core/namespaces.hxx" using namespace ::oox::core; @@ -56,7 +55,7 @@ namespace oox { namespace ppt { { switch( aElement ) { - case NMSP_PPT|XML_bldGraphic: + case PPT_TOKEN( bldGraphic ): mbInBldGraphic = false; break; default: @@ -72,18 +71,18 @@ namespace oox { namespace ppt { switch( aElementToken ) { - case NMSP_PPT|XML_bldAsOne: + case PPT_TOKEN( bldAsOne ): if( mbInBldGraphic ) { mbBuildAsOne = true; } break; - case NMSP_PPT|XML_bldSub: + case PPT_TOKEN( bldSub ): if( mbInBldGraphic ) { } break; - case NMSP_PPT|XML_bldGraphic: + case PPT_TOKEN( bldGraphic ): { mbInBldGraphic = true; AttributeList attribs( xAttribs ); @@ -94,9 +93,9 @@ namespace oox { namespace ppt { // sal_uInt32 nGroupId = attribs.getUnsignedInteger( XML_grpId, 0 ); break; } - case NMSP_DRAWINGML|XML_bldDgm: - case NMSP_DRAWINGML|XML_bldOleChart: - case NMSP_DRAWINGML|XML_bldP: + case A_TOKEN( bldDgm ): + case A_TOKEN( bldOleChart ): + case A_TOKEN( bldP ): break; default: diff --git a/oox/source/ppt/commonbehaviorcontext.cxx b/oox/source/ppt/commonbehaviorcontext.cxx index 36841bab5aae..a4e3951228ae 100644 --- a/oox/source/ppt/commonbehaviorcontext.cxx +++ b/oox/source/ppt/commonbehaviorcontext.cxx @@ -34,14 +34,12 @@ #include #include -#include "oox/core/namespaces.hxx" #include "oox/core/fragmenthandler.hxx" #include "commonbehaviorcontext.hxx" #include "commontimenodecontext.hxx" #include "timetargetelementcontext.hxx" #include "pptfilterhelpers.hxx" -#include "tokens.hxx" #include @@ -57,7 +55,7 @@ namespace oox { namespace ppt { CommonBehaviorContext::CommonBehaviorContext( ContextHandler& rParent, const Reference< XFastAttributeList >& xAttribs, const TimeNodePtr & pNode ) - : TimeNodeContext( rParent, NMSP_PPT|XML_cBhvr, xAttribs, pNode ) + : TimeNodeContext( rParent, PPT_TOKEN( cBhvr ), xAttribs, pNode ) , mbInAttrList( false ) , mbIsInAttrName( false ) { @@ -75,7 +73,7 @@ namespace oox { namespace ppt { { switch( aElement ) { - case NMSP_PPT|XML_cBhvr: + case PPT_TOKEN( cBhvr ): { if( !maAttributes.empty() ) { @@ -94,10 +92,10 @@ namespace oox { namespace ppt { } break; } - case NMSP_PPT|XML_attrNameLst: + case PPT_TOKEN( attrNameLst ): mbInAttrList = false; break; - case NMSP_PPT|XML_attrName: + case PPT_TOKEN( attrName ): if( mbIsInAttrName ) { const ImplAttributeNameConversion *attrConv = gImplConversionList; @@ -145,16 +143,16 @@ namespace oox { namespace ppt { switch ( aElementToken ) { - case NMSP_PPT|XML_cTn: + case PPT_TOKEN( cTn ): xRet.set( new CommonTimeNodeContext( *this, aElementToken, xAttribs, mpNode ) ); break; - case NMSP_PPT|XML_tgtEl: + case PPT_TOKEN( tgtEl ): xRet.set( new TimeTargetElementContext( *this, mpNode->getTarget() ) ); break; - case NMSP_PPT|XML_attrNameLst: + case PPT_TOKEN( attrNameLst ): mbInAttrList = true; break; - case NMSP_PPT|XML_attrName: + case PPT_TOKEN( attrName ): { if( mbInAttrList ) { diff --git a/oox/source/ppt/commontimenodecontext.cxx b/oox/source/ppt/commontimenodecontext.cxx index d7de40255298..1057deb70c5d 100644 --- a/oox/source/ppt/commontimenodecontext.cxx +++ b/oox/source/ppt/commontimenodecontext.cxx @@ -42,13 +42,11 @@ #include #include "oox/helper/attributelist.hxx" -#include "oox/core/namespaces.hxx" #include "oox/core/fragmenthandler.hxx" #include "oox/ppt/pptimport.hxx" #include "oox/drawingml/drawingmltypes.hxx" #include "animationtypes.hxx" -#include "tokens.hxx" using namespace ::oox::core; using namespace ::com::sun::star::uno; @@ -619,7 +617,7 @@ static OUString getConvertedSubType( sal_Int16 nPresetClass, sal_Int32 nPresetId void SAL_CALL CommonTimeNodeContext::endFastElement( sal_Int32 aElement ) throw ( SAXException, RuntimeException) { - if( aElement == ( NMSP_PPT|XML_iterate ) ) + if( aElement == ( PPT_TOKEN( iterate ) ) ) { mbIterate = false; } @@ -632,22 +630,22 @@ static OUString getConvertedSubType( sal_Int16 nPresetClass, sal_Int32 nPresetId switch ( aElementToken ) { - case NMSP_PPT|XML_childTnLst: - case NMSP_PPT|XML_subTnLst: + case PPT_TOKEN( childTnLst ): + case PPT_TOKEN( subTnLst ): xRet.set( new TimeNodeListContext( *this, mpNode->getChildren() ) ); break; - case NMSP_PPT|XML_stCondLst: + case PPT_TOKEN( stCondLst ): xRet.set( new CondListContext( *this, aElementToken, xAttribs, mpNode, mpNode->getStartCondition() ) ); break; - case NMSP_PPT|XML_endCondLst: + case PPT_TOKEN( endCondLst ): xRet.set( new CondListContext( *this, aElementToken, xAttribs, mpNode, mpNode->getEndCondition() ) ); break; - case NMSP_PPT|XML_endSync: + case PPT_TOKEN( endSync ): xRet.set( new CondContext( *this, xAttribs, mpNode, mpNode->getEndSyncValue() ) ); break; - case NMSP_PPT|XML_iterate: + case PPT_TOKEN( iterate ): { sal_Int32 nVal = xAttribs->getOptionalValueToken( XML_type, XML_el ); if( nVal != 0 ) @@ -680,7 +678,7 @@ static OUString getConvertedSubType( sal_Int16 nPresetClass, sal_Int32 nPresetId mbIterate = true; break; } - case NMSP_PPT|XML_tmAbs: + case PPT_TOKEN( tmAbs ): if( mbIterate ) { AttributeList attribs( xAttribs ); @@ -689,7 +687,7 @@ static OUString getConvertedSubType( sal_Int16 nPresetClass, sal_Int32 nPresetId mpNode->getNodeProperties()[ NP_ITERATEINTERVAL ] <<= fTime; } break; - case NMSP_PPT|XML_tmPct: + case PPT_TOKEN( tmPct ): if( mbIterate ) { AttributeList attribs( xAttribs ); diff --git a/oox/source/ppt/conditioncontext.cxx b/oox/source/ppt/conditioncontext.cxx index e52d8b27a464..5b622b6ef602 100644 --- a/oox/source/ppt/conditioncontext.cxx +++ b/oox/source/ppt/conditioncontext.cxx @@ -37,13 +37,11 @@ #include #include "oox/helper/attributelist.hxx" -#include "oox/core/namespaces.hxx" #include "oox/core/contexthandler.hxx" #include "oox/ppt/animationspersist.hxx" #include "animationtypes.hxx" #include "timetargetelementcontext.hxx" -#include "tokens.hxx" using namespace ::oox::core; using namespace ::com::sun::star::uno; @@ -54,7 +52,7 @@ namespace oox { namespace ppt { CondContext::CondContext( ContextHandler& rParent, const Reference< XFastAttributeList >& xAttribs, const TimeNodePtr & pNode, AnimationCondition & aValue ) - : TimeNodeContext( rParent, NMSP_PPT|XML_cond, xAttribs, pNode ) + : TimeNodeContext( rParent, PPT_TOKEN( cond ), xAttribs, pNode ) , maCond( aValue ) { maEvent.Trigger = EventTrigger::NONE; @@ -123,7 +121,7 @@ namespace oox { namespace ppt { switch( aElementToken ) { - case NMSP_PPT|XML_rtn: + case PPT_TOKEN( rtn ): { // ST_TLTriggerRuntimeNode { first, last, all } sal_Int32 aTok; @@ -147,7 +145,7 @@ namespace oox { namespace ppt { maCond.maValue = makeAny( nEnum ); break; } - case NMSP_PPT|XML_tn: + case PPT_TOKEN( tn ): { maCond.mnType = aElementToken; AttributeList attribs( xAttribs ); @@ -155,7 +153,7 @@ namespace oox { namespace ppt { maCond.maValue = makeAny( nId ); break; } - case NMSP_PPT|XML_tgtEl: + case PPT_TOKEN( tgtEl ): // CT_TLTimeTargetElement xRet.set( new TimeTargetElementContext( *this, maCond.getTarget() ) ); break; @@ -194,7 +192,7 @@ namespace oox { namespace ppt { switch( aElement ) { - case NMSP_PPT|XML_cond: + case PPT_TOKEN( cond ): // add a condition to the list maConditions.push_back( AnimationCondition() ); xRet.set( new CondContext( *this, xAttribs, mpNode, maConditions.back() ) ); diff --git a/oox/source/ppt/customshowlistcontext.cxx b/oox/source/ppt/customshowlistcontext.cxx index 613000d07d41..f66ccb0f6084 100644 --- a/oox/source/ppt/customshowlistcontext.cxx +++ b/oox/source/ppt/customshowlistcontext.cxx @@ -26,9 +26,6 @@ ************************************************************************/ #include "customshowlistcontext.hxx" -#include "oox/core/namespaces.hxx" -#include "tokens.hxx" - using namespace ::oox::core; using namespace ::com::sun::star::uno; @@ -71,8 +68,8 @@ Reference< XFastContextHandler > SAL_CALL CustomShowContext::createFastChildCont Reference< XFastContextHandler > xRet; switch( aElementToken ) { - case NMSP_PPT|XML_sld : - mrCustomShow.maSldLst.push_back( xAttribs->getOptionalValue( NMSP_RELATIONSHIPS | XML_id ) ); + case PPT_TOKEN( sld ) : + mrCustomShow.maSldLst.push_back( xAttribs->getOptionalValue( R_TOKEN( id ) ) ); default: break; } @@ -102,7 +99,7 @@ Reference< XFastContextHandler > SAL_CALL CustomShowListContext::createFastChild Reference< XFastContextHandler > xRet; switch( aElementToken ) { - case NMSP_PPT|XML_custShow : + case PPT_TOKEN( custShow ) : { CustomShow aCustomShow; mrCustomShowList.push_back( aCustomShow ); diff --git a/oox/source/ppt/headerfootercontext.cxx b/oox/source/ppt/headerfootercontext.cxx index 69f23b77c0da..2089b019c58c 100644 --- a/oox/source/ppt/headerfootercontext.cxx +++ b/oox/source/ppt/headerfootercontext.cxx @@ -26,9 +26,7 @@ ************************************************************************/ #include "headerfootercontext.hxx" -#include "oox/core/namespaces.hxx" #include "oox/helper/attributelist.hxx" -#include "tokens.hxx" using namespace ::oox::core; using namespace ::com::sun::star::uno; diff --git a/oox/source/ppt/layoutfragmenthandler.cxx b/oox/source/ppt/layoutfragmenthandler.cxx index d291550ac321..152beb280bd7 100644 --- a/oox/source/ppt/layoutfragmenthandler.cxx +++ b/oox/source/ppt/layoutfragmenthandler.cxx @@ -34,8 +34,6 @@ #include "headerfootercontext.hxx" #include "oox/ppt/layoutfragmenthandler.hxx" #include "oox/drawingml/shapegroupcontext.hxx" -#include "oox/core/namespaces.hxx" -#include "tokens.hxx" using rtl::OUString; using namespace ::com::sun::star; @@ -67,10 +65,10 @@ Reference< XFastContextHandler > LayoutFragmentHandler::createFastChildContext( Reference< XFastContextHandler > xRet = getFastContextHandler(); switch( aElementToken ) { - case NMSP_PPT|XML_sldLayout: // CT_SlideLayout + case PPT_TOKEN( sldLayout ): // CT_SlideLayout mpSlidePersistPtr->setLayoutValueToken( xAttribs->getOptionalValueToken( XML_type, 0 ) ); // CT_SlideLayoutType break; - case NMSP_PPT|XML_hf: // CT_HeaderFooter + case PPT_TOKEN( hf ): // CT_HeaderFooter xRet.set( new HeaderFooterContext( *this, xAttribs, mpSlidePersistPtr->getHeaderFooter() ) ); break; default: diff --git a/oox/source/ppt/pptimport.cxx b/oox/source/ppt/pptimport.cxx index 249db6c09426..625e4e662e3c 100644 --- a/oox/source/ppt/pptimport.cxx +++ b/oox/source/ppt/pptimport.cxx @@ -75,9 +75,9 @@ bool PowerPointImport::importDocument() throw() file:////source/dump/pptxdumper.ini. */ OOX_DUMP_FILE( ::oox::dump::pptx::Dumper ); - OUString aFragmentPath = getFragmentPathFromFirstType( CREATE_OFFICEDOC_RELATIONSTYPE( "officeDocument" ) ); + OUString aFragmentPath = getFragmentPathFromFirstType( CREATE_OFFICEDOC_RELATION_TYPE( "officeDocument" ) ); FragmentHandlerRef xPresentationFragmentHandler( new PresentationFragmentHandler( *this, aFragmentPath ) ); - maTableStyleListPath = xPresentationFragmentHandler->getFragmentPathFromFirstType( CREATE_OFFICEDOC_RELATIONSTYPE( "tableStyles" ) ); + maTableStyleListPath = xPresentationFragmentHandler->getFragmentPathFromFirstType( CREATE_OFFICEDOC_RELATION_TYPE( "tableStyles" ) ); return importFragment( xPresentationFragmentHandler ); diff --git a/oox/source/ppt/pptshape.cxx b/oox/source/ppt/pptshape.cxx index 60144bbbe79d..7437b378b324 100644 --- a/oox/source/ppt/pptshape.cxx +++ b/oox/source/ppt/pptshape.cxx @@ -26,10 +26,8 @@ ************************************************************************/ #include "oox/ppt/pptshape.hxx" -#include "oox/core/namespaces.hxx" #include "oox/core/xmlfilterbase.hxx" #include "oox/drawingml/textbody.hxx" -#include "tokens.hxx" #include #include diff --git a/oox/source/ppt/pptshapecontext.cxx b/oox/source/ppt/pptshapecontext.cxx index c59638553018..7df41ac3d714 100644 --- a/oox/source/ppt/pptshapecontext.cxx +++ b/oox/source/ppt/pptshapecontext.cxx @@ -37,14 +37,11 @@ #include "oox/ppt/pptshapepropertiescontext.hxx" #include "oox/ppt/slidepersist.hxx" #include "oox/drawingml/shapestylecontext.hxx" -#include "oox/core/namespaces.hxx" #include "oox/drawingml/fillpropertiesgroupcontext.hxx" #include "oox/drawingml/lineproperties.hxx" #include "oox/drawingml/drawingmltypes.hxx" #include "oox/drawingml/customshapegeometry.hxx" #include "oox/drawingml/textbodycontext.hxx" -#include "tokens.hxx" -#include "properties.hxx" using rtl::OUString; using namespace oox::core; @@ -102,9 +99,9 @@ Reference< XFastContextHandler > PPTShapeContext::createFastChildContext( sal_In switch( aElementToken ) { // nvSpPr CT_ShapeNonVisual begin - // case NMSP_PPT|XML_drElemPr: + // case PPT_TOKEN( drElemPr ): // break; - case NMSP_PPT|XML_cNvPr: + case PPT_TOKEN( cNvPr ): { AttributeList aAttribs( xAttribs ); mpShapePtr->setHidden( aAttribs.getBool( XML_hidden, false ) ); @@ -112,7 +109,7 @@ Reference< XFastContextHandler > PPTShapeContext::createFastChildContext( sal_In mpShapePtr->setName( xAttribs->getOptionalValue( XML_name ) ); break; } - case NMSP_PPT|XML_ph: + case PPT_TOKEN( ph ): { sal_Int32 nSubType( xAttribs->getOptionalValueToken( XML_type, XML_obj ) ); mpShapePtr->setSubType( nSubType ); @@ -191,15 +188,15 @@ Reference< XFastContextHandler > PPTShapeContext::createFastChildContext( sal_In // nvSpPr CT_ShapeNonVisual end - case NMSP_PPT|XML_spPr: + case PPT_TOKEN( spPr ): xRet = new PPTShapePropertiesContext( *this, *mpShapePtr ); break; - case NMSP_PPT|XML_style: + case PPT_TOKEN( style ): xRet = new oox::drawingml::ShapeStyleContext( *this, *mpShapePtr ); break; - case NMSP_PPT|XML_txBody: + case PPT_TOKEN( txBody ): { oox::drawingml::TextBodyPtr xTextBody( new oox::drawingml::TextBody ); xTextBody->getTextProperties().maPropertyMap[ PROP_FontIndependentLineSpacing ] <<= static_cast< sal_Bool >( sal_True ); diff --git a/oox/source/ppt/pptshapegroupcontext.cxx b/oox/source/ppt/pptshapegroupcontext.cxx index 074393874264..0ba36ee99417 100644 --- a/oox/source/ppt/pptshapegroupcontext.cxx +++ b/oox/source/ppt/pptshapegroupcontext.cxx @@ -39,8 +39,6 @@ #include "oox/drawingml/customshapegeometry.hxx" #include "oox/drawingml/textbodycontext.hxx" #include "oox/drawingml/connectorshapecontext.hxx" -#include "oox/core/namespaces.hxx" -#include "tokens.hxx" using rtl::OUString; using namespace oox::core; @@ -71,7 +69,7 @@ Reference< XFastContextHandler > PPTShapeGroupContext::createFastChildContext( s switch( aElementToken ) { - case NMSP_PPT|XML_cNvPr: + case PPT_TOKEN( cNvPr ): { AttributeList aAttribs( xAttribs ); mpGroupShapePtr->setHidden( aAttribs.getBool( XML_hidden, false ) ); @@ -79,36 +77,36 @@ Reference< XFastContextHandler > PPTShapeGroupContext::createFastChildContext( s mpGroupShapePtr->setName( xAttribs->getOptionalValue( XML_name ) ); break; } - case NMSP_PPT|XML_ph: + case PPT_TOKEN( ph ): mpGroupShapePtr->setSubType( xAttribs->getOptionalValueToken( XML_type, FastToken::DONTKNOW ) ); mpGroupShapePtr->setSubTypeIndex( xAttribs->getOptionalValue( XML_idx ).toInt32() ); break; // nvSpPr CT_ShapeNonVisual end - case NMSP_PPT|XML_grpSpPr: + case PPT_TOKEN( grpSpPr ): xRet = new oox::drawingml::ShapePropertiesContext( *this, *mpGroupShapePtr ); break; - case NMSP_PPT|XML_spPr: + case PPT_TOKEN( spPr ): xRet = new oox::drawingml::ShapePropertiesContext( *this, *mpGroupShapePtr ); break; /* - case NMSP_PPT|XML_style: + case PPT_TOKEN( style ): xRet = new ShapeStyleContext( getParser() ); break; */ - case NMSP_PPT|XML_cxnSp: // connector shape + case PPT_TOKEN( cxnSp ): // connector shape xRet.set( new oox::drawingml::ConnectorShapeContext( *this, mpGroupShapePtr, oox::drawingml::ShapePtr( new PPTShape( meShapeLocation, "com.sun.star.drawing.ConnectorShape" ) ) ) ); break; - case NMSP_PPT|XML_grpSp: // group shape + case PPT_TOKEN( grpSp ): // group shape xRet.set( new PPTShapeGroupContext( *this, mpSlidePersistPtr, meShapeLocation, mpGroupShapePtr, oox::drawingml::ShapePtr( new PPTShape( meShapeLocation, "com.sun.star.drawing.GroupShape" ) ) ) ); break; - case NMSP_PPT|XML_sp: // Shape + case PPT_TOKEN( sp ): // Shape xRet.set( new PPTShapeContext( *this, mpSlidePersistPtr, mpGroupShapePtr, oox::drawingml::ShapePtr( new PPTShape( meShapeLocation, "com.sun.star.drawing.CustomShape" ) ) ) ); break; - case NMSP_PPT|XML_pic: // CT_Picture + case PPT_TOKEN( pic ): // CT_Picture xRet.set( new oox::drawingml::GraphicShapeContext( *this, mpGroupShapePtr, oox::drawingml::ShapePtr( new PPTShape( meShapeLocation, "com.sun.star.drawing.GraphicObjectShape" ) ) ) ); break; - case NMSP_PPT|XML_graphicFrame: // CT_GraphicalObjectFrame + case PPT_TOKEN( graphicFrame ): // CT_GraphicalObjectFrame xRet.set( new oox::drawingml::GraphicalObjectFrameContext( *this, mpGroupShapePtr, oox::drawingml::ShapePtr( new PPTShape( meShapeLocation, "com.sun.star.drawing.OLE2Shape" ) ), true ) ); break; diff --git a/oox/source/ppt/pptshapepropertiescontext.cxx b/oox/source/ppt/pptshapepropertiescontext.cxx index b4af0f08a555..bddd74f4837a 100644 --- a/oox/source/ppt/pptshapepropertiescontext.cxx +++ b/oox/source/ppt/pptshapepropertiescontext.cxx @@ -35,14 +35,11 @@ #include "oox/ppt/pptshapepropertiescontext.hxx" #include "oox/ppt/slidepersist.hxx" #include "oox/drawingml/shapestylecontext.hxx" -#include "oox/core/namespaces.hxx" #include "oox/drawingml/fillpropertiesgroupcontext.hxx" #include "oox/drawingml/lineproperties.hxx" #include "oox/drawingml/drawingmltypes.hxx" #include "oox/drawingml/customshapegeometry.hxx" #include "oox/drawingml/textbodycontext.hxx" -#include "properties.hxx" -#include "tokens.hxx" using rtl::OUString; using namespace oox::core; @@ -68,7 +65,7 @@ Reference< XFastContextHandler > PPTShapePropertiesContext::createFastChildConte switch( aElementToken ) { - case NMSP_DRAWINGML | XML_xfrm: + case A_TOKEN( xfrm ): { mrShape.getShapeProperties()[ PROP_IsPlaceholderDependent ] <<= sal_False; diff --git a/oox/source/ppt/presentationfragmenthandler.cxx b/oox/source/ppt/presentationfragmenthandler.cxx index 786836fbc554..6976c965ad83 100644 --- a/oox/source/ppt/presentationfragmenthandler.cxx +++ b/oox/source/ppt/presentationfragmenthandler.cxx @@ -46,8 +46,6 @@ #include "oox/ppt/slidefragmenthandler.hxx" #include "oox/ppt/layoutfragmenthandler.hxx" #include "oox/ppt/pptimport.hxx" -#include "oox/core/namespaces.hxx" -#include "tokens.hxx" using rtl::OUString; using namespace ::com::sun::star; @@ -182,12 +180,12 @@ void PresentationFragmentHandler::endDocument() throw (SAXException, RuntimeExce FragmentHandlerRef xSlideFragmentHandler( new SlideFragmentHandler( rFilter, aSlideFragmentPath, pSlidePersistPtr, Slide ) ); // importing the corresponding masterpage/layout - OUString aLayoutFragmentPath = xSlideFragmentHandler->getFragmentPathFromFirstType( CREATE_OFFICEDOC_RELATIONSTYPE( "slideLayout" ) ); + OUString aLayoutFragmentPath = xSlideFragmentHandler->getFragmentPathFromFirstType( CREATE_OFFICEDOC_RELATION_TYPE( "slideLayout" ) ); if ( aLayoutFragmentPath.getLength() > 0 ) { // importing layout RelationsRef xLayoutRelations = rFilter.importRelations( aLayoutFragmentPath ); - OUString aMasterFragmentPath = xLayoutRelations->getFragmentPathFromFirstType( CREATE_OFFICEDOC_RELATIONSTYPE( "slideMaster" ) ); + OUString aMasterFragmentPath = xLayoutRelations->getFragmentPathFromFirstType( CREATE_OFFICEDOC_RELATION_TYPE( "slideMaster" ) ); if( aMasterFragmentPath.getLength() ) { // check if the corresponding masterpage+layout has already been imported @@ -221,7 +219,7 @@ void PresentationFragmentHandler::endDocument() throw (SAXException, RuntimeExce FragmentHandlerRef xMasterFragmentHandler( new SlideFragmentHandler( rFilter, aMasterFragmentPath, pMasterPersistPtr, Master ) ); // set the correct theme - OUString aThemeFragmentPath = xMasterFragmentHandler->getFragmentPathFromFirstType( CREATE_OFFICEDOC_RELATIONSTYPE( "theme" ) ); + OUString aThemeFragmentPath = xMasterFragmentHandler->getFragmentPathFromFirstType( CREATE_OFFICEDOC_RELATION_TYPE( "theme" ) ); if( aThemeFragmentPath.getLength() > 0 ) { std::map< OUString, oox::drawingml::ThemePtr >& rThemes( rFilter.getThemes() ); @@ -259,7 +257,7 @@ void PresentationFragmentHandler::endDocument() throw (SAXException, RuntimeExce pSlidePersistPtr->createXShapes( rFilter ); // now importing the notes page - OUString aNotesFragmentPath = xSlideFragmentHandler->getFragmentPathFromFirstType( CREATE_OFFICEDOC_RELATIONSTYPE( "notesSlide" ) ); + OUString aNotesFragmentPath = xSlideFragmentHandler->getFragmentPathFromFirstType( CREATE_OFFICEDOC_RELATION_TYPE( "notesSlide" ) ); if( aNotesFragmentPath.getLength() > 0 ) { Reference< XPresentationPage > xPresentationPage( xSlide, UNO_QUERY ); @@ -305,30 +303,30 @@ Reference< XFastContextHandler > PresentationFragmentHandler::createFastChildCon Reference< XFastContextHandler > xRet; switch( aElementToken ) { - case NMSP_PPT|XML_presentation: - case NMSP_PPT|XML_sldMasterIdLst: - case NMSP_PPT|XML_notesMasterIdLst: - case NMSP_PPT|XML_sldIdLst: + case PPT_TOKEN( presentation ): + case PPT_TOKEN( sldMasterIdLst ): + case PPT_TOKEN( notesMasterIdLst ): + case PPT_TOKEN( sldIdLst ): break; - case NMSP_PPT|XML_sldMasterId: - maSlideMasterVector.push_back( xAttribs->getOptionalValue( NMSP_RELATIONSHIPS|XML_id ) ); + case PPT_TOKEN( sldMasterId ): + maSlideMasterVector.push_back( xAttribs->getOptionalValue( R_TOKEN( id ) ) ); break; - case NMSP_PPT|XML_sldId: - maSlidesVector.push_back( xAttribs->getOptionalValue( NMSP_RELATIONSHIPS|XML_id ) ); + case PPT_TOKEN( sldId ): + maSlidesVector.push_back( xAttribs->getOptionalValue( R_TOKEN( id ) ) ); break; - case NMSP_PPT|XML_notesMasterId: - maNotesMasterVector.push_back( xAttribs->getOptionalValue(NMSP_RELATIONSHIPS|XML_id ) ); + case PPT_TOKEN( notesMasterId ): + maNotesMasterVector.push_back( xAttribs->getOptionalValue(R_TOKEN( id ) ) ); break; - case NMSP_PPT|XML_sldSz: + case PPT_TOKEN( sldSz ): maSlideSize = GetSize2D( xAttribs ); break; - case NMSP_PPT|XML_notesSz: + case PPT_TOKEN( notesSz ): maNotesSize = GetSize2D( xAttribs ); break; - case NMSP_PPT|XML_custShowLst: + case PPT_TOKEN( custShowLst ): xRet.set( new CustomShowListContext( *this, maCustomShowList ) ); break; - case NMSP_PPT|XML_defaultTextStyle: + case PPT_TOKEN( defaultTextStyle ): xRet.set( new TextListStyleContext( *this, *mpTextListStyle ) ); break; } diff --git a/oox/source/ppt/slidefragmenthandler.cxx b/oox/source/ppt/slidefragmenthandler.cxx index 69f32e01e7eb..cfbb2db2bece 100644 --- a/oox/source/ppt/slidefragmenthandler.cxx +++ b/oox/source/ppt/slidefragmenthandler.cxx @@ -31,10 +31,7 @@ #include #include -#include "tokens.hxx" -#include "properties.hxx" #include "oox/helper/propertyset.hxx" -#include "oox/core/namespaces.hxx" #include "oox/core/xmlfilterbase.hxx" #include "headerfootercontext.hxx" #include "oox/ppt/backgroundproperties.hxx" @@ -65,7 +62,7 @@ SlideFragmentHandler::SlideFragmentHandler( XmlFilterBase& rFilter, const OUStri , mpSlidePersistPtr( pPersistPtr ) , meShapeLocation( eShapeLocation ) { - OUString aVMLDrawingFragmentPath = getFragmentPathFromFirstType( CREATE_OFFICEDOC_RELATIONSTYPE( "vmlDrawing" ) ); + OUString aVMLDrawingFragmentPath = getFragmentPathFromFirstType( CREATE_OFFICEDOC_RELATION_TYPE( "vmlDrawing" ) ); if( aVMLDrawingFragmentPath.getLength() > 0 ) getFilter().importFragment( new oox::vml::DrawingFragment( getFilter(), aVMLDrawingFragmentPath, *pPersistPtr->getDrawing() ) ); @@ -84,9 +81,9 @@ Reference< XFastContextHandler > SlideFragmentHandler::createFastChildContext( s switch( aElementToken ) { - case NMSP_PPT|XML_sldMaster: // CT_SlideMaster - case NMSP_PPT|XML_handoutMaster: // CT_HandoutMaster - case NMSP_PPT|XML_sld: // CT_CommonSlideData + case PPT_TOKEN( sldMaster ): // CT_SlideMaster + case PPT_TOKEN( handoutMaster ): // CT_HandoutMaster + case PPT_TOKEN( sld ): // CT_CommonSlideData { AttributeList attribs( xAttribs ); @@ -99,14 +96,14 @@ Reference< XFastContextHandler > SlideFragmentHandler::createFastChildContext( s break; } - case NMSP_PPT|XML_notes: // CT_NotesSlide - case NMSP_PPT|XML_notesMaster: // CT_NotesMaster + case PPT_TOKEN( notes ): // CT_NotesSlide + case PPT_TOKEN( notesMaster ): // CT_NotesMaster break; - case NMSP_PPT|XML_cSld: // CT_CommonSlideData + case PPT_TOKEN( cSld ): // CT_CommonSlideData maSlideName = xAttribs->getOptionalValue(XML_name); break; - case NMSP_PPT|XML_spTree: // CT_GroupShape + case PPT_TOKEN( spTree ): // CT_GroupShape { xRet.set( new PPTShapeGroupContext( *this, mpSlidePersistPtr, meShapeLocation, mpSlidePersistPtr->getShapes(), @@ -114,10 +111,10 @@ Reference< XFastContextHandler > SlideFragmentHandler::createFastChildContext( s } break; - case NMSP_PPT|XML_controls: + case PPT_TOKEN( controls ): xRet = getFastContextHandler(); break; - case NMSP_PPT|XML_control: + case PPT_TOKEN( control ): { ::oox::vml::ControlInfo aInfo; aInfo.setShapeId( aAttribs.getInteger( XML_spid, 0 ) ); @@ -127,42 +124,42 @@ Reference< XFastContextHandler > SlideFragmentHandler::createFastChildContext( s } return xRet; - case NMSP_PPT|XML_timing: // CT_SlideTiming + case PPT_TOKEN( timing ): // CT_SlideTiming xRet.set( new SlideTimingContext( *this, mpSlidePersistPtr->getTimeNodeList() ) ); break; - case NMSP_PPT|XML_transition: // CT_SlideTransition + case PPT_TOKEN( transition ): // CT_SlideTransition xRet.set( new SlideTransitionContext( *this, xAttribs, maSlideProperties ) ); break; - case NMSP_PPT|XML_hf: + case PPT_TOKEN( hf ): xRet.set( new HeaderFooterContext( *this, xAttribs, mpSlidePersistPtr->getHeaderFooter() ) ); break; // BackgroundGroup - case NMSP_PPT|XML_bgPr: // CT_BackgroundProperties + case PPT_TOKEN( bgPr ): // CT_BackgroundProperties { FillPropertiesPtr pFillPropertiesPtr( new FillProperties ); xRet.set( new BackgroundPropertiesContext( *this, *pFillPropertiesPtr ) ); mpSlidePersistPtr->setBackgroundProperties( pFillPropertiesPtr ); } break; - case NMSP_PPT|XML_bgRef: // a:CT_StyleMatrixReference + case PPT_TOKEN( bgRef ): // a:CT_StyleMatrixReference break; - case NMSP_PPT|XML_clrMap: // CT_ColorMapping + case PPT_TOKEN( clrMap ): // CT_ColorMapping { oox::drawingml::ClrMapPtr pClrMapPtr( new oox::drawingml::ClrMap() ); xRet.set( new oox::drawingml::clrMapContext( *this, xAttribs, *pClrMapPtr ) ); mpSlidePersistPtr->setClrMap( pClrMapPtr ); } break; - case NMSP_PPT|XML_clrMapOvr: // CT_ColorMappingOverride - case NMSP_PPT|XML_sldLayoutIdLst: // CT_SlideLayoutIdList + case PPT_TOKEN( clrMapOvr ): // CT_ColorMappingOverride + case PPT_TOKEN( sldLayoutIdLst ): // CT_SlideLayoutIdList break; - case NMSP_PPT|XML_txStyles: // CT_SlideMasterTextStyles + case PPT_TOKEN( txStyles ): // CT_SlideMasterTextStyles xRet.set( new SlideMasterTextStylesContext( *this, mpSlidePersistPtr ) ); break; - case NMSP_PPT|XML_custDataLst: // CT_CustomerDataList - case NMSP_PPT|XML_tagLst: // CT_TagList + case PPT_TOKEN( custDataLst ): // CT_CustomerDataList + case PPT_TOKEN( tagLst ): // CT_TagList break; } diff --git a/oox/source/ppt/slidemastertextstylescontext.cxx b/oox/source/ppt/slidemastertextstylescontext.cxx index 773730417a27..d4c777102a0a 100644 --- a/oox/source/ppt/slidemastertextstylescontext.cxx +++ b/oox/source/ppt/slidemastertextstylescontext.cxx @@ -28,8 +28,6 @@ #include "oox/drawingml/textliststyle.hxx" #include "oox/drawingml/textliststylecontext.hxx" #include "oox/ppt/slidemastertextstylescontext.hxx" -#include "oox/core/namespaces.hxx" -#include "tokens.hxx" using rtl::OUString; using namespace ::oox::core; @@ -54,22 +52,22 @@ Reference< XFastContextHandler > SlideMasterTextStylesContext::createFastChildCo Reference< XFastContextHandler > xRet; switch( aElementToken ) { - case NMSP_PPT|XML_titleStyle: + case PPT_TOKEN( titleStyle ): { aTextListStylePtr = mpSlidePersistPtr->getTitleTextStyle(); break; } - case NMSP_PPT|XML_bodyStyle: + case PPT_TOKEN( bodyStyle ): { aTextListStylePtr = mpSlidePersistPtr->getBodyTextStyle(); break; } - case NMSP_PPT|XML_notesStyle: + case PPT_TOKEN( notesStyle ): { aTextListStylePtr = mpSlidePersistPtr->getNotesTextStyle(); break; } - case NMSP_PPT|XML_otherStyle: + case PPT_TOKEN( otherStyle ): { aTextListStylePtr = mpSlidePersistPtr->getOtherTextStyle(); break; diff --git a/oox/source/ppt/slidepersist.cxx b/oox/source/ppt/slidepersist.cxx index f4dee1216937..6f1ba8757d21 100644 --- a/oox/source/ppt/slidepersist.cxx +++ b/oox/source/ppt/slidepersist.cxx @@ -31,9 +31,7 @@ #include "oox/ppt/slidepersist.hxx" #include "oox/drawingml/fillproperties.hxx" #include "oox/vml/vmldrawing.hxx" -#include "oox/core/namespaces.hxx" #include "oox/core/xmlfilterbase.hxx" -#include "tokens.hxx" #include #include diff --git a/oox/source/ppt/slidetimingcontext.cxx b/oox/source/ppt/slidetimingcontext.cxx index b64d79c949cf..4357e14ea08e 100644 --- a/oox/source/ppt/slidetimingcontext.cxx +++ b/oox/source/ppt/slidetimingcontext.cxx @@ -34,10 +34,8 @@ #include "oox/ppt/slidefragmenthandler.hxx" #include "oox/drawingml/shapegroupcontext.hxx" #include "oox/helper/attributelist.hxx" -#include "oox/core/namespaces.hxx" #include "oox/ppt/timenodelistcontext.hxx" #include "buildlistcontext.hxx" -#include "tokens.hxx" using rtl::OUString; using namespace ::com::sun::star; @@ -72,12 +70,12 @@ Reference< XFastContextHandler > SlideTimingContext::createFastChildContext( sal switch( aElementToken ) { - case NMSP_PPT|XML_bldLst: + case PPT_TOKEN( bldLst ): xRet.set( new BuildListContext( *this, xAttribs, maTimeNodeList ) ); break; - case NMSP_PPT|XML_extLst: + case PPT_TOKEN( extLst ): return xRet; - case NMSP_PPT|XML_tnLst: + case PPT_TOKEN( tnLst ): // timing nodes { xRet.set( new TimeNodeListContext( *this, maTimeNodeList ) ); diff --git a/oox/source/ppt/slidetransition.cxx b/oox/source/ppt/slidetransition.cxx index ee889e13d840..a380a4d945e1 100644 --- a/oox/source/ppt/slidetransition.cxx +++ b/oox/source/ppt/slidetransition.cxx @@ -35,10 +35,9 @@ #include "oox/helper/helper.hxx" #include "oox/helper/propertymap.hxx" -#include "oox/core/namespaces.hxx" +#include "oox/token/namespaces.hxx" +#include "oox/token/tokens.hxx" #include "pptfilterhelpers.hxx" -#include "properties.hxx" -#include "tokens.hxx" using rtl::OUString; using namespace ::com::sun::star::uno; @@ -256,11 +255,11 @@ namespace oox { namespace ppt { { switch( OoxType ) { - case NMSP_PPT|XML_blinds: + case PPT_TOKEN( blinds ): mnTransitionType = TransitionType::BLINDSWIPE; mnTransitionSubType = ooxToOdpDirection( param1 ); break; - case NMSP_PPT|XML_checker: + case PPT_TOKEN( checker ): mnTransitionType = TransitionType::CHECKERBOARDWIPE; switch ( param1 ) { @@ -274,7 +273,7 @@ namespace oox { namespace ppt { break; } break; - case NMSP_PPT|XML_comb: + case PPT_TOKEN( comb ): mnTransitionType = TransitionType::PUSHWIPE; switch( param1 ) { @@ -288,16 +287,16 @@ namespace oox { namespace ppt { break; } break; - case NMSP_PPT|XML_cover: + case PPT_TOKEN( cover ): mnTransitionType = TransitionType::SLIDEWIPE; mnTransitionSubType = ooxToOdpEightDirections( param1 ); break; - case NMSP_PPT|XML_pull: // uncover + case PPT_TOKEN( pull ): // uncover mnTransitionType = TransitionType::SLIDEWIPE; mnTransitionSubType = ooxToOdpEightDirections( param1 ); mbTransitionDirectionNormal = false; break; - case NMSP_PPT|XML_cut: + case PPT_TOKEN( cut ): // The binfilter seems to ignore this transition. // Fade to black instead if thrBlk is true. if( param1 ) @@ -307,7 +306,7 @@ namespace oox { namespace ppt { } OSL_TRACE( "OOX: cut transition fallback." ); break; - case NMSP_PPT|XML_fade: + case PPT_TOKEN( fade ): mnTransitionType = TransitionType::FADE; if( param1 ) { @@ -318,16 +317,16 @@ namespace oox { namespace ppt { mnTransitionSubType = TransitionSubType::CROSSFADE; } break; - case NMSP_PPT|XML_push: + case PPT_TOKEN( push ): mnTransitionType = TransitionType::PUSHWIPE; mnTransitionSubType = ooxToOdpBorderDirections( param1 ); break; - case NMSP_PPT|XML_wipe: + case PPT_TOKEN( wipe ): mnTransitionType = TransitionType::BARWIPE; mnTransitionSubType = ooxToOdpSideDirections( param1 ); mbTransitionDirectionNormal = ooxToOdpSideDirectionsDirectionNormal( param1 ); break; - case NMSP_PPT|XML_split: + case PPT_TOKEN( split ): mnTransitionType = TransitionType::BARNDOORWIPE; mnTransitionSubType = ooxToOdpDirection( param1 ); if( param2 == XML_in ) @@ -336,7 +335,7 @@ namespace oox { namespace ppt { mbTransitionDirectionNormal = false; } break; - case NMSP_PPT|XML_wheel: + case PPT_TOKEN( wheel ): mnTransitionType = TransitionType::PINWHEELWIPE; switch( param1 ) { @@ -372,40 +371,40 @@ namespace oox { namespace ppt { break; } break; - case NMSP_PPT|XML_randomBar: + case PPT_TOKEN( randomBar ): mnTransitionType = TransitionType::RANDOMBARWIPE; mnTransitionSubType = ooxToOdpDirection( param1 ); break; - case NMSP_PPT|XML_circle: + case PPT_TOKEN( circle ): mnTransitionType = TransitionType::ELLIPSEWIPE; mnTransitionSubType = TransitionSubType::CIRCLE; break; - case NMSP_PPT|XML_diamond: + case PPT_TOKEN( diamond ): mnTransitionType = TransitionType::IRISWIPE; mnTransitionSubType = TransitionSubType::DIAMOND; break; - case NMSP_PPT|XML_dissolve: + case PPT_TOKEN( dissolve ): mnTransitionType = TransitionType::DISSOLVE; mnTransitionSubType = TransitionSubType::DEFAULT; break; - case NMSP_PPT|XML_newsflash: + case PPT_TOKEN( newsflash ): // this is what the PPT binary filter does.... not sure I agree. mnTransitionType = TransitionType::FOURBOXWIPE; mnTransitionSubType = TransitionSubType::CORNERSOUT; break; - case NMSP_PPT|XML_plus: + case PPT_TOKEN( plus ): mnTransitionType = TransitionType::FOURBOXWIPE; mnTransitionSubType = TransitionSubType::CORNERSOUT; break; - case NMSP_PPT|XML_random: + case PPT_TOKEN( random ): mnTransitionType = TransitionType::RANDOM; mnTransitionSubType = TransitionSubType::DEFAULT; break; - case NMSP_PPT|XML_wedge: + case PPT_TOKEN( wedge ): mnTransitionType = TransitionType::FANWIPE; mnTransitionSubType = TransitionSubType::CENTERTOP; break; - case NMSP_PPT|XML_zoom: + case PPT_TOKEN( zoom ): mnTransitionType = TransitionType::ZOOM; mnTransitionSubType = TransitionSubType::DEFAULT; break; diff --git a/oox/source/ppt/slidetransitioncontext.cxx b/oox/source/ppt/slidetransitioncontext.cxx index 92993d754ada..4c5ae7dcc65f 100644 --- a/oox/source/ppt/slidetransitioncontext.cxx +++ b/oox/source/ppt/slidetransitioncontext.cxx @@ -38,9 +38,6 @@ #include "oox/ppt/soundactioncontext.hxx" #include "oox/drawingml/shapegroupcontext.hxx" #include "oox/helper/attributelist.hxx" -#include "oox/core/namespaces.hxx" - -#include "tokens.hxx" using rtl::OUString; using namespace ::com::sun::star; @@ -86,10 +83,10 @@ Reference< XFastContextHandler > SlideTransitionContext::createFastChildContext( switch( aElementToken ) { - case NMSP_PPT|XML_blinds: - case NMSP_PPT|XML_checker: - case NMSP_PPT|XML_comb: - case NMSP_PPT|XML_randomBar: + case PPT_TOKEN( blinds ): + case PPT_TOKEN( checker ): + case PPT_TOKEN( comb ): + case PPT_TOKEN( randomBar ): if (!mbHasTransition) { mbHasTransition = true; @@ -97,8 +94,8 @@ Reference< XFastContextHandler > SlideTransitionContext::createFastChildContext( // ST_Direction { XML_horz, XML_vert } } break; - case NMSP_PPT|XML_cover: - case NMSP_PPT|XML_pull: + case PPT_TOKEN( cover ): + case PPT_TOKEN( pull ): if (!mbHasTransition) { mbHasTransition = true; @@ -109,8 +106,8 @@ Reference< XFastContextHandler > SlideTransitionContext::createFastChildContext( // XML_ld, XML_lu, XML_rd, XML_ru } } break; - case NMSP_PPT|XML_cut: - case NMSP_PPT|XML_fade: + case PPT_TOKEN( cut ): + case PPT_TOKEN( fade ): if (!mbHasTransition) { mbHasTransition = true; @@ -119,8 +116,8 @@ Reference< XFastContextHandler > SlideTransitionContext::createFastChildContext( maTransition.setOoxTransitionType( aElementToken, attribs.getBool( XML_thruBlk, false ), 0); } break; - case NMSP_PPT|XML_push: - case NMSP_PPT|XML_wipe: + case PPT_TOKEN( push ): + case PPT_TOKEN( wipe ): if (!mbHasTransition) { mbHasTransition = true; @@ -128,7 +125,7 @@ Reference< XFastContextHandler > SlideTransitionContext::createFastChildContext( // ST_TransitionSideDirectionType { XML_d, XML_l, XML_r, XML_u } } break; - case NMSP_PPT|XML_split: + case PPT_TOKEN( split ): if (!mbHasTransition) { mbHasTransition = true; @@ -137,7 +134,7 @@ Reference< XFastContextHandler > SlideTransitionContext::createFastChildContext( // ST_TransitionInOutDirectionType { XML_out, XML_in } } break; - case NMSP_PPT|XML_zoom: + case PPT_TOKEN( zoom ): if (!mbHasTransition) { mbHasTransition = true; @@ -145,7 +142,7 @@ Reference< XFastContextHandler > SlideTransitionContext::createFastChildContext( // ST_TransitionInOutDirectionType { XML_out, XML_in } } break; - case NMSP_PPT|XML_wheel: + case PPT_TOKEN( wheel ): if (!mbHasTransition) { mbHasTransition = true; @@ -154,13 +151,13 @@ Reference< XFastContextHandler > SlideTransitionContext::createFastChildContext( // unsignedInt } break; - case NMSP_PPT|XML_circle: - case NMSP_PPT|XML_diamond: - case NMSP_PPT|XML_dissolve: - case NMSP_PPT|XML_newsflash: - case NMSP_PPT|XML_plus: - case NMSP_PPT|XML_random: - case NMSP_PPT|XML_wedge: + case PPT_TOKEN( circle ): + case PPT_TOKEN( diamond ): + case PPT_TOKEN( dissolve ): + case PPT_TOKEN( newsflash ): + case PPT_TOKEN( plus ): + case PPT_TOKEN( random ): + case PPT_TOKEN( wedge ): // CT_Empty if (!mbHasTransition) { @@ -170,11 +167,11 @@ Reference< XFastContextHandler > SlideTransitionContext::createFastChildContext( break; - case NMSP_PPT|XML_sndAc: // CT_TransitionSoundAction + case PPT_TOKEN( sndAc ): // CT_TransitionSoundAction //"Sound" xRet.set( new SoundActionContext ( *this, maSlideProperties ) ); break; - case NMSP_PPT|XML_extLst: // CT_OfficeArtExtensionList + case PPT_TOKEN( extLst ): // CT_OfficeArtExtensionList return xRet; default: break; @@ -188,7 +185,7 @@ Reference< XFastContextHandler > SlideTransitionContext::createFastChildContext( void SlideTransitionContext::endFastElement( sal_Int32 aElement ) throw (::com::sun::star::xml::sax::SAXException, RuntimeException) { - if( aElement == (NMSP_PPT|XML_transition) ) + if( aElement == (PPT_TOKEN( transition )) ) { if( mbHasTransition ) { diff --git a/oox/source/ppt/soundactioncontext.cxx b/oox/source/ppt/soundactioncontext.cxx index 281eb848629c..e9b955a73e15 100644 --- a/oox/source/ppt/soundactioncontext.cxx +++ b/oox/source/ppt/soundactioncontext.cxx @@ -32,10 +32,7 @@ #include "oox/helper/attributelist.hxx" #include "oox/helper/propertymap.hxx" -#include "oox/core/namespaces.hxx" #include "oox/drawingml/embeddedwavaudiofile.hxx" -#include "properties.hxx" -#include "tokens.hxx" using rtl::OUString; using namespace ::oox::core; @@ -63,7 +60,7 @@ namespace oox { namespace ppt { void SoundActionContext::endFastElement( sal_Int32 aElement ) throw (SAXException, RuntimeException) { - if ( aElement == ( NMSP_PPT|XML_sndAc ) ) + if ( aElement == PPT_TOKEN( sndAc ) ) { if( mbHasStartSound ) { @@ -106,7 +103,7 @@ namespace oox { namespace ppt { switch( aElement ) { - case NMSP_PPT|XML_snd: + case PPT_TOKEN( snd ): if( mbHasStartSound ) { drawingml::EmbeddedWAVAudioFile aAudio; @@ -115,11 +112,11 @@ namespace oox { namespace ppt { msSndName = ( aAudio.mbBuiltIn ? aAudio.msName : aAudio.msEmbed ); } break; - case NMSP_PPT|XML_endSnd: + case PPT_TOKEN( endSnd ): // CT_Empty mbStopSound = true; break; - case NMSP_PPT|XML_stSnd: + case PPT_TOKEN( stSnd ): mbHasStartSound = true; mbLoopSound = attribs.getBool( XML_loop, false ); default: diff --git a/oox/source/ppt/timeanimvaluecontext.cxx b/oox/source/ppt/timeanimvaluecontext.cxx index 5699d8a44cc3..185897f2e101 100644 --- a/oox/source/ppt/timeanimvaluecontext.cxx +++ b/oox/source/ppt/timeanimvaluecontext.cxx @@ -27,12 +27,8 @@ #include "timeanimvaluecontext.hxx" -#include "oox/core/namespaces.hxx" #include "animvariantcontext.hxx" -#include "tokens.hxx" - - using namespace ::oox::core; using namespace ::com::sun::star::uno; using namespace ::com::sun::star::xml::sax; @@ -57,7 +53,7 @@ namespace oox { namespace ppt { void SAL_CALL TimeAnimValueListContext::endFastElement( sal_Int32 aElement ) throw ( SAXException, RuntimeException) { - if( aElement == ( NMSP_PPT|XML_tav ) ) + if( aElement == PPT_TOKEN( tav ) ) { mbInValue = false; } @@ -72,7 +68,7 @@ namespace oox { namespace ppt { switch ( aElementToken ) { - case NMSP_PPT|XML_tav: + case PPT_TOKEN( tav ): { mbInValue = true; TimeAnimationValue val; @@ -81,7 +77,7 @@ namespace oox { namespace ppt { maTavList.push_back( val ); break; } - case NMSP_PPT|XML_val: + case PPT_TOKEN( val ): if( mbInValue ) { // CT_TLAnimVariant diff --git a/oox/source/ppt/timenodelistcontext.cxx b/oox/source/ppt/timenodelistcontext.cxx index 7e40e3be4db4..6a82dc29c1de 100644 --- a/oox/source/ppt/timenodelistcontext.cxx +++ b/oox/source/ppt/timenodelistcontext.cxx @@ -47,12 +47,10 @@ #include #include "oox/helper/attributelist.hxx" -#include "oox/core/namespaces.hxx" #include "oox/core/xmlfilterbase.hxx" #include "oox/drawingml/drawingmltypes.hxx" #include "oox/drawingml/colorchoicecontext.hxx" #include "oox/ppt/slidetransition.hxx" -#include "tokens.hxx" #include "animvariantcontext.hxx" #include "commonbehaviorcontext.hxx" @@ -129,10 +127,10 @@ namespace oox { namespace ppt { switch( aElement ) { - case NMSP_PPT|XML_audio: + case PPT_TOKEN( audio ): mbIsNarration = attribs.getBool( XML_isNarration, false ); break; - case NMSP_PPT|XML_video: + case PPT_TOKEN( video ): mbFullScrn = attribs.getBool( XML_fullScrn, false ); break; default: @@ -143,11 +141,11 @@ namespace oox { namespace ppt { virtual void SAL_CALL endFastElement( sal_Int32 aElement ) throw ( SAXException, RuntimeException) { - if( aElement == ( NMSP_PPT|XML_audio ) ) + if( aElement == PPT_TOKEN( audio ) ) { // TODO deal with mbIsNarration } - else if( aElement == ( NMSP_PPT|XML_video ) ) + else if( aElement == PPT_TOKEN( video ) ) { // TODO deal with mbFullScrn } @@ -161,7 +159,7 @@ namespace oox { namespace ppt { switch ( aElementToken ) { - case NMSP_PPT|XML_cBhvr: + case PPT_TOKEN( cBhvr ): xRet.set( new CommonBehaviorContext ( *this, xAttribs, mpNode ) ); break; default: @@ -227,10 +225,10 @@ namespace oox { namespace ppt { switch ( aElementToken ) { - case NMSP_PPT|XML_cBhvr: + case PPT_TOKEN( cBhvr ): xRet.set( new CommonBehaviorContext ( *this, xAttribs, mpNode ) ); break; - case NMSP_PPT|XML_to: + case PPT_TOKEN( to ): // CT_TLAnimVariant xRet.set( new AnimVariantContext( *this, aElementToken, maTo ) ); break; @@ -261,7 +259,7 @@ namespace oox { namespace ppt { { switch ( aElement ) { - case NMSP_PPT|XML_cmd: + case PPT_TOKEN( cmd ): msCommand = xAttribs->getOptionalValue( XML_cmd ); maType = xAttribs->getOptionalValueToken( XML_type, 0 ); break; @@ -277,7 +275,7 @@ namespace oox { namespace ppt { virtual void SAL_CALL endFastElement( sal_Int32 aElement ) throw ( SAXException, RuntimeException) { - if( aElement == ( NMSP_PPT|XML_cmd ) ) + if( aElement == PPT_TOKEN( cmd ) ) { try { // see sd/source/filter/ppt/pptinanimations.cxx @@ -356,7 +354,7 @@ namespace oox { namespace ppt { switch ( aElementToken ) { - case NMSP_PPT|XML_cBhvr: + case PPT_TOKEN( cBhvr ): xRet.set( new CommonBehaviorContext ( *this, xAttribs, mpNode ) ); break; default: @@ -409,14 +407,14 @@ namespace oox { namespace ppt { switch ( aElementToken ) { - case NMSP_PPT|XML_cTn: + case PPT_TOKEN( cTn ): xRet.set( new CommonTimeNodeContext( *this, aElementToken, xAttribs, mpNode ) ); break; - case NMSP_PPT|XML_nextCondLst: + case PPT_TOKEN( nextCondLst ): xRet.set( new CondListContext( *this, aElementToken, xAttribs, mpNode, mpNode->getNextCondition() ) ); break; - case NMSP_PPT|XML_prevCondLst: + case PPT_TOKEN( prevCondLst ): xRet.set( new CondListContext( *this, aElementToken, xAttribs, mpNode, mpNode->getPrevCondition() ) ); break; @@ -457,7 +455,7 @@ namespace oox { namespace ppt { switch ( aElementToken ) { - case NMSP_PPT|XML_cTn: + case PPT_TOKEN( cTn ): xRet.set( new CommonTimeNodeContext( *this, aElementToken, xAttribs, mpNode ) ); break; default: @@ -521,7 +519,7 @@ namespace oox { namespace ppt { switch ( aElementToken ) { - case NMSP_PPT|XML_hsl: + case PPT_TOKEN( hsl ): // CT_TLByHslColorTransform { if( mbHasByColor ) @@ -534,7 +532,7 @@ namespace oox { namespace ppt { xRet.set(this); break; } - case NMSP_PPT|XML_rgb: + case PPT_TOKEN( rgb ): { if( mbHasByColor ) { @@ -547,19 +545,19 @@ namespace oox { namespace ppt { xRet.set(this); break; } - case NMSP_PPT|XML_by: + case PPT_TOKEN( by ): // CT_TLByAnimateColorTransform mbHasByColor = true; xRet.set(this); break; - case NMSP_PPT|XML_cBhvr: + case PPT_TOKEN( cBhvr ): xRet.set( new CommonBehaviorContext ( *this, xAttribs, mpNode ) ); break; - case NMSP_PPT|XML_to: + case PPT_TOKEN( to ): // CT_Color xRet.set( new ColorContext( *this, maToClr ) ); break; - case NMSP_PPT|XML_from: + case PPT_TOKEN( from ): // CT_Color xRet.set( new ColorContext( *this, maFromClr ) ); break; @@ -678,10 +676,10 @@ namespace oox { namespace ppt { switch ( aElementToken ) { - case NMSP_PPT|XML_cBhvr: + case PPT_TOKEN( cBhvr ): xRet.set( new CommonBehaviorContext ( *this, xAttribs, mpNode ) ); break; - case NMSP_PPT|XML_tavLst: + case PPT_TOKEN( tavLst ): xRet.set( new TimeAnimValueListContext ( *this, xAttribs, maTavList ) ); break; default: @@ -748,10 +746,10 @@ namespace oox { namespace ppt { switch ( aElementToken ) { - case NMSP_PPT|XML_cBhvr: + case PPT_TOKEN( cBhvr ): xRet.set( new CommonBehaviorContext ( *this, xAttribs, mpNode ) ); break; - case NMSP_PPT|XML_to: + case PPT_TOKEN( to ): { // CT_TLPoint Point p = GetPointPercent( xAttribs ); @@ -759,7 +757,7 @@ namespace oox { namespace ppt { maTo <<= p.Y; break; } - case NMSP_PPT|XML_from: + case PPT_TOKEN( from ): { // CT_TLPoint Point p = GetPointPercent( xAttribs ); @@ -767,7 +765,7 @@ namespace oox { namespace ppt { maFrom <<= p.Y; break; } - case NMSP_PPT|XML_by: + case PPT_TOKEN( by ): { // CT_TLPoint Point p = GetPointPercent( xAttribs ); @@ -834,7 +832,7 @@ namespace oox { namespace ppt { switch ( aElementToken ) { - case NMSP_PPT|XML_cBhvr: + case PPT_TOKEN( cBhvr ): xRet.set( new CommonBehaviorContext ( *this, xAttribs, mpNode ) ); break; default: @@ -902,10 +900,10 @@ namespace oox { namespace ppt { switch ( aElementToken ) { - case NMSP_PPT|XML_cBhvr: + case PPT_TOKEN( cBhvr ): xRet.set( new CommonBehaviorContext ( *this, xAttribs, mpNode ) ); break; - case NMSP_PPT|XML_to: + case PPT_TOKEN( to ): { // CT_TLPoint Point p = GetPointPercent( xAttribs ); @@ -915,7 +913,7 @@ namespace oox { namespace ppt { mpNode->setTo( rAny ); break; } - case NMSP_PPT|XML_from: + case PPT_TOKEN( from ): { // CT_TLPoint Point p = GetPointPercent( xAttribs ); @@ -925,7 +923,7 @@ namespace oox { namespace ppt { mpNode->setFrom( rAny ); break; } - case NMSP_PPT|XML_by: + case PPT_TOKEN( by ): { // CT_TLPoint Point p = GetPointPercent( xAttribs ); @@ -935,7 +933,7 @@ namespace oox { namespace ppt { mpNode->setBy( rAny ); break; } - case NMSP_PPT|XML_rCtr: + case PPT_TOKEN( rCtr ): { // CT_TLPoint Point p = GetPointPercent( xAttribs ); @@ -993,10 +991,10 @@ namespace oox { namespace ppt { switch ( aElementToken ) { - case NMSP_PPT|XML_cBhvr: + case PPT_TOKEN( cBhvr ): xRet.set( new CommonBehaviorContext ( *this, xAttribs, mpNode ) ); break; - case NMSP_PPT|XML_progress: + case PPT_TOKEN( progress ): xRet.set( new AnimVariantContext( *this, aElementToken, maProgress ) ); // TODO handle it. break; @@ -1025,41 +1023,41 @@ namespace oox { namespace ppt { TimeNodeContext *pCtx = NULL; switch( aElement ) { - case NMSP_PPT|XML_animClr: + case PPT_TOKEN( animClr ): pCtx = new AnimColorContext( rParent, aElement, xAttribs, pNode ); break; - case NMSP_PPT|XML_par: + case PPT_TOKEN( par ): pCtx = new ParallelExclTimeNodeContext( rParent, aElement, xAttribs, pNode ); break; - case NMSP_PPT|XML_seq: + case PPT_TOKEN( seq ): pCtx = new SequenceTimeNodeContext( rParent, aElement, xAttribs, pNode ); break; - case NMSP_PPT|XML_excl: + case PPT_TOKEN( excl ): pCtx = new ParallelExclTimeNodeContext( rParent, aElement, xAttribs, pNode ); break; - case NMSP_PPT|XML_anim: + case PPT_TOKEN( anim ): pCtx = new AnimContext ( rParent, aElement, xAttribs, pNode ); break; - case NMSP_PPT|XML_animEffect: + case PPT_TOKEN( animEffect ): pCtx = new AnimEffectContext( rParent, aElement, xAttribs, pNode ); break; - case NMSP_PPT|XML_animMotion: + case PPT_TOKEN( animMotion ): pCtx = new AnimMotionContext( rParent, aElement, xAttribs, pNode ); break; - case NMSP_PPT|XML_animRot: + case PPT_TOKEN( animRot ): pCtx = new AnimRotContext( rParent, aElement, xAttribs, pNode ); break; - case NMSP_PPT|XML_animScale: + case PPT_TOKEN( animScale ): pCtx = new AnimScaleContext( rParent, aElement, xAttribs, pNode ); break; - case NMSP_PPT|XML_cmd: + case PPT_TOKEN( cmd ): pCtx = new CmdTimeNodeContext( rParent, aElement, xAttribs, pNode ); break; - case NMSP_PPT|XML_set: + case PPT_TOKEN( set ): pCtx = new SetTimeNodeContext( rParent, aElement, xAttribs, pNode ); break; - case NMSP_PPT|XML_audio: - case NMSP_PPT|XML_video: + case PPT_TOKEN( audio ): + case PPT_TOKEN( video ): pCtx = new MediaNodeContext( rParent, aElement, xAttribs, pNode ); break; default: @@ -1106,43 +1104,43 @@ namespace oox { namespace ppt { switch( aElementToken ) { - case NMSP_PPT|XML_par: + case PPT_TOKEN( par ): nNodeType = AnimationNodeType::PAR; break; - case NMSP_PPT|XML_seq: + case PPT_TOKEN( seq ): nNodeType = AnimationNodeType::SEQ; break; - case NMSP_PPT|XML_excl: + case PPT_TOKEN( excl ): // TODO pick the right type. We choose parallel for now as // there does not seem to be an "Exclusive" nNodeType = AnimationNodeType::PAR; break; - case NMSP_PPT|XML_anim: + case PPT_TOKEN( anim ): nNodeType = AnimationNodeType::ANIMATE; break; - case NMSP_PPT|XML_animClr: + case PPT_TOKEN( animClr ): nNodeType = AnimationNodeType::ANIMATECOLOR; break; - case NMSP_PPT|XML_animEffect: + case PPT_TOKEN( animEffect ): nNodeType = AnimationNodeType::TRANSITIONFILTER; break; - case NMSP_PPT|XML_animMotion: + case PPT_TOKEN( animMotion ): nNodeType = AnimationNodeType::ANIMATEMOTION; break; - case NMSP_PPT|XML_animRot: - case NMSP_PPT|XML_animScale: + case PPT_TOKEN( animRot ): + case PPT_TOKEN( animScale ): nNodeType = AnimationNodeType::ANIMATETRANSFORM; break; - case NMSP_PPT|XML_cmd: + case PPT_TOKEN( cmd ): nNodeType = AnimationNodeType::COMMAND; break; - case NMSP_PPT|XML_set: + case PPT_TOKEN( set ): nNodeType = AnimationNodeType::SET; break; - case NMSP_PPT|XML_audio: + case PPT_TOKEN( audio ): nNodeType = AnimationNodeType::AUDIO; break; - case NMSP_PPT|XML_video: + case PPT_TOKEN( video ): nNodeType = AnimationNodeType::AUDIO; OSL_TRACE( "OOX: video requested, gave Audio instead" ); break; diff --git a/oox/source/ppt/timetargetelementcontext.cxx b/oox/source/ppt/timetargetelementcontext.cxx index 884b6d30fa61..81320bef5e89 100644 --- a/oox/source/ppt/timetargetelementcontext.cxx +++ b/oox/source/ppt/timetargetelementcontext.cxx @@ -34,9 +34,7 @@ #include #include "oox/helper/attributelist.hxx" -#include "oox/core/namespaces.hxx" #include "oox/drawingml/embeddedwavaudiofile.hxx" -#include "tokens.hxx" using namespace ::com::sun::star::uno; using namespace ::com::sun::star::xml::sax; @@ -67,29 +65,29 @@ namespace oox { namespace ppt { switch( aElementToken ) { - case NMSP_PPT|XML_bg: + case PPT_TOKEN( bg ): bTargetSet = true; maShapeTarget.mnType = XML_bg; break; - case NMSP_PPT|XML_txEl: + case PPT_TOKEN( txEl ): bTargetSet = true; maShapeTarget.mnType = XML_txEl; break; - case NMSP_PPT|XML_subSp: + case PPT_TOKEN( subSp ): bTargetSet = true; maShapeTarget.mnType = XML_subSp; maShapeTarget.msSubShapeId = xAttribs->getOptionalValue( XML_spid ); break; - case NMSP_PPT|XML_graphicEl: - case NMSP_PPT|XML_oleChartEl: + case PPT_TOKEN( graphicEl ): + case PPT_TOKEN( oleChartEl ): bTargetSet = true; // TODO break; - case NMSP_PPT|XML_charRg: - case NMSP_PPT|XML_pRg: + case PPT_TOKEN( charRg ): + case PPT_TOKEN( pRg ): if( bTargetSet && maShapeTarget.mnType == XML_txEl ) { - maShapeTarget.mnRangeType = getToken( aElementToken ); + maShapeTarget.mnRangeType = getBaseToken( aElementToken ); maShapeTarget.maRange = drawingml::GetIndexRange( xAttribs ); } break; @@ -130,7 +128,7 @@ namespace oox { namespace ppt { switch( aElementToken ) { - case NMSP_PPT|XML_inkTgt: + case PPT_TOKEN( inkTgt ): { mpTarget->mnType = XML_inkTgt; OUString aId = xAttribs->getOptionalValue( XML_spid ); @@ -140,10 +138,10 @@ namespace oox { namespace ppt { } break; } - case NMSP_PPT|XML_sldTgt: + case PPT_TOKEN( sldTgt ): mpTarget->mnType = XML_sldTgt; break; - case NMSP_PPT|XML_sndTgt: + case PPT_TOKEN( sndTgt ): { mpTarget->mnType = XML_sndTgt; drawingml::EmbeddedWAVAudioFile aAudio; @@ -153,7 +151,7 @@ namespace oox { namespace ppt { mpTarget->msValue = sSndName; break; } - case NMSP_PPT|XML_spTgt: + case PPT_TOKEN( spTgt ): { mpTarget->mnType = XML_spTgt; OUString aId = xAttribs->getOptionalValue( XML_spid ); @@ -162,7 +160,7 @@ namespace oox { namespace ppt { break; } default: - OSL_TRACE( "OOX: unhandled tag %ld in TL_TimeTargetElement.", getToken( aElementToken ) ); + OSL_TRACE( "OOX: unhandled tag %ld in TL_TimeTargetElement.", getBaseToken( aElementToken ) ); break; } diff --git a/oox/source/shape/FastTokenHandlerService.cxx b/oox/source/shape/FastTokenHandlerService.cxx deleted file mode 100644 index 292f64548363..000000000000 --- a/oox/source/shape/FastTokenHandlerService.cxx +++ /dev/null @@ -1,118 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#include "FastTokenHandlerService.hxx" - -#include -#include "oox/helper/helper.hxx" - -namespace oox { -namespace shape { - -// ============================================================================ - -using namespace ::com::sun::star::uno; - -using ::rtl::OUString; - -// ============================================================================ - -OUString SAL_CALL FastTokenHandlerService_getImplementationName() -{ - return CREATE_OUSTRING( "com.sun.star.comp.oox.FastTokenHandlerService" ); -} - -Sequence< OUString > SAL_CALL FastTokenHandlerService_getSupportedServiceNames() -{ - Sequence< OUString > s( 1 ); - s[ 0 ] = CREATE_OUSTRING( "com.sun.star.xml.sax.FastTokenHandler" ); - return s; -} - -Reference< XInterface > SAL_CALL FastTokenHandlerService_createInstance( const Reference< XComponentContext >& rxContext ) throw (Exception) -{ - return static_cast< ::cppu::OWeakObject* >( new FastTokenHandlerService( rxContext ) ); -} - -// ============================================================================ - -FastTokenHandlerService::FastTokenHandlerService( const Reference< XComponentContext >& rxContext ) : - m_xContext( rxContext ) -{ -} - -FastTokenHandlerService::~FastTokenHandlerService() -{ -} - -// com.sun.star.uno.XServiceInfo: -OUString SAL_CALL FastTokenHandlerService::getImplementationName() throw (RuntimeException) -{ - return FastTokenHandlerService_getImplementationName(); -} - -sal_Bool SAL_CALL FastTokenHandlerService::supportsService( const OUString& serviceName ) throw (RuntimeException) -{ - Sequence< OUString > serviceNames = FastTokenHandlerService_getSupportedServiceNames(); - for( sal_Int32 i = 0; i < serviceNames.getLength(); ++i ) - { - if( serviceNames[ i ] == serviceName ) - return sal_True; - } - return sal_False; -} - -Sequence< OUString > SAL_CALL FastTokenHandlerService::getSupportedServiceNames() throw (RuntimeException) -{ - return FastTokenHandlerService_getSupportedServiceNames(); -} - -// ::com::sun::star::xml::sax::XFastTokenHandler: -sal_Int32 SAL_CALL FastTokenHandlerService::getToken( const OUString& Identifier ) throw (RuntimeException) -{ - return mFastTokenHandler.getToken(Identifier); -} - -OUString SAL_CALL FastTokenHandlerService::getIdentifier( sal_Int32 Token ) throw (RuntimeException) -{ - return mFastTokenHandler.getIdentifier(Token); -} - -Sequence< sal_Int8 > SAL_CALL FastTokenHandlerService::getUTF8Identifier( sal_Int32 Token ) throw (RuntimeException) -{ - return mFastTokenHandler.getUTF8Identifier(Token); -} - -sal_Int32 SAL_CALL FastTokenHandlerService::getTokenFromUTF8( const Sequence< sal_Int8 >& Identifier ) throw (RuntimeException) -{ - return mFastTokenHandler.getTokenFromUTF8(Identifier); -} - -// ============================================================================ - -} // namspace shape -} // namspace oox diff --git a/oox/source/shape/FastTokenHandlerService.hxx b/oox/source/shape/FastTokenHandlerService.hxx deleted file mode 100644 index 09c7c2044922..000000000000 --- a/oox/source/shape/FastTokenHandlerService.hxx +++ /dev/null @@ -1,73 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#ifndef OOX_SHAPE_FASTTOKENHANDLERSERVICE_HXX -#define OOX_SHAPE_FASTTOKENHANDLERSERVICE_HXX - -#include -#include -#include -#include "oox/core/fasttokenhandler.hxx" - -namespace oox { -namespace shape { - -// ============================================================================ - -typedef ::cppu::WeakImplHelper2< ::com::sun::star::lang::XServiceInfo, ::com::sun::star::xml::sax::XFastTokenHandler > FastTokenHandlerServiceBase; - -class FastTokenHandlerService : public FastTokenHandlerServiceBase -{ -public: - explicit FastTokenHandlerService( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxCcontext ); - virtual ~FastTokenHandlerService(); - - // ::com::sun::star::lang::XServiceInfo: - virtual ::rtl::OUString SAL_CALL getImplementationName() throw (::com::sun::star::uno::RuntimeException); - virtual ::sal_Bool SAL_CALL supportsService(const ::rtl::OUString & ServiceName) throw (::com::sun::star::uno::RuntimeException); - virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() throw (::com::sun::star::uno::RuntimeException); - - // ::com::sun::star::xml::sax::XFastTokenHandler: - virtual ::sal_Int32 SAL_CALL getToken(const ::rtl::OUString & Identifier) throw (::com::sun::star::uno::RuntimeException); - virtual ::rtl::OUString SAL_CALL getIdentifier(::sal_Int32 Token) throw (::com::sun::star::uno::RuntimeException); - virtual ::com::sun::star::uno::Sequence< ::sal_Int8 > SAL_CALL getUTF8Identifier( ::sal_Int32 Token ) throw (::com::sun::star::uno::RuntimeException); - virtual ::sal_Int32 SAL_CALL getTokenFromUTF8(const ::com::sun::star::uno::Sequence< ::sal_Int8 > & Identifier) throw (::com::sun::star::uno::RuntimeException); - -private: - FastTokenHandlerService(FastTokenHandlerService &); // not defined - void operator =(FastTokenHandlerService &); // not defined - - ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > m_xContext; - ::oox::core::FastTokenHandler mFastTokenHandler; -}; - -// ============================================================================ - -} // namspace shape -} // namspace oox - -#endif diff --git a/oox/source/shape/ShapeContextHandler.cxx b/oox/source/shape/ShapeContextHandler.cxx index 86d36268b1d8..31ab343e0ebc 100644 --- a/oox/source/shape/ShapeContextHandler.cxx +++ b/oox/source/shape/ShapeContextHandler.cxx @@ -29,7 +29,6 @@ #include "oox/vml/vmldrawingfragment.hxx" #include "oox/vml/vmlshape.hxx" #include "oox/vml/vmlshapecontainer.hxx" -#include "tokens.hxx" namespace oox { namespace shape { @@ -124,10 +123,10 @@ ShapeContextHandler::getContextHandler() { uno::Reference xResult; - switch (mnStartToken & NMSP_MASK) + switch (getNamespace( mnStartToken )) { - case NMSP_DOC: - case NMSP_VML: + case NMSP_doc: + case NMSP_vml: xResult.set(getDrawingShapeContext()); break; default: diff --git a/oox/source/shape/makefile.mk b/oox/source/shape/makefile.mk index f5a3af5542c0..c6534b3a8a6f 100644 --- a/oox/source/shape/makefile.mk +++ b/oox/source/shape/makefile.mk @@ -42,8 +42,7 @@ ENABLE_EXCEPTIONS=TRUE SLOFILES = \ $(SLO)$/ShapeContextHandler.obj \ - $(SLO)$/ShapeFilterBase.obj \ - $(SLO)$/FastTokenHandlerService.obj + $(SLO)$/ShapeFilterBase.obj # --- Targets ------------------------------------------------------- diff --git a/oox/source/token/gennamespaces.pl b/oox/source/token/gennamespaces.pl deleted file mode 100644 index 2a7f2e2423bb..000000000000 --- a/oox/source/token/gennamespaces.pl +++ /dev/null @@ -1,66 +0,0 @@ -$ARGV0 = shift @ARGV; -$ARGV1 = shift @ARGV; - -open ( NAMESPACES, $ARGV0 ) || die "can't open namespaces file: $!"; - - -open ( HXX, ">$ARGV1" ) or die "can't open namespaces.hxx file: $!"; - -print ( HXX "#ifndef OOX_NAMESPACES_HXX\n" ); -print ( HXX "#define OOX_NAMESPACES_HXX\n\n" ); -print ( HXX "#include \n\n" ); -print ( HXX "namespace oox {\n\n" ); - -$group = 0; -$i = 1; -while ( ) -{ - chomp( $_ ); - $_ =~ s/\s*//g; - if ( $_ =~ m/^$/ ) - { - # Start a new group - print ( HXX "\n" ); - $i = 0; - $group++; - } - elsif ( $_ =~ m/^[^#]/ ) - { - # Neither an empty line nor a comment - $_ =~ /^[a-zA-Z0-9-_]+$/ or die "Invalid namespace token $_"; - $id = "NMSP_$_"; - $id =~ s/-/_/g; - $no = $group*10 + $i; - print ( HXX "const sal_Int32 $id = $no << 16;\n" ); - ++$i; - } -} -close ( NAMESPACES ); - -print ( HXX "\nconst sal_Int32 TOKEN_MASK = SAL_MAX_UINT16;\n" ); -print ( HXX "const sal_Int32 NMSP_MASK = SAL_MAX_INT16 << 16;\n" ); - -print ( HXX "/** Returns the token identifier of the passed element without namespace. */\n" ); -print ( HXX "inline sal_Int32 getToken( sal_Int32 nElement ) { return nElement & TOKEN_MASK; }\n\n" ); - -print ( HXX "/** Returns the namespace of the passed element without token identifier. */\n" ); -print ( HXX "inline sal_Int32 getNamespace( sal_Int32 nElement ) { return nElement & NMSP_MASK; }\n\n" ); - -print ( HXX "// defines for tokens with specific namespaces, can be used in switch/cases\n\n" ); -print ( HXX "#define A_TOKEN( token ) (::oox::NMSP_DRAWINGML | XML_##token)\n" ); -print ( HXX "#define AX_TOKEN( token ) (::oox::NMSP_AX | XML_##token)\n" ); -print ( HXX "#define C_TOKEN( token ) (::oox::NMSP_CHART | XML_##token)\n" ); -print ( HXX "#define CDR_TOKEN( token ) (::oox::NMSP_CDR | XML_##token)\n" ); -print ( HXX "#define O_TOKEN( token ) (::oox::NMSP_OFFICE | XML_##token)\n" ); -print ( HXX "#define PPT_TOKEN( token ) (::oox::NMSP_PPT | XML_##token)\n" ); -print ( HXX "#define R_TOKEN( token ) (::oox::NMSP_RELATIONSHIPS | XML_##token)\n" ); -print ( HXX "#define VML_TOKEN( token ) (::oox::NMSP_VML | XML_##token)\n" ); -print ( HXX "#define VMLX_TOKEN( token ) (::oox::NMSP_VML_XLS | XML_##token)\n" ); -print ( HXX "#define XDR_TOKEN( token ) (::oox::NMSP_XDR | XML_##token)\n" ); -print ( HXX "#define XLS_TOKEN( token ) (::oox::NMSP_XLS | XML_##token)\n" ); -print ( HXX "#define XM_TOKEN( token ) (::oox::NMSP_XM | XML_##token)\n" ); -print ( HXX "#define XML_TOKEN( token ) (::oox::NMSP_XML | XML_##token)\n" ); - - -print ( HXX "} // namespace oox\n\n" ); -print ( HXX "#endif // OOX_NAMESPACES_HXX\n" ); diff --git a/oox/source/token/genproperties.pl b/oox/source/token/genproperties.pl deleted file mode 100644 index 9dbe15c8ac12..000000000000 --- a/oox/source/token/genproperties.pl +++ /dev/null @@ -1,46 +0,0 @@ -$ARGV0 = shift @ARGV; -$ARGV1 = shift @ARGV; -$ARGV2 = shift @ARGV; - -open ( PROPS, $ARGV0 ) || die "can't open properties source file: $!"; -my %props; - -while ( ) -{ - chomp( $_ ); - $_ =~ s/\s*//g; - $_ =~ /^[A-Z][a-zA-Z0-9]*$/ or die "invalid character in property '$_'"; - $id = "PROP_$_"; - $props{$_} = $id; -} -close ( TOKENS ); - -open ( HXX, ">$ARGV1" ) or die "can't open properties.hxx file: $!"; -open ( WORDS, ">$ARGV2" ) or die "can't open propertynames.inc file: $!"; - -print ( HXX "#ifndef OOX_PROPERTIES_HXX\n" ); -print ( HXX "#define OOX_PROPERTIES_HXX\n\n" ); -print ( HXX "#include \n" ); -print ( HXX "namespace oox {\n\n" ); - -print ( WORDS "static const sal_Char* propertywordlist[] = {\n" ); - -$i = 0; -foreach( sort( keys( %props ) ) ) -{ - print ( HXX "const sal_Int32 $props{$_} = $i;\n" ); - print ( WORDS " \"$_\",\n" ); - ++$i; -} - -print ( HXX "const sal_Int32 PROP_COUNT = $i;\n" ); -print ( HXX "const sal_Int32 PROP_INVALID = -1;\n\n" ); -print ( HXX "} // namespace oox\n" ); -print ( HXX "#endif\n" ); - -print ( WORDS " \"\"\n" ); -print ( WORDS "};\n" ); - -close ( HXX ); -close ( WORDS ); - diff --git a/oox/source/token/gentoken.pl b/oox/source/token/gentoken.pl deleted file mode 100644 index 196ac37ebb5c..000000000000 --- a/oox/source/token/gentoken.pl +++ /dev/null @@ -1,61 +0,0 @@ -$ARGV0 = shift @ARGV; -$ARGV1 = shift @ARGV; -$ARGV2 = shift @ARGV; -$ARGV3 = shift @ARGV; - -open ( TOKENS, $ARGV0 ) || die "can't open $ARGV0 file: $!"; -my %tokens; - -while ( ) -{ - chomp( $_ ); - $_ =~ s/\s*//g; - $_ =~ /^[a-zA-Z0-9-_]+$/ or die "invalid character in token '$_'"; - $id = "XML_$_"; - $id =~ s/-/_/g; - $tokens{$_} = $id; -} -close ( TOKENS ); - -open ( HXX, ">$ARGV1" ) or die "can't open $ARGV1 file: $!"; -open ( WORDS, ">$ARGV2" ) or die "can't open $ARGV2 file: $!"; -open ( GPERF, ">$ARGV3" ) or die "can't open $ARGV3 file: $!"; - -print ( HXX "#ifndef OOX_TOKENS_HXX\n" ); -print ( HXX "#define OOX_TOKENS_HXX\n\n" ); -print ( HXX "#include \n" ); - -print ( WORDS "static const sal_Char* xmltokenwordlist[] = {\n" ); - -print ( GPERF "%language=C++\n" ); -print ( GPERF "%global-table\n" ); -print ( GPERF "%null-strings\n" ); -print ( GPERF "%struct-type\n" ); -print ( GPERF "struct xmltoken {\n" ); -print ( GPERF " const sal_Char *name;\n" ); -print ( GPERF " sal_Int32 nToken;\n" ); -print ( GPERF "};\n" ); -print ( GPERF "%%\n" ); - -$i = 0; -foreach( sort( keys( %tokens ) ) ) -{ - print ( HXX "const sal_Int32 $tokens{$_} = $i;\n" ); - print ( WORDS " \"$_\",\n" ); - print ( GPERF "$_,$tokens{$_}\n" ); - ++$i; -} - -print ( HXX "const sal_Int32 XML_TOKEN_COUNT = $i;\n" ); -print ( HXX "const sal_Int32 XML_TOKEN_INVALID = ::com::sun::star::xml::sax::FastToken::DONTKNOW;\n\n" ); -print ( HXX "const sal_Int32 XML_ROOT_CONTEXT = SAL_MAX_INT32;\n\n" ); -print ( HXX "#endif\n" ); - -print ( WORDS " \"\"\n" ); -print ( WORDS "};\n" ); - -print ( GPERF "%%\n" ); - -close ( HXX ); -close ( WORDS ); -close ( GPERF ); diff --git a/oox/source/token/makefile.mk b/oox/source/token/makefile.mk index 7884c375fde6..ff42967f0bb1 100644 --- a/oox/source/token/makefile.mk +++ b/oox/source/token/makefile.mk @@ -39,40 +39,40 @@ ENABLE_EXCEPTIONS=TRUE # --- Files -------------------------------------------------------- -SLOFILES = \ - $(SLO)$/propertylist.obj \ - $(SLO)$/tokenmap.obj +SLOFILES = \ + $(SLO)$/namespacemap.obj \ + $(SLO)$/propertynames.obj \ + $(SLO)$/tokenmap.obj # --- Targets ------------------------------------------------------- .INCLUDE : target.mk -$(MISC)$/tokens.gperf $(INCCOM)$/tokenwords.inc $(INCCOM)$/tokens.hxx $(INCCOM)$/propertywords.inc $(INCCOM)$/properties.hxx $(INCCOM)$/oox$/core$/namespaces.hxx : - @@noop $(assign do_phony:=.PHONY) +GENHEADERPATH = $(INCCOM)$/oox$/token -$(MISC)$/do_tokens $(do_phony) : tokens.txt gentoken.pl $(MISC)$/tokens.gperf $(INCCOM)$/tokenwords.inc $(INCCOM)$/tokens.hxx - @@-$(RM) $@ - $(PERL) gentoken.pl tokens.txt $(INCCOM)$/tokens.hxx $(INCCOM)$/tokenwords.inc $(MISC)$/tokens.gperf && $(TOUCH) $@ +$(MISC)$/tokenhash.gperf $(INCCOM)$/tokennames.inc $(GENHEADERPATH)$/tokens.hxx $(INCCOM)$/namespacenames.inc $(MISC)$/namespaces.txt $(GENHEADERPATH)$/namespaces.hxx $(INCCOM)$/propertynames.inc $(GENHEADERPATH)$/properties.hxx : + @@noop $(assign do_phony:=.PHONY) -$(INCCOM)$/oox: - $(MKDIR) $(INCCOM)$/oox +$(SLO)$/tokenmap.obj : $(INCCOM)$/tokenhash.inc $(INCCOM)$/tokennames.inc $(GENHEADERPATH)$/tokens.hxx $(MISC)$/do_tokens -$(INCCOM)$/oox$/core: $(INCCOM)$/oox - $(MKDIR) $(INCCOM)$/oox$/core +$(INCCOM)$/tokenhash.inc : $(MISC)$/tokenhash.gperf $(MISC)$/do_tokens + $(AUGMENT_LIBRARY_PATH) gperf --compare-strncmp $(MISC)$/tokenhash.gperf | $(SED) -e "s/(char\*)0/(char\*)0, 0/g" | $(GREP) -v "^#line" >$(INCCOM)$/tokenhash.inc -$(MISC)$/do_namespaces $(do_phony) : namespaces.txt gennamespaces.pl +$(MISC)$/do_tokens $(do_phony) : tokens.txt tokens.pl tokens.hxx.head tokens.hxx.tail $(GENHEADERPATH)$/tokens.hxx $(INCCOM)$/tokennames.inc $(MISC)$/tokenhash.gperf @@-$(RM) $@ - $(MKDIRHIER) $(INCCOM)$/oox$/core - $(PERL) gennamespaces.pl namespaces.txt $(INCCOM)$/oox$/core$/namespaces.hxx && $(TOUCH) $@ + $(MKDIRHIER) $(GENHEADERPATH) + $(PERL) tokens.pl tokens.txt $(MISC)$/tokenids.inc $(INCCOM)$/tokennames.inc $(MISC)$/tokenhash.gperf && $(TYPE) tokens.hxx.head $(MISC)$/tokenids.inc tokens.hxx.tail > $(GENHEADERPATH)$/tokens.hxx && $(TOUCH) $@ -$(INCCOM)$/tokens.inc : $(MISC)$/tokens.gperf $(MISC)$/do_tokens - $(AUGMENT_LIBRARY_PATH) gperf --compare-strncmp $(MISC)$/tokens.gperf | $(SED) -e "s/(char\*)0/(char\*)0, 0/g" | $(GREP) -v "^#line" >$(INCCOM)$/tokens.inc +$(SLO)$/namespacemap.obj : $(INCCOM)$/namespacenames.inc $(MISC)$/namespaces.txt $(GENHEADERPATH)$/namespaces.hxx $(MISC)$/do_namespaces -$(SLO)$/tokenmap.obj : $(INCCOM)$/tokens.inc $(INCCOM)$/tokenwords.inc $(INCCOM)$/tokens.hxx $(INCCOM)$/oox$/core$/namespaces.hxx $(MISC)$/do_tokens $(MISC)$/do_namespaces - -$(MISC)$/do_properties $(do_phony) : properties.txt genproperties.pl $(INCCOM)$/properties.hxx $(INCCOM)$/propertywords.inc +$(MISC)$/do_namespaces $(do_phony) : namespaces.txt namespaces.pl namespaces.hxx.head namespaces.hxx.tail $(INCCOM)$/namespacenames.inc $(MISC)$/namespaces.txt $(GENHEADERPATH)$/namespaces.hxx @@-$(RM) $@ - $(PERL) genproperties.pl properties.txt $(INCCOM)$/properties.hxx $(INCCOM)$/propertywords.inc && $(TOUCH) $@ + $(MKDIRHIER) $(GENHEADERPATH) + $(PERL) namespaces.pl namespaces.txt $(MISC)$/namespaceids.inc $(INCCOM)$/namespacenames.inc $(MISC)$/namespaces.txt && $(TYPE) namespaces.hxx.head $(MISC)$/namespaceids.inc namespaces.hxx.tail > $(GENHEADERPATH)$/namespaces.hxx && $(TOUCH) $@ -$(SLO)$/propertylist.obj : $(INCCOM)$/propertywords.inc $(INCCOM)$/properties.hxx $(MISC)$/do_properties +$(SLO)$/propertynames.obj : $(INCCOM)$/propertynames.inc $(GENHEADERPATH)$/properties.hxx $(MISC)$/do_properties +$(MISC)$/do_properties $(do_phony) : properties.txt properties.pl properties.hxx.head properties.hxx.tail $(INCCOM)$/propertynames.inc $(GENHEADERPATH)$/properties.hxx + @@-$(RM) $@ + $(MKDIRHIER) $(GENHEADERPATH) + $(PERL) properties.pl properties.txt $(MISC)$/propertyids.inc $(INCCOM)$/propertynames.inc && $(TYPE) properties.hxx.head $(MISC)$/propertyids.inc properties.hxx.tail > $(GENHEADERPATH)$/properties.hxx && $(TOUCH) $@ diff --git a/oox/source/token/namespacemap.cxx b/oox/source/token/namespacemap.cxx new file mode 100755 index 000000000000..6d5e437f5b31 --- /dev/null +++ b/oox/source/token/namespacemap.cxx @@ -0,0 +1,49 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include "oox/token/namespacemap.hxx" + +namespace oox { + +// ============================================================================ + +NamespaceMap::NamespaceMap() +{ + static const struct NamespaceUrl { sal_Int32 mnId; sal_Char* mpcUrl; } spNamespaceUrls[] = + { +// include auto-generated C array with namespace URLs as C strings +#include "namespacenames.inc" + { -1, "" } + }; + + for( const NamespaceUrl* pNamespaceUrl = spNamespaceUrls; pNamespaceUrl->mnId != -1; ++pNamespaceUrl ) + operator[]( pNamespaceUrl->mnId ) = ::rtl::OUString::createFromAscii( pNamespaceUrl->mpcUrl ); +} + +// ============================================================================ + +} // namespace oox diff --git a/oox/source/token/namespaces.hxx.head b/oox/source/token/namespaces.hxx.head new file mode 100755 index 000000000000..351bf2558303 --- /dev/null +++ b/oox/source/token/namespaces.hxx.head @@ -0,0 +1,36 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef OOX_TOKEN_NAMESPACES_HXX +#define OOX_TOKEN_NAMESPACES_HXX + +#include + +namespace oox { + +// ============================================================================ + diff --git a/oox/source/token/namespaces.hxx.tail b/oox/source/token/namespaces.hxx.tail new file mode 100755 index 000000000000..651fc38511d4 --- /dev/null +++ b/oox/source/token/namespaces.hxx.tail @@ -0,0 +1,35 @@ + +// ============================================================================ + +const sal_Int32 TOKEN_MASK = static_cast< sal_Int32 >( (1 << NMSP_SHIFT) - 1 ); +const sal_Int32 NMSP_MASK = static_cast< sal_Int32 >( SAL_MAX_INT16 & ~TOKEN_MASK ); + +/** Returns the raw token identifier without namespace of the passed token. */ +inline sal_Int32 getBaseToken( sal_Int32 nToken ) { return nToken & TOKEN_MASK; } + +/** Returns the namespace without token identifier of the passed token. */ +inline sal_Int32 getNamespace( sal_Int32 nToken ) { return nToken & NMSP_MASK; } + +// defines for tokens with specific namespaces +#define A_TOKEN( token ) (::oox::NMSP_dml | XML_##token) +#define AX_TOKEN( token ) (::oox::NMSP_ax | XML_##token) +#define C_TOKEN( token ) (::oox::NMSP_dmlChart | XML_##token) +#define CDR_TOKEN( token ) (::oox::NMSP_dmlChartDr | XML_##token) +#define DGM_TOKEN( token ) (::oox::NMSP_dmlDiagram | XML_##token) +#define O_TOKEN( token ) (::oox::NMSP_vmlOffice | XML_##token) +#define PC_TOKEN( token ) (::oox::NMSP_packageContentTypes | XML_##token) +#define PPT_TOKEN( token ) (::oox::NMSP_ppt | XML_##token) +#define PR_TOKEN( token ) (::oox::NMSP_packageRel | XML_##token) +#define R_TOKEN( token ) (::oox::NMSP_officeRel | XML_##token) +#define VML_TOKEN( token ) (::oox::NMSP_vml | XML_##token) +#define VMLX_TOKEN( token ) (::oox::NMSP_vmlExcel | XML_##token) +#define XDR_TOKEN( token ) (::oox::NMSP_dmlSpreadDr | XML_##token) +#define XLS_TOKEN( token ) (::oox::NMSP_xls | XML_##token) +#define XM_TOKEN( token ) (::oox::NMSP_xm | XML_##token) +#define XML_TOKEN( token ) (::oox::NMSP_xml | XML_##token) + +// ============================================================================ + +} // namespace oox + +#endif diff --git a/oox/source/token/namespaces.pl b/oox/source/token/namespaces.pl new file mode 100644 index 000000000000..3c741fa7b2af --- /dev/null +++ b/oox/source/token/namespaces.pl @@ -0,0 +1,79 @@ +#************************************************************************* +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# Copyright 2000, 2010 Oracle and/or its affiliates. +# +# OpenOffice.org - a multi-platform office productivity suite +# +# This file is part of OpenOffice.org. +# +# OpenOffice.org is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License version 3 +# only, as published by the Free Software Foundation. +# +# OpenOffice.org is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License version 3 for more details +# (a copy is included in the LICENSE file that accompanied this code). +# +# You should have received a copy of the GNU Lesser General Public License +# version 3 along with OpenOffice.org. If not, see +# +# for a copy of the LGPLv3 License. +# +#************************************************************************* + +$ARGV0 = shift @ARGV; +$ARGV1 = shift @ARGV; +$ARGV2 = shift @ARGV; +$ARGV3 = shift @ARGV; + +# parse input file + +open( INFILE, $ARGV0 ) or die "cannot open input file: $!"; +my %namespaces; +while( ) +{ + # trim newline + chomp( $_ ); + # trim leading/trailing whitespace + $_ =~ s/^\s*//g; + $_ =~ s/\s*$//g; + # trim comments + $_ =~ s/^#.*//; + # skip empty lines + if( $_ ) + { + # check for valid characters + $_ =~ /^([a-zA-Z]+)\s+([a-zA-Z0-9-.:\/]+)\s*$/ or die "Error: invalid character in input data"; + $namespaces{$1} = $2; + } +} +close( INFILE ); + +# generate output files + +open( IDFILE, ">$ARGV1" ) or die "Error: cannot open output file: $!"; +open( NAMEFILE, ">$ARGV2" ) or die "Error: cannot open output file: $!"; +open( TXTFILE, ">$ARGV3" ) or die "Error: cannot open output file: $!"; + +# number of bits to shift the namespace identifier +$shift = 16; + +print ( IDFILE "const size_t NMSP_SHIFT = $shift;\n" ); + +$i = 1; +foreach( keys( %namespaces ) ) +{ + print( IDFILE "const sal_Int32 NMSP_$_ = $i << NMSP_SHIFT;\n" ); + $id = $i << $shift; + print( NAMEFILE "{ $id, \"$namespaces{$_}\" },\n" ); + print( TXTFILE "$id $_ $namespaces{$_}\n" ); + ++$i; +} + +close( IDFILE ); +close( nameFILE ); +close( TXTFILE ); diff --git a/oox/source/token/namespaces.txt b/oox/source/token/namespaces.txt index 45bb59541b1b..81b568067470 100644 --- a/oox/source/token/namespaces.txt +++ b/oox/source/token/namespaces.txt @@ -1,49 +1,52 @@ -# Relations, XML -XML -PACKAGE_RELATIONSHIPS -RELATIONSHIPS -CONTENT_TYPES - -# Office global -THEME -ACTIVATION -MATH - -#DrawingML -DRAWINGML -PICTURE -DIAGRAM -CHART -CDR -DOC_DRAWINGML - -# VML -VML -OFFICE -VML_DOC -VML_XLS -VML_PPT -AX - -#SpreadsheetML -XLS -XDR -XM - -#PresentationML -PPT - -#WordprocessingML -DOC -SML - -# Document properties -COREPR -DC -DCTERMS -EXTPR -CUSTPR -VT - -# Other elements: used by writerfilter -SPRM + +# generic XML ----------------------------------------------------------------- + +xml http://www.w3.org/XML/1998/namespace +schema http://schemas.openxmlformats.org/schemaLibrary/2006/main + +# package --------------------------------------------------------------------- + +packageContentTypes http://schemas.openxmlformats.org/package/2006/content-types +packageMetaCorePr http://schemas.openxmlformats.org/package/2006/metadata/core-properties +packageRel http://schemas.openxmlformats.org/package/2006/relationships + +# office shared --------------------------------------------------------------- + +officeCustomPr http://schemas.openxmlformats.org/officeDocument/2006/custom-properties +officeDocPropsVT http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes +officeExtPr http://schemas.openxmlformats.org/officeDocument/2006/extended-properties +officeMath http://schemas.openxmlformats.org/officeDocument/2006/math +officeRel http://schemas.openxmlformats.org/officeDocument/2006/relationships +officeRelTheme http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme + +# applications ---------------------------------------------------------------- + +doc http://schemas.openxmlformats.org/wordprocessingml/2006/main +xls http://schemas.openxmlformats.org/spreadsheetml/2006/main +ppt http://schemas.openxmlformats.org/presentationml/2006/main + +# drawing --------------------------------------------------------------------- + +dml http://schemas.openxmlformats.org/drawingml/2006/main +dmlChart http://schemas.openxmlformats.org/drawingml/2006/chart +dmlChartDr http://schemas.openxmlformats.org/drawingml/2006/chartDrawing +dmlDiagram http://schemas.openxmlformats.org/drawingml/2006/diagram +dmlPicture http://schemas.openxmlformats.org/drawingml/2006/picture +dmlSpreadDr http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing +dmlWordDr http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing + +# VML ------------------------------------------------------------------------- + +vml urn:schemas-microsoft-com:vml +vmlExcel urn:schemas-microsoft-com:office:excel +vmlOffice urn:schemas-microsoft-com:office:office +vmlPowerpoint urn:schemas-microsoft-com:office:powerpoint +vmlWord urn:schemas-microsoft-com:office:word + +# other ----------------------------------------------------------------------- + +ax http://schemas.microsoft.com/office/2006/activeX +dc http://purl.org/dc/elements/1.1/ +dcTerms http://purl.org/dc/terms/ +xm http://schemas.microsoft.com/office/excel/2006/main +sprm http://sprm diff --git a/oox/source/token/parsexsd.pl b/oox/source/token/parsexsd.pl index 3b6745121e4c..8fed059bbc44 100644 --- a/oox/source/token/parsexsd.pl +++ b/oox/source/token/parsexsd.pl @@ -1,3 +1,30 @@ +#************************************************************************* +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# Copyright 2000, 2010 Oracle and/or its affiliates. +# +# OpenOffice.org - a multi-platform office productivity suite +# +# This file is part of OpenOffice.org. +# +# OpenOffice.org is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License version 3 +# only, as published by the Free Software Foundation. +# +# OpenOffice.org is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License version 3 for more details +# (a copy is included in the LICENSE file that accompanied this code). +# +# You should have received a copy of the GNU Lesser General Public License +# version 3 along with OpenOffice.org. If not, see +# +# for a copy of the LGPLv3 License. +# +#************************************************************************* + $ARGV = shift @ARGV; my %tokens; diff --git a/oox/source/token/properties.hxx.head b/oox/source/token/properties.hxx.head new file mode 100755 index 000000000000..25817b5e72f3 --- /dev/null +++ b/oox/source/token/properties.hxx.head @@ -0,0 +1,36 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef OOX_TOKEN_PROPERTIES_HXX +#define OOX_TOKEN_PROPERTIES_HXX + +#include + +namespace oox { + +// ============================================================================ + diff --git a/oox/source/token/properties.hxx.tail b/oox/source/token/properties.hxx.tail new file mode 100755 index 000000000000..f647337e529c --- /dev/null +++ b/oox/source/token/properties.hxx.tail @@ -0,0 +1,6 @@ + +// ============================================================================ + +} // namespace oox + +#endif diff --git a/oox/source/token/properties.pl b/oox/source/token/properties.pl new file mode 100644 index 000000000000..f341924bbb90 --- /dev/null +++ b/oox/source/token/properties.pl @@ -0,0 +1,67 @@ +#************************************************************************* +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# Copyright 2000, 2010 Oracle and/or its affiliates. +# +# OpenOffice.org - a multi-platform office productivity suite +# +# This file is part of OpenOffice.org. +# +# OpenOffice.org is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License version 3 +# only, as published by the Free Software Foundation. +# +# OpenOffice.org is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License version 3 for more details +# (a copy is included in the LICENSE file that accompanied this code). +# +# You should have received a copy of the GNU Lesser General Public License +# version 3 along with OpenOffice.org. If not, see +# +# for a copy of the LGPLv3 License. +# +#************************************************************************* + +$ARGV0 = shift @ARGV; +$ARGV1 = shift @ARGV; +$ARGV2 = shift @ARGV; + +# parse input file + +open( INFILE, $ARGV0 ) or die "Error: cannot open input file: $!"; +my %props; +while( ) +{ + # trim newline + chomp( $_ ); + # trim leading/trailing whitespace + $_ =~ s/^\s*//g; + $_ =~ s/\s*$//g; + # check for valid characters + $_ =~ /^[A-Z][a-zA-Z0-9]*$/ or die "Error: invalid character in property '$_'"; + $id = "PROP_$_"; + $props{$_} = $id; +} +close( INFILE ); + +# generate output files + +open( IDFILE, ">$ARGV1" ) or die "Error: cannot open output file: $!"; +open( NAMEFILE, ">$ARGV2" ) or die "Error: cannot open output file: $!"; + +$i = 0; +foreach( sort( keys( %props ) ) ) +{ + print( IDFILE "const sal_Int32 $props{$_} = $i;\n" ); + print( NAMEFILE "/* $i */ \"$_\",\n" ); + ++$i; +} + +print( IDFILE "const sal_Int32 PROP_COUNT = $i;\n" ); +print( IDFILE "const sal_Int32 PROP_INVALID = -1;\n" ); + +close( IDFILE ); +close( NAMEFILE ); diff --git a/oox/source/token/propertylist.cxx b/oox/source/token/propertylist.cxx deleted file mode 100644 index 0ffc902fcdc0..000000000000 --- a/oox/source/token/propertylist.cxx +++ /dev/null @@ -1,56 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#include "oox/token/propertylist.hxx" -#include "properties.hxx" - -namespace oox { - -namespace { - -// include auto-generated property name lists -#include "propertywords.inc" - -} // namespace - -// ============================================================================ - -PropertyList::PropertyList() -{ - reserve( static_cast< size_t >( PROP_COUNT ) ); - for( sal_Int32 nIdx = 0; nIdx < PROP_COUNT; ++nIdx ) - push_back( ::rtl::OUString::createFromAscii( propertywordlist[ nIdx ] ) ); -} - -PropertyList::~PropertyList() -{ -} - -// ============================================================================ - -} // namespace oox - diff --git a/oox/source/token/propertynames.cxx b/oox/source/token/propertynames.cxx new file mode 100644 index 000000000000..401d168fe696 --- /dev/null +++ b/oox/source/token/propertynames.cxx @@ -0,0 +1,51 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include "oox/token/propertynames.hxx" + +namespace oox { + +// ============================================================================ + +PropertyNameVector::PropertyNameVector() +{ + static const sal_Char* sppcPropertyNames[] = + { + // include auto-generated C array with property names as C strings +#include "propertynames.inc" + "" + }; + + size_t nArraySize = (sizeof( sppcPropertyNames ) / sizeof( *sppcPropertyNames )) - 1; + reserve( nArraySize ); + for( size_t nIndex = 0; nIndex < nArraySize; ++nIndex ) + push_back( ::rtl::OUString::createFromAscii( sppcPropertyNames[ nIndex ] ) ); +} + +// ============================================================================ + +} // namespace oox diff --git a/oox/source/token/tokenmap.cxx b/oox/source/token/tokenmap.cxx index b5ed8e9a9323..dcd354ea84ed 100644 --- a/oox/source/token/tokenmap.cxx +++ b/oox/source/token/tokenmap.cxx @@ -26,28 +26,26 @@ ************************************************************************/ #include "oox/token/tokenmap.hxx" + #include #include #include -#include "tokens.hxx" #include "oox/helper/containerhelper.hxx" +#include "oox/token/tokens.hxx" -#include +namespace oox { +// ============================================================================ + +using ::com::sun::star::uno::Sequence; using ::rtl::OString; using ::rtl::OUString; -using ::com::sun::star::uno::Sequence; - -namespace oox { // ============================================================================ namespace { - -// include auto-generated token lists -#include "tokens.inc" -#include "tokenwords.inc" - +// include auto-generated Perfect_Hash +#include "tokenhash.inc" } // namespace // ============================================================================ @@ -55,10 +53,17 @@ namespace { TokenMap::TokenMap() : maTokenNames( static_cast< size_t >( XML_TOKEN_COUNT ) ) { - const sal_Char* const* ppcTokenWord = xmltokenwordlist; - for( TokenNameVector::iterator aIt = maTokenNames.begin(), aEnd = maTokenNames.end(); aIt != aEnd; ++aIt, ++ppcTokenWord ) + static const sal_Char* sppcTokenNames[] = { - OString aUtf8Token( *ppcTokenWord ); +// include auto-generated C array with token names as C strings +#include "tokennames.inc" + "" + }; + + const sal_Char* const* ppcTokenName = sppcTokenNames; + for( TokenNameVector::iterator aIt = maTokenNames.begin(), aEnd = maTokenNames.end(); aIt != aEnd; ++aIt, ++ppcTokenName ) + { + OString aUtf8Token( *ppcTokenName ); aIt->maUniName = OStringToOUString( aUtf8Token, RTL_TEXTENCODING_UTF8 ); aIt->maUtf8Name = Sequence< sal_Int8 >( reinterpret_cast< const sal_Int8* >( aUtf8Token.getStr() ), aUtf8Token.getLength() ); } @@ -72,7 +77,7 @@ TokenMap::TokenMap() : OString aUtf8Name = OUStringToOString( maTokenNames[ nToken ].maUniName, RTL_TEXTENCODING_UTF8 ); struct xmltoken* pToken = Perfect_Hash::in_word_set( aUtf8Name.getStr(), aUtf8Name.getLength() ); bOk = pToken && (pToken->nToken == nToken); - OSL_ENSURE( bOk, ::rtl::OStringBuffer( "FastTokenHandler::FastTokenHandler - token list broken, #" ). + OSL_ENSURE( bOk, ::rtl::OStringBuffer( "TokenMap::TokenMap - token list broken, #" ). append( nToken ).append( ", '" ).append( aUtf8Name ).append( '\'' ).getStr() ); } #endif @@ -111,4 +116,3 @@ sal_Int32 TokenMap::getTokenFromUtf8( const Sequence< sal_Int8 >& rUtf8Name ) co // ============================================================================ } // namespace oox - diff --git a/oox/source/token/tokens.hxx.head b/oox/source/token/tokens.hxx.head new file mode 100755 index 000000000000..dd201caeb1d9 --- /dev/null +++ b/oox/source/token/tokens.hxx.head @@ -0,0 +1,36 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef OOX_TOKEN_TOKENS_HXX +#define OOX_TOKEN_TOKENS_HXX + +#include + +namespace oox { + +// ============================================================================ + diff --git a/oox/source/token/tokens.hxx.tail b/oox/source/token/tokens.hxx.tail new file mode 100755 index 000000000000..df4b5ef1a955 --- /dev/null +++ b/oox/source/token/tokens.hxx.tail @@ -0,0 +1,8 @@ + +const sal_Int32 XML_TOKEN_INVALID = ::com::sun::star::xml::sax::FastToken::DONTKNOW; + +// ============================================================================ + +} // namespace oox + +#endif diff --git a/oox/source/token/tokens.pl b/oox/source/token/tokens.pl new file mode 100644 index 000000000000..a951cee80db2 --- /dev/null +++ b/oox/source/token/tokens.pl @@ -0,0 +1,80 @@ +#************************************************************************* +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# Copyright 2000, 2010 Oracle and/or its affiliates. +# +# OpenOffice.org - a multi-platform office productivity suite +# +# This file is part of OpenOffice.org. +# +# OpenOffice.org is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License version 3 +# only, as published by the Free Software Foundation. +# +# OpenOffice.org is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License version 3 for more details +# (a copy is included in the LICENSE file that accompanied this code). +# +# You should have received a copy of the GNU Lesser General Public License +# version 3 along with OpenOffice.org. If not, see +# +# for a copy of the LGPLv3 License. +# +#************************************************************************* + +$ARGV0 = shift @ARGV; +$ARGV1 = shift @ARGV; +$ARGV2 = shift @ARGV; +$ARGV3 = shift @ARGV; + +open( INFILE, $ARGV0 ) or die "Error: cannot open input file: $!"; +my %tokens; +while ( ) +{ + # trim newline + chomp( $_ ); + # trim leading/trailing whitespace + $_ =~ s/^\s*//g; + $_ =~ s/\s*$//g; + # check for valid characters + $_ =~ /^[a-zA-Z0-9-_]+$/ or die "Error: invalid character in token '$_'"; + $id = "XML_$_"; + $id =~ s/-/_/g; + $tokens{$_} = $id; +} +close ( INFILE ); + +# generate output files + +open ( IDFILE, ">$ARGV1" ) or die "Error: cannot open output file: $!"; +open ( NAMEFILE, ">$ARGV2" ) or die "Error: cannot open output file: $!"; +open ( GPERFFILE, ">$ARGV3" ) or die "Error: cannot open output file: $!"; + +print( GPERFFILE "%language=C++\n" ); +print( GPERFFILE "%global-table\n" ); +print( GPERFFILE "%null-strings\n" ); +print( GPERFFILE "%struct-type\n" ); +print( GPERFFILE "struct xmltoken {\n" ); +print( GPERFFILE " const sal_Char *name;\n" ); +print( GPERFFILE " sal_Int32 nToken;\n" ); +print( GPERFFILE "};\n" ); +print( GPERFFILE "%%\n" ); + +$i = 0; +foreach( sort( keys( %tokens ) ) ) +{ + print( IDFILE "const sal_Int32 $tokens{$_} = $i;\n" ); + print( NAMEFILE "\"$_\",\n" ); + print( GPERFFILE "$_,$tokens{$_}\n" ); + ++$i; +} + +print( IDFILE "const sal_Int32 XML_TOKEN_COUNT = $i;\n" ); +print( GPERFFILE "%%\n" ); + +close( IDFILE ); +close( NAMEFILE ); +close( GPERFFILE ); diff --git a/oox/source/vml/vmldrawing.cxx b/oox/source/vml/vmldrawing.cxx index 065558d68c9f..c53dd2896395 100644 --- a/oox/source/vml/vmldrawing.cxx +++ b/oox/source/vml/vmldrawing.cxx @@ -35,7 +35,6 @@ #include "oox/ole/axcontrol.hxx" #include "oox/vml/vmlshape.hxx" #include "oox/vml/vmlshapecontainer.hxx" -#include "tokens.hxx" namespace oox { namespace vml { diff --git a/oox/source/vml/vmldrawingfragment.cxx b/oox/source/vml/vmldrawingfragment.cxx index aaa4532e5328..dc5c82515691 100644 --- a/oox/source/vml/vmldrawingfragment.cxx +++ b/oox/source/vml/vmldrawingfragment.cxx @@ -38,10 +38,8 @@ namespace vml { using namespace ::com::sun::star::io; 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/vml/vmlformatting.cxx b/oox/source/vml/vmlformatting.cxx index 9aa91597dcc9..cd280d041eb9 100644 --- a/oox/source/vml/vmlformatting.cxx +++ b/oox/source/vml/vmlformatting.cxx @@ -35,7 +35,6 @@ #include "oox/helper/attributelist.hxx" #include "oox/helper/graphichelper.hxx" #include "oox/helper/propertymap.hxx" -#include "tokens.hxx" namespace oox { namespace vml { diff --git a/oox/source/vml/vmlshape.cxx b/oox/source/vml/vmlshape.cxx index 5603d1b541b1..93301357984f 100644 --- a/oox/source/vml/vmlshape.cxx +++ b/oox/source/vml/vmlshape.cxx @@ -45,7 +45,6 @@ #include "oox/vml/vmldrawing.hxx" #include "oox/vml/vmlshapecontainer.hxx" #include "oox/vml/vmltextbox.hxx" -#include "properties.hxx" namespace oox { namespace vml { diff --git a/oox/source/vml/vmltextbox.cxx b/oox/source/vml/vmltextbox.cxx index e684490f39af..f56eb387d5b2 100755 --- a/oox/source/vml/vmltextbox.cxx +++ b/oox/source/vml/vmltextbox.cxx @@ -28,7 +28,6 @@ #include "oox/vml/vmltextbox.hxx" #include -#include "tokens.hxx" namespace oox { namespace vml { diff --git a/oox/source/xls/autofilterbuffer.cxx b/oox/source/xls/autofilterbuffer.cxx index 15cb2f726327..9017fefa9e9c 100755 --- a/oox/source/xls/autofilterbuffer.cxx +++ b/oox/source/xls/autofilterbuffer.cxx @@ -34,15 +34,12 @@ #include #include #include -#include "oox/core/namespaces.hxx" #include "oox/helper/attributelist.hxx" #include "oox/helper/propertyset.hxx" #include "oox/helper/recordinputstream.hxx" #include "oox/xls/addressconverter.hxx" #include "oox/xls/biffinputstream.hxx" #include "oox/xls/defnamesbuffer.hxx" -#include "properties.hxx" -#include "tokens.hxx" namespace oox { namespace xls { diff --git a/oox/source/xls/chartsheetfragment.cxx b/oox/source/xls/chartsheetfragment.cxx index 5a8a3774c9c5..ca5c9c77b2d7 100644 --- a/oox/source/xls/chartsheetfragment.cxx +++ b/oox/source/xls/chartsheetfragment.cxx @@ -40,8 +40,8 @@ namespace xls { // ============================================================================ -using ::oox::core::ContextHandlerRef; -using ::oox::core::RecordInfo; +using namespace ::oox::core; + using ::rtl::OUString; // ============================================================================ diff --git a/oox/source/xls/commentsfragment.cxx b/oox/source/xls/commentsfragment.cxx index 7df1269be8e0..9346686c79fb 100644 --- a/oox/source/xls/commentsfragment.cxx +++ b/oox/source/xls/commentsfragment.cxx @@ -34,8 +34,8 @@ namespace xls { // ============================================================================ -using ::oox::core::ContextHandlerRef; -using ::oox::core::RecordInfo; +using namespace ::oox::core; + using ::rtl::OUString; // ============================================================================ diff --git a/oox/source/xls/condformatbuffer.cxx b/oox/source/xls/condformatbuffer.cxx index e79684012d92..066b8188ddae 100644 --- a/oox/source/xls/condformatbuffer.cxx +++ b/oox/source/xls/condformatbuffer.cxx @@ -48,7 +48,6 @@ #include "oox/xls/addressconverter.hxx" #include "oox/xls/biffinputstream.hxx" #include "oox/xls/stylesbuffer.hxx" -#include "properties.hxx" namespace oox { namespace xls { diff --git a/oox/source/xls/connectionsbuffer.cxx b/oox/source/xls/connectionsbuffer.cxx index 12df30fe493f..30472d7dd919 100755 --- a/oox/source/xls/connectionsbuffer.cxx +++ b/oox/source/xls/connectionsbuffer.cxx @@ -27,11 +27,9 @@ #include "oox/xls/connectionsbuffer.hxx" -#include "oox/core/namespaces.hxx" #include "oox/helper/attributelist.hxx" #include "oox/helper/recordinputstream.hxx" #include "oox/xls/biffinputstream.hxx" -#include "tokens.hxx" namespace oox { namespace xls { diff --git a/oox/source/xls/connectionsfragment.cxx b/oox/source/xls/connectionsfragment.cxx index f83f9028faa8..1d60a954a8a8 100644 --- a/oox/source/xls/connectionsfragment.cxx +++ b/oox/source/xls/connectionsfragment.cxx @@ -36,9 +36,9 @@ namespace xls { // ============================================================================ +using namespace ::oox::core; + using ::rtl::OUString; -using ::oox::core::ContextHandlerRef; -using ::oox::core::RecordInfo; // ============================================================================ diff --git a/oox/source/xls/defnamesbuffer.cxx b/oox/source/xls/defnamesbuffer.cxx index 94ca1fb321bf..360281143d88 100644 --- a/oox/source/xls/defnamesbuffer.cxx +++ b/oox/source/xls/defnamesbuffer.cxx @@ -42,7 +42,6 @@ #include "oox/xls/externallinkbuffer.hxx" #include "oox/xls/formulaparser.hxx" #include "oox/xls/worksheetbuffer.hxx" -#include "properties.hxx" namespace oox { namespace xls { diff --git a/oox/source/xls/drawingfragment.cxx b/oox/source/xls/drawingfragment.cxx index ce99f1f7060f..5ba60ffeb4d3 100644 --- a/oox/source/xls/drawingfragment.cxx +++ b/oox/source/xls/drawingfragment.cxx @@ -44,7 +44,6 @@ #include "oox/xls/stylesbuffer.hxx" #include "oox/xls/themebuffer.hxx" #include "oox/xls/unitconverter.hxx" -#include "properties.hxx" namespace oox { namespace xls { diff --git a/oox/source/xls/excelfilter.cxx b/oox/source/xls/excelfilter.cxx index 030b9cf203c1..13d4cbd14fcc 100644 --- a/oox/source/xls/excelfilter.cxx +++ b/oox/source/xls/excelfilter.cxx @@ -121,7 +121,7 @@ bool ExcelFilter::importDocument() throw() this variable (nonpro only). */ OOX_DUMP_FILE( ::oox::dump::xlsb::Dumper ); - OUString aWorkbookPath = getFragmentPathFromFirstType( CREATE_OFFICEDOC_RELATIONSTYPE( "officeDocument" ) ); + OUString aWorkbookPath = getFragmentPathFromFirstType( CREATE_OFFICEDOC_RELATION_TYPE( "officeDocument" ) ); if( aWorkbookPath.getLength() == 0 ) return false; diff --git a/oox/source/xls/excelvbaproject.cxx b/oox/source/xls/excelvbaproject.cxx index c21a65b75961..7fc8115cc680 100755 --- a/oox/source/xls/excelvbaproject.cxx +++ b/oox/source/xls/excelvbaproject.cxx @@ -38,7 +38,6 @@ #include #include "oox/helper/helper.hxx" #include "oox/helper/propertyset.hxx" -#include "properties.hxx" namespace oox { namespace xls { diff --git a/oox/source/xls/externallinkbuffer.cxx b/oox/source/xls/externallinkbuffer.cxx index 73264f338850..36c5dc984cb2 100644 --- a/oox/source/xls/externallinkbuffer.cxx +++ b/oox/source/xls/externallinkbuffer.cxx @@ -46,7 +46,6 @@ #include "oox/xls/excelhandlers.hxx" #include "oox/xls/formulaparser.hxx" #include "oox/xls/worksheetbuffer.hxx" -#include "properties.hxx" namespace oox { namespace xls { @@ -812,8 +811,8 @@ ExternalNameRef ExternalLink::getNameByIndex( sal_Int32 nIndex ) const // private -------------------------------------------------------------------- -#define OOX_TARGETTYPE_EXTLINK CREATE_OFFICEDOC_RELATIONSTYPE( "externalLinkPath" ) -#define OOX_TARGETTYPE_LIBRARY CREATE_MSOFFICE_RELATIONSTYPE( "xlExternalLinkPath/xlLibrary" ) +#define OOX_TARGETTYPE_EXTLINK CREATE_OFFICEDOC_RELATION_TYPE( "externalLinkPath" ) +#define OOX_TARGETTYPE_LIBRARY CREATE_MSOFFICE_RELATION_TYPE( "xlExternalLinkPath/xlLibrary" ) void ExternalLink::setExternalTargetUrl( const OUString& rTargetUrl, const OUString& rTargetType ) { diff --git a/oox/source/xls/externallinkfragment.cxx b/oox/source/xls/externallinkfragment.cxx index d519e27e1506..9d984c918145 100644 --- a/oox/source/xls/externallinkfragment.cxx +++ b/oox/source/xls/externallinkfragment.cxx @@ -42,10 +42,8 @@ namespace xls { using namespace ::com::sun::star::sheet; using namespace ::com::sun::star::table; using namespace ::com::sun::star::uno; +using namespace ::oox::core; -using ::oox::core::ContextHandlerRef; -using ::oox::core::RecordInfo; -using ::oox::core::Relation; using ::rtl::OUString; // ============================================================================ diff --git a/oox/source/xls/formulabase.cxx b/oox/source/xls/formulabase.cxx index da7dc78e954a..21dd049c0515 100644 --- a/oox/source/xls/formulabase.cxx +++ b/oox/source/xls/formulabase.cxx @@ -45,7 +45,6 @@ #include "oox/core/filterbase.hxx" #include "oox/helper/recordinputstream.hxx" #include "oox/xls/biffinputstream.hxx" -#include "properties.hxx" namespace oox { namespace xls { diff --git a/oox/source/xls/formulaparser.cxx b/oox/source/xls/formulaparser.cxx index 89b88915d162..7ab32981a6ba 100644 --- a/oox/source/xls/formulaparser.cxx +++ b/oox/source/xls/formulaparser.cxx @@ -41,7 +41,6 @@ #include "oox/xls/externallinkbuffer.hxx" #include "oox/xls/tablebuffer.hxx" #include "oox/xls/worksheethelper.hxx" -#include "properties.hxx" namespace oox { namespace xls { diff --git a/oox/source/xls/numberformatsbuffer.cxx b/oox/source/xls/numberformatsbuffer.cxx index 36b51c03cfe8..f610167e5edd 100644 --- a/oox/source/xls/numberformatsbuffer.cxx +++ b/oox/source/xls/numberformatsbuffer.cxx @@ -42,7 +42,6 @@ #include "oox/helper/propertymap.hxx" #include "oox/helper/recordinputstream.hxx" #include "oox/xls/biffinputstream.hxx" -#include "properties.hxx" namespace oox { namespace xls { diff --git a/oox/source/xls/pagesettings.cxx b/oox/source/xls/pagesettings.cxx index 7509552ffc09..b50a23989356 100644 --- a/oox/source/xls/pagesettings.cxx +++ b/oox/source/xls/pagesettings.cxx @@ -49,7 +49,6 @@ #include "oox/xls/excelhandlers.hxx" #include "oox/xls/stylesbuffer.hxx" #include "oox/xls/unitconverter.hxx" -#include "properties.hxx" namespace oox { namespace xls { diff --git a/oox/source/xls/pivotcachebuffer.cxx b/oox/source/xls/pivotcachebuffer.cxx index e0c3cec9c193..76fd48dc3ab1 100644 --- a/oox/source/xls/pivotcachebuffer.cxx +++ b/oox/source/xls/pivotcachebuffer.cxx @@ -47,7 +47,6 @@ #include "oox/xls/tablebuffer.hxx" #include "oox/xls/unitconverter.hxx" #include "oox/xls/worksheetbuffer.hxx" -#include "properties.hxx" namespace oox { namespace xls { diff --git a/oox/source/xls/pivotcachefragment.cxx b/oox/source/xls/pivotcachefragment.cxx index 8c4f56c7c820..68e24c03c3d7 100644 --- a/oox/source/xls/pivotcachefragment.cxx +++ b/oox/source/xls/pivotcachefragment.cxx @@ -39,9 +39,8 @@ namespace xls { // ============================================================================ using namespace ::com::sun::star::uno; +using namespace ::oox::core; -using ::oox::core::ContextHandlerRef; -using ::oox::core::RecordInfo; using ::rtl::OUString; // ============================================================================ diff --git a/oox/source/xls/pivottablebuffer.cxx b/oox/source/xls/pivottablebuffer.cxx index df611b0cb3c4..be48e63f001f 100644 --- a/oox/source/xls/pivottablebuffer.cxx +++ b/oox/source/xls/pivottablebuffer.cxx @@ -51,7 +51,6 @@ #include "oox/helper/recordinputstream.hxx" #include "oox/xls/addressconverter.hxx" #include "oox/xls/biffinputstream.hxx" -#include "properties.hxx" namespace oox { namespace xls { diff --git a/oox/source/xls/pivottablefragment.cxx b/oox/source/xls/pivottablefragment.cxx index 1ed95b141b61..7c16eb7c5b51 100644 --- a/oox/source/xls/pivottablefragment.cxx +++ b/oox/source/xls/pivottablefragment.cxx @@ -35,8 +35,8 @@ namespace xls { // ============================================================================ -using ::oox::core::ContextHandlerRef; -using ::oox::core::RecordInfo; +using namespace ::oox::core; + using ::rtl::OUString; // ============================================================================ diff --git a/oox/source/xls/querytablebuffer.cxx b/oox/source/xls/querytablebuffer.cxx index 2a4df73287ca..26f677f1bbc3 100644 --- a/oox/source/xls/querytablebuffer.cxx +++ b/oox/source/xls/querytablebuffer.cxx @@ -37,7 +37,6 @@ #include "oox/xls/biffinputstream.hxx" #include "oox/xls/connectionsbuffer.hxx" #include "oox/xls/defnamesbuffer.hxx" -#include "properties.hxx" namespace oox { namespace xls { diff --git a/oox/source/xls/querytablefragment.cxx b/oox/source/xls/querytablefragment.cxx index 2f4b2d06ff11..a6ed80af2194 100644 --- a/oox/source/xls/querytablefragment.cxx +++ b/oox/source/xls/querytablefragment.cxx @@ -35,8 +35,8 @@ namespace xls { // ============================================================================ -using ::oox::core::ContextHandlerRef; -using ::oox::core::RecordInfo; +using namespace ::oox::core; + using ::rtl::OUString; // ============================================================================ diff --git a/oox/source/xls/scenariobuffer.cxx b/oox/source/xls/scenariobuffer.cxx index 2c55d2fab4e5..697b74889dad 100644 --- a/oox/source/xls/scenariobuffer.cxx +++ b/oox/source/xls/scenariobuffer.cxx @@ -38,7 +38,6 @@ #include "oox/helper/recordinputstream.hxx" #include "oox/xls/addressconverter.hxx" #include "oox/xls/biffinputstream.hxx" -#include "properties.hxx" namespace oox { namespace xls { diff --git a/oox/source/xls/sharedformulabuffer.cxx b/oox/source/xls/sharedformulabuffer.cxx index 748a0c0576ae..0cf616646722 100644 --- a/oox/source/xls/sharedformulabuffer.cxx +++ b/oox/source/xls/sharedformulabuffer.cxx @@ -34,7 +34,6 @@ #include "oox/xls/addressconverter.hxx" #include "oox/xls/biffinputstream.hxx" #include "oox/xls/formulaparser.hxx" -#include "properties.hxx" namespace oox { namespace xls { diff --git a/oox/source/xls/sharedstringsfragment.cxx b/oox/source/xls/sharedstringsfragment.cxx index 041e87f52980..a356e9b29d7e 100644 --- a/oox/source/xls/sharedstringsfragment.cxx +++ b/oox/source/xls/sharedstringsfragment.cxx @@ -35,8 +35,8 @@ namespace xls { // ============================================================================ -using ::oox::core::ContextHandlerRef; -using ::oox::core::RecordInfo; +using namespace ::oox::core; + using ::rtl::OUString; // ============================================================================ diff --git a/oox/source/xls/stylesbuffer.cxx b/oox/source/xls/stylesbuffer.cxx index 36e5741818f3..13c4bb6612a6 100644 --- a/oox/source/xls/stylesbuffer.cxx +++ b/oox/source/xls/stylesbuffer.cxx @@ -54,7 +54,6 @@ #include "oox/xls/excelhandlers.hxx" #include "oox/xls/themebuffer.hxx" #include "oox/xls/unitconverter.hxx" -#include "properties.hxx" namespace oox { namespace xls { diff --git a/oox/source/xls/stylesfragment.cxx b/oox/source/xls/stylesfragment.cxx index 1014cece5210..2ea01a8a84e2 100644 --- a/oox/source/xls/stylesfragment.cxx +++ b/oox/source/xls/stylesfragment.cxx @@ -34,8 +34,8 @@ namespace xls { // ============================================================================ -using ::oox::core::ContextHandlerRef; -using ::oox::core::RecordInfo; +using namespace ::oox::core; + using ::rtl::OUString; // ============================================================================ diff --git a/oox/source/xls/tablebuffer.cxx b/oox/source/xls/tablebuffer.cxx index 53408f366ae5..b3dac5e85eed 100644 --- a/oox/source/xls/tablebuffer.cxx +++ b/oox/source/xls/tablebuffer.cxx @@ -32,7 +32,6 @@ #include "oox/helper/propertyset.hxx" #include "oox/helper/recordinputstream.hxx" #include "oox/xls/addressconverter.hxx" -#include "properties.hxx" namespace oox { namespace xls { diff --git a/oox/source/xls/tablefragment.cxx b/oox/source/xls/tablefragment.cxx index 853a3d73ecd0..027a37eb4dcc 100644 --- a/oox/source/xls/tablefragment.cxx +++ b/oox/source/xls/tablefragment.cxx @@ -36,8 +36,8 @@ namespace xls { // ============================================================================ -using ::oox::core::ContextHandlerRef; -using ::oox::core::RecordInfo; +using namespace ::oox::core; + using ::rtl::OUString; // ============================================================================ diff --git a/oox/source/xls/themebuffer.cxx b/oox/source/xls/themebuffer.cxx index 0884dfcb0b56..c3e016327133 100644 --- a/oox/source/xls/themebuffer.cxx +++ b/oox/source/xls/themebuffer.cxx @@ -28,7 +28,6 @@ #include "oox/xls/themebuffer.hxx" #include "oox/xls/stylesbuffer.hxx" -#include "tokens.hxx" namespace oox { namespace xls { diff --git a/oox/source/xls/unitconverter.cxx b/oox/source/xls/unitconverter.cxx index 8aa9ee35a718..1b5f1e9b072c 100644 --- a/oox/source/xls/unitconverter.cxx +++ b/oox/source/xls/unitconverter.cxx @@ -37,7 +37,6 @@ #include "oox/core/filterbase.hxx" #include "oox/helper/propertyset.hxx" #include "oox/xls/stylesbuffer.hxx" -#include "properties.hxx" namespace oox { namespace xls { diff --git a/oox/source/xls/viewsettings.cxx b/oox/source/xls/viewsettings.cxx index 6d6ae85055df..b86ec1fe7612 100644 --- a/oox/source/xls/viewsettings.cxx +++ b/oox/source/xls/viewsettings.cxx @@ -45,7 +45,6 @@ #include "oox/xls/unitconverter.hxx" #include "oox/xls/workbooksettings.hxx" #include "oox/xls/worksheetbuffer.hxx" -#include "properties.hxx" namespace oox { namespace xls { diff --git a/oox/source/xls/workbookfragment.cxx b/oox/source/xls/workbookfragment.cxx index 60e77c60c6bd..042acc50dcbb 100644 --- a/oox/source/xls/workbookfragment.cxx +++ b/oox/source/xls/workbookfragment.cxx @@ -59,11 +59,8 @@ namespace xls { using namespace ::com::sun::star::io; using namespace ::com::sun::star::table; using namespace ::com::sun::star::uno; +using namespace ::oox::core; -using ::oox::core::ContextHandlerRef; -using ::oox::core::FragmentHandlerRef; -using ::oox::core::RecordInfo; -using ::oox::core::Relation; using ::oox::drawingml::ThemeFragmentHandler; using ::rtl::OUString; @@ -200,25 +197,25 @@ void WorkbookFragment::finalizeImport() ISegmentProgressBarRef xGlobalSegment = getProgressBar().createSegment( PROGRESS_LENGTH_GLOBALS ); // read the theme substream - OUString aThemeFragmentPath = getFragmentPathFromFirstType( CREATE_OFFICEDOC_RELATIONSTYPE( "theme" ) ); + OUString aThemeFragmentPath = getFragmentPathFromFirstType( CREATE_OFFICEDOC_RELATION_TYPE( "theme" ) ); if( aThemeFragmentPath.getLength() > 0 ) importOoxFragment( new ThemeFragmentHandler( getFilter(), aThemeFragmentPath, getTheme() ) ); xGlobalSegment->setPosition( 0.25 ); // read the styles substream (requires finalized theme buffer) - OUString aStylesFragmentPath = getFragmentPathFromFirstType( CREATE_OFFICEDOC_RELATIONSTYPE( "styles" ) ); + OUString aStylesFragmentPath = getFragmentPathFromFirstType( CREATE_OFFICEDOC_RELATION_TYPE( "styles" ) ); if( aStylesFragmentPath.getLength() > 0 ) importOoxFragment( new StylesFragment( *this, aStylesFragmentPath ) ); xGlobalSegment->setPosition( 0.5 ); // read the shared string table substream (requires finalized styles buffer) - OUString aSstFragmentPath = getFragmentPathFromFirstType( CREATE_OFFICEDOC_RELATIONSTYPE( "sharedStrings" ) ); + OUString aSstFragmentPath = getFragmentPathFromFirstType( CREATE_OFFICEDOC_RELATION_TYPE( "sharedStrings" ) ); if( aSstFragmentPath.getLength() > 0 ) importOoxFragment( new SharedStringsFragment( *this, aSstFragmentPath ) ); xGlobalSegment->setPosition( 0.75 ); // read the connections substream - OUString aConnFragmentPath = getFragmentPathFromFirstType( CREATE_OFFICEDOC_RELATIONSTYPE( "connections" ) ); + OUString aConnFragmentPath = getFragmentPathFromFirstType( CREATE_OFFICEDOC_RELATION_TYPE( "connections" ) ); if( aConnFragmentPath.getLength() > 0 ) importOoxFragment( new ConnectionsFragment( *this, aConnFragmentPath ) ); xGlobalSegment->setPosition( 1.0 ); @@ -247,20 +244,20 @@ void WorkbookFragment::finalizeImport() ISegmentProgressBarRef xSheetSegment = getProgressBar().createSegment( fSegmentLength ); // create the fragment according to the sheet type - if( pRelation->maType == CREATE_OFFICEDOC_RELATIONSTYPE( "worksheet" ) ) + if( pRelation->maType == CREATE_OFFICEDOC_RELATION_TYPE( "worksheet" ) ) { xFragment.set( new WorksheetFragment( *this, aFragmentPath, xSheetSegment, SHEETTYPE_WORKSHEET, nCalcSheet ) ); } - else if( pRelation->maType == CREATE_OFFICEDOC_RELATIONSTYPE( "chartsheet" ) ) + else if( pRelation->maType == CREATE_OFFICEDOC_RELATION_TYPE( "chartsheet" ) ) { xFragment.set( new ChartsheetFragment( *this, aFragmentPath, xSheetSegment, nCalcSheet ) ); } - else if( (pRelation->maType == CREATE_MSOFFICE_RELATIONSTYPE( "xlMacrosheet" )) || - (pRelation->maType == CREATE_MSOFFICE_RELATIONSTYPE( "xlIntlMacrosheet" )) ) + else if( (pRelation->maType == CREATE_MSOFFICE_RELATION_TYPE( "xlMacrosheet" )) || + (pRelation->maType == CREATE_MSOFFICE_RELATION_TYPE( "xlIntlMacrosheet" )) ) { xFragment.set( new WorksheetFragment( *this, aFragmentPath, xSheetSegment, SHEETTYPE_MACROSHEET, nCalcSheet ) ); } - else if( pRelation->maType == CREATE_OFFICEDOC_RELATIONSTYPE( "dialogsheet" ) ) + else if( pRelation->maType == CREATE_OFFICEDOC_RELATION_TYPE( "dialogsheet" ) ) { xFragment.set( new WorksheetFragment( *this, aFragmentPath, xSheetSegment, SHEETTYPE_DIALOGSHEET, nCalcSheet ) ); } @@ -288,7 +285,7 @@ void WorkbookFragment::finalizeImport() } // open the VBA project storage - OUString aVbaFragmentPath = getFragmentPathFromFirstType( CREATE_MSOFFICE_RELATIONSTYPE( "vbaProject" ) ); + OUString aVbaFragmentPath = getFragmentPathFromFirstType( CREATE_MSOFFICE_RELATION_TYPE( "vbaProject" ) ); if( aVbaFragmentPath.getLength() > 0 ) { Reference< XInputStream > xInStrm = getBaseFilter().openInputStream( aVbaFragmentPath ); diff --git a/oox/source/xls/workbookhelper.cxx b/oox/source/xls/workbookhelper.cxx index e523d6e42111..8cd2748101d7 100644 --- a/oox/source/xls/workbookhelper.cxx +++ b/oox/source/xls/workbookhelper.cxx @@ -65,7 +65,6 @@ #include "oox/xls/viewsettings.hxx" #include "oox/xls/workbooksettings.hxx" #include "oox/xls/worksheetbuffer.hxx" -#include "properties.hxx" namespace oox { namespace xls { diff --git a/oox/source/xls/workbooksettings.cxx b/oox/source/xls/workbooksettings.cxx index 526bb375a7cf..e54628a6143f 100644 --- a/oox/source/xls/workbooksettings.cxx +++ b/oox/source/xls/workbooksettings.cxx @@ -37,7 +37,6 @@ #include "oox/helper/recordinputstream.hxx" #include "oox/xls/biffinputstream.hxx" #include "oox/xls/unitconverter.hxx" -#include "properties.hxx" namespace oox { namespace xls { diff --git a/oox/source/xls/worksheetbuffer.cxx b/oox/source/xls/worksheetbuffer.cxx index fbfaef8daed5..12903a4b3c27 100644 --- a/oox/source/xls/worksheetbuffer.cxx +++ b/oox/source/xls/worksheetbuffer.cxx @@ -40,7 +40,6 @@ #include "oox/helper/recordinputstream.hxx" #include "oox/xls/biffinputstream.hxx" #include "oox/xls/excelhandlers.hxx" -#include "properties.hxx" namespace oox { namespace xls { diff --git a/oox/source/xls/worksheetfragment.cxx b/oox/source/xls/worksheetfragment.cxx index dc51981fe230..1008a67af9b5 100644 --- a/oox/source/xls/worksheetfragment.cxx +++ b/oox/source/xls/worksheetfragment.cxx @@ -57,11 +57,8 @@ namespace xls { using namespace ::com::sun::star::table; using namespace ::com::sun::star::uno; +using namespace ::oox::core; -using ::oox::core::ContextHandlerRef; -using ::oox::core::RecordInfo; -using ::oox::core::Relations; -using ::oox::core::RelationsRef; using ::rtl::OUString; using ::rtl::OUStringBuffer; @@ -237,12 +234,12 @@ WorksheetFragment::WorksheetFragment( const WorkbookHelper& rHelper, WorksheetFragmentBase( rHelper, rFragmentPath, rxProgressBar, eSheetType, nSheet ) { // import data tables related to this worksheet - RelationsRef xTableRels = getRelations().getRelationsFromType( CREATE_OFFICEDOC_RELATIONSTYPE( "table" ) ); + RelationsRef xTableRels = getRelations().getRelationsFromType( CREATE_OFFICEDOC_RELATION_TYPE( "table" ) ); for( Relations::const_iterator aIt = xTableRels->begin(), aEnd = xTableRels->end(); aIt != aEnd; ++aIt ) importOoxFragment( new TableFragment( *this, getFragmentPathFromRelation( aIt->second ) ) ); // import comments related to this worksheet - OUString aCommentsFragmentPath = getFragmentPathFromFirstType( CREATE_OFFICEDOC_RELATIONSTYPE( "comments" ) ); + OUString aCommentsFragmentPath = getFragmentPathFromFirstType( CREATE_OFFICEDOC_RELATION_TYPE( "comments" ) ); if( aCommentsFragmentPath.getLength() > 0 ) importOoxFragment( new CommentsFragment( *this, aCommentsFragmentPath ) ); } @@ -492,12 +489,12 @@ void WorksheetFragment::initializeImport() initializeWorksheetImport(); // import query table fragments related to this worksheet - RelationsRef xQueryRels = getRelations().getRelationsFromType( CREATE_OFFICEDOC_RELATIONSTYPE( "queryTable" ) ); + RelationsRef xQueryRels = getRelations().getRelationsFromType( CREATE_OFFICEDOC_RELATION_TYPE( "queryTable" ) ); for( Relations::const_iterator aIt = xQueryRels->begin(), aEnd = xQueryRels->end(); aIt != aEnd; ++aIt ) importOoxFragment( new QueryTableFragment( *this, getFragmentPathFromRelation( aIt->second ) ) ); // import pivot table fragments related to this worksheet - RelationsRef xPivotRels = getRelations().getRelationsFromType( CREATE_OFFICEDOC_RELATIONSTYPE( "pivotTable" ) ); + RelationsRef xPivotRels = getRelations().getRelationsFromType( CREATE_OFFICEDOC_RELATION_TYPE( "pivotTable" ) ); for( Relations::const_iterator aIt = xPivotRels->begin(), aEnd = xPivotRels->end(); aIt != aEnd; ++aIt ) importOoxFragment( new PivotTableFragment( *this, getFragmentPathFromRelation( aIt->second ) ) ); } diff --git a/oox/source/xls/worksheethelper.cxx b/oox/source/xls/worksheethelper.cxx index de3b540df0a8..b4f8a4459234 100644 --- a/oox/source/xls/worksheethelper.cxx +++ b/oox/source/xls/worksheethelper.cxx @@ -74,8 +74,6 @@ #include "oox/xls/workbooksettings.hxx" #include "oox/xls/worksheetbuffer.hxx" #include "oox/xls/worksheetsettings.hxx" -#include "properties.hxx" -#include "tokens.hxx" namespace oox { namespace xls { diff --git a/oox/source/xls/worksheetsettings.cxx b/oox/source/xls/worksheetsettings.cxx index 7a4dc07d7b5e..b81f7fb6b841 100644 --- a/oox/source/xls/worksheetsettings.cxx +++ b/oox/source/xls/worksheetsettings.cxx @@ -34,7 +34,6 @@ #include "oox/xls/biffinputstream.hxx" #include "oox/xls/pagesettings.hxx" #include "oox/xls/workbooksettings.hxx" -#include "properties.hxx" namespace oox { namespace xls { diff --git a/writerfilter/source/ooxml/model.xml b/writerfilter/source/ooxml/model.xml index b7046a495bd8..b00fd433c884 100644 --- a/writerfilter/source/ooxml/model.xml +++ b/writerfilter/source/ooxml/model.xml @@ -1,18 +1,18 @@ - - - - - - - - - - - - - + + + + + + + + + + + + + diff --git a/writerfilter/source/ooxml/namespaceids.xsl b/writerfilter/source/ooxml/namespaceids.xsl index 45828761da0c..4a1f3b2ba381 100644 --- a/writerfilter/source/ooxml/namespaceids.xsl +++ b/writerfilter/source/ooxml/namespaceids.xsl @@ -67,7 +67,7 @@ const sal_uInt32 = - << 16; +; diff --git a/writerfilter/source/resourcemodel/namespace_preprocess.pl b/writerfilter/source/resourcemodel/namespace_preprocess.pl index 22c172329f61..66644b70fd47 100644 --- a/writerfilter/source/resourcemodel/namespace_preprocess.pl +++ b/writerfilter/source/resourcemodel/namespace_preprocess.pl @@ -30,31 +30,16 @@ EOF # print the mapping open ( NAMESPACES, $ARGV0 ) || die "can't open namespace file: $!"; -$group = 0; -$i = 1; while ( ) { chomp( $_ ); - $_ =~ s/\s*//g; - if ( $_ =~ m/^$/ ) - { - # Start a new group - $i = 0; - $group++; - } - elsif ( $_ =~ m/^[^#]/ ) - { - # Neither an empty line nor a comment - $_ =~ /^[a-zA-Z0-9-_]+$/ or die "Invalid namespace token $_"; - $_ =~ s/-/_/g; - $no = $group*10 + $i; - print < - $no + # line format is: numeric-id short-name namespace-URL + $_ =~ /^([0-9]+)\s+([a-zA-Z]+)\s+([a-zA-Z0-9-.:\/]+)\s*$/ or die "Error: invalid character in input data"; + print < + $1 EOF - ++$i; - } } print < Date: Thu, 18 Nov 2010 19:47:19 +0100 Subject: chartextensibility: #i113619# Pasting a chart into a spreadsheet is not notified --- oox/inc/oox/drawingml/chart/chartspacemodel.hxx | 1 + oox/source/drawingml/chart/chartspaceconverter.cxx | 13 +++++++++++++ oox/source/drawingml/chart/chartspacefragment.cxx | 3 +++ oox/source/drawingml/chart/chartspacemodel.cxx | 3 ++- 4 files changed, 19 insertions(+), 1 deletion(-) (limited to 'oox/source/drawingml/chart/chartspacefragment.cxx') diff --git a/oox/inc/oox/drawingml/chart/chartspacemodel.hxx b/oox/inc/oox/drawingml/chart/chartspacemodel.hxx index ddfa57fb919c..b59075bb7268 100644 --- a/oox/inc/oox/drawingml/chart/chartspacemodel.hxx +++ b/oox/inc/oox/drawingml/chart/chartspacemodel.hxx @@ -63,6 +63,7 @@ struct ChartSpaceModel bool mbAutoTitleDel; /// True = automatic title deleted manually. bool mbPlotVisOnly; /// True = plot visible cells in a sheet only. bool mbShowLabelsOverMax;/// True = show labels over chart maximum. + bool mbPivotChart; /// True = pivot chart. explicit ChartSpaceModel(); ~ChartSpaceModel(); diff --git a/oox/source/drawingml/chart/chartspaceconverter.cxx b/oox/source/drawingml/chart/chartspaceconverter.cxx index 54212f1bdbda..414ad31cc65f 100644 --- a/oox/source/drawingml/chart/chartspaceconverter.cxx +++ b/oox/source/drawingml/chart/chartspaceconverter.cxx @@ -46,12 +46,14 @@ using ::com::sun::star::uno::Reference; using ::com::sun::star::uno::Exception; using ::com::sun::star::uno::UNO_QUERY; using ::com::sun::star::uno::UNO_QUERY_THROW; +using ::com::sun::star::uno::makeAny; using ::com::sun::star::util::XNumberFormatsSupplier; using ::com::sun::star::drawing::XDrawPageSupplier; using ::com::sun::star::drawing::XShapes; using ::com::sun::star::chart2::XDiagram; using ::com::sun::star::chart2::XTitled; using ::com::sun::star::chart2::data::XDataReceiver; +using ::com::sun::star::beans::XPropertySet; namespace oox { namespace drawingml { @@ -199,6 +201,17 @@ void ChartSpaceConverter::convertFromModel( const Reference< XShapes >& rxExtern catch( Exception& ) { } + + // pivot chart + if ( mrModel.mbPivotChart ) try + { + Reference< XPropertySet > xProps( getChartDocument(), UNO_QUERY_THROW ); + xProps->setPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "DisableDataTableDialog" ) ), makeAny( sal_True ) ); + xProps->setPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "DisableComplexChartTypes" ) ), makeAny( sal_True ) ); + } + catch ( Exception& ) + { + } } // ============================================================================ diff --git a/oox/source/drawingml/chart/chartspacefragment.cxx b/oox/source/drawingml/chart/chartspacefragment.cxx index 75df94e95de7..22dd88115192 100644 --- a/oox/source/drawingml/chart/chartspacefragment.cxx +++ b/oox/source/drawingml/chart/chartspacefragment.cxx @@ -78,6 +78,9 @@ ContextHandlerRef ChartSpaceFragment::onCreateContext( sal_Int32 nElement, const case C_TOKEN( userShapes ): mrModel.maDrawingPath = getFragmentPathFromRelId( rAttribs.getString( R_TOKEN( id ), OUString() ) ); return 0; + case C_TOKEN( pivotSource ): + mrModel.mbPivotChart = true; + return 0; } break; diff --git a/oox/source/drawingml/chart/chartspacemodel.cxx b/oox/source/drawingml/chart/chartspacemodel.cxx index e386334160a8..17564423f3cf 100644 --- a/oox/source/drawingml/chart/chartspacemodel.cxx +++ b/oox/source/drawingml/chart/chartspacemodel.cxx @@ -38,7 +38,8 @@ ChartSpaceModel::ChartSpaceModel() : mnStyle( 2 ), mbAutoTitleDel( false ), mbPlotVisOnly( false ), - mbShowLabelsOverMax( false ) + mbShowLabelsOverMax( false ), + mbPivotChart( false ) { } -- cgit v1.2.3