diff options
author | Markus Mohrhard <markus.mohrhard@collabora.co.uk> | 2014-03-04 09:34:37 +0100 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2014-03-04 18:43:38 +0100 |
commit | f566585f0882e65778c424640b9312cb19b007b9 (patch) | |
tree | 4d04704fd40ab4178de529d8ab7795ce227f5b8a /include | |
parent | f1659922a6e152f6a38ab13d7cb308b5728db16c (diff) |
remove the inheritance to std::map in PropertyMap
Change-Id: Iaaf5b7ab47ffa151cd7c8ea376763d02c883f377
Diffstat (limited to 'include')
-rw-r--r-- | include/oox/drawingml/shapepropertymap.hxx | 1 | ||||
-rw-r--r-- | include/oox/helper/propertymap.hxx | 34 |
2 files changed, 25 insertions, 10 deletions
diff --git a/include/oox/drawingml/shapepropertymap.hxx b/include/oox/drawingml/shapepropertymap.hxx index 16daf319356a..c2c6896b9f61 100644 --- a/include/oox/drawingml/shapepropertymap.hxx +++ b/include/oox/drawingml/shapepropertymap.hxx @@ -115,7 +115,6 @@ public: using PropertyMap::setAnyProperty; using PropertyMap::setProperty; - using PropertyMap::operator[]; private: /** Sets an explicit line marker, or creates a named line marker. */ diff --git a/include/oox/helper/propertymap.hxx b/include/oox/helper/propertymap.hxx index 8c8f212ae967..4b4f416809ab 100644 --- a/include/oox/helper/propertymap.hxx +++ b/include/oox/helper/propertymap.hxx @@ -39,7 +39,8 @@ struct PropertyNameVector; -typedef ::std::map< sal_Int32, ::com::sun::star::uno::Any > PropertyMapBase; +typedef ::std::map< sal_Int32, ::com::sun::star::uno::Any > PropertyMapType; +typedef ::std::map< OUString, ::com::sun::star::uno::Any > PropertyNameMap; /** A helper that maps property identifiers to property values. @@ -48,7 +49,7 @@ typedef ::std::map< sal_Int32, ::com::sun::star::uno::Any > PropertyMapBase; name mapping is done internally while the properties are written to property sets. */ -class OOX_DLLPUBLIC PropertyMap : public PropertyMapBase +class OOX_DLLPUBLIC PropertyMap { public: PropertyMap(); @@ -57,23 +58,33 @@ public: static const OUString& getPropertyName( sal_Int32 nPropId ); /** Returns true, if the map contains a property with the passed identifier. */ - bool hasProperty( sal_Int32 nPropId ) const - { return find( nPropId ) != end(); } + bool hasProperty( sal_Int32 nPropId ) const; /** Sets the specified property to the passed value. Does nothing, if the identifier is invalid. */ - bool setAnyProperty( sal_Int32 nPropId, const ::com::sun::star::uno::Any& rValue ) - { if( nPropId < 0 ) return false; (*this)[ nPropId ] = rValue; return true; } + bool setAnyProperty( sal_Int32 nPropId, const ::com::sun::star::uno::Any& rValue ); /** Sets the specified property to the passed value. Does nothing, if the identifier is invalid. */ template< typename Type > bool setProperty( sal_Int32 nPropId, const Type& rValue ) - { if( nPropId < 0 ) return false; (*this)[ nPropId ] <<= rValue; return true; } + { + if( nPropId < 0 ) + return false; + + maProperties[ nPropId ] <<= rValue; + return true; + } + + com::sun::star::uno::Any getProperty( sal_Int32 nPropId ); + + void erase( sal_Int32 nPropId ); + + bool empty() const; + size_t size() const; /** Inserts all properties contained in the passed property map. */ - void assignUsed( const PropertyMap& rPropMap ) - { insert( rPropMap.begin(), rPropMap.end() ); } + void assignUsed( const PropertyMap& rPropMap ); /** Inserts all properties contained in the passed property map */ void assignAll( const PropertyMap& rPropMap ); @@ -87,6 +98,8 @@ public: ::com::sun::star::uno::Sequence< OUString >& rNames, ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& rValues ) const; + void fillPropertyNameMap(PropertyNameMap& rMap) const; + /** Creates a property set supporting the XPropertySet interface and inserts all properties. */ ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > makePropertySet() const; @@ -100,6 +113,9 @@ public: #endif private: const PropertyNameVector* mpPropNames; + +protected: + PropertyMapType maProperties; }; |