diff options
author | Daniel Rentz [dr] <daniel.rentz@oracle.com> | 2010-11-08 13:47:01 +0100 |
---|---|---|
committer | Daniel Rentz [dr] <daniel.rentz@oracle.com> | 2010-11-08 13:47:01 +0100 |
commit | 6cafb68322fa85a54a6fa1ca47239af459f519ce (patch) | |
tree | 41d02f348e9dd2c6791347563d7f5b9205a3b458 /oox/source/helper | |
parent | 0b66e33ee50cd1c77bd9b1073ab298bac03bcfb7 (diff) |
dr77: optimizations in generation of XML tokens, XML namespaces, property names; code cleanup
Diffstat (limited to 'oox/source/helper')
-rw-r--r-- | oox/source/helper/graphichelper.cxx | 2 | ||||
-rw-r--r-- | oox/source/helper/propertymap.cxx | 18 |
2 files changed, 7 insertions, 13 deletions
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 <com/sun/star/graphic/XGraphicProvider.hpp> #include <com/sun/star/util/MeasureUnit.hpp> #include <comphelper/seqstream.hxx> -#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 <com/sun/star/beans/XPropertySetInfo.hpp> #include <cppuhelper/implbase2.hxx> #include <osl/mutex.hxx> -#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 |