diff options
author | Muthu Subramanian <sumuthu@suse.com> | 2012-01-24 13:03:11 +0530 |
---|---|---|
committer | Muthu Subramanian <sumuthu@suse.com> | 2012-01-24 13:03:11 +0530 |
commit | 5fb4b78559a44133673a49a028c691fa474aee75 (patch) | |
tree | 15953d291d66842838cae070efe6e3cbbc78d14d /oox | |
parent | a21c7f835bd7034614fa8ac606fd60a0cbeef1ec (diff) |
n719734: Overridding properties from master/layout.
When there are conflicting properties in masterslide->layout->slide
most recent (i.e. e.g. slide has higher priority than layout)
should be used.
Diffstat (limited to 'oox')
-rw-r--r-- | oox/inc/oox/helper/propertymap.hxx | 3 | ||||
-rw-r--r-- | oox/source/drawingml/textparagraphproperties.cxx | 2 | ||||
-rw-r--r-- | oox/source/helper/propertymap.cxx | 6 |
3 files changed, 10 insertions, 1 deletions
diff --git a/oox/inc/oox/helper/propertymap.hxx b/oox/inc/oox/helper/propertymap.hxx index bf1e5d59f089..37b723e75df8 100644 --- a/oox/inc/oox/helper/propertymap.hxx +++ b/oox/inc/oox/helper/propertymap.hxx @@ -86,6 +86,9 @@ public: inline void assignUsed( const PropertyMap& rPropMap ) { insert( rPropMap.begin(), rPropMap.end() ); } + /** Inserts all properties contained in the passed property map */ + void assignAll( const PropertyMap& rPropMap ); + /** Returns a sequence of property values, filled with all contained properties. */ ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > makePropertyValueSequence() const; diff --git a/oox/source/drawingml/textparagraphproperties.cxx b/oox/source/drawingml/textparagraphproperties.cxx index eeb8409b8e43..ff6e972dfa1f 100644 --- a/oox/source/drawingml/textparagraphproperties.cxx +++ b/oox/source/drawingml/textparagraphproperties.cxx @@ -376,7 +376,7 @@ TextParagraphProperties::~TextParagraphProperties() void TextParagraphProperties::apply( const TextParagraphProperties& rSourceProps ) { - maTextParagraphPropertyMap.insert( rSourceProps.maTextParagraphPropertyMap.begin(), rSourceProps.maTextParagraphPropertyMap.end() ); + maTextParagraphPropertyMap.assignAll( rSourceProps.maTextParagraphPropertyMap ); maBulletList.apply( rSourceProps.maBulletList ); maTextCharacterProperties.assignUsed( rSourceProps.maTextCharacterProperties ); if ( rSourceProps.maParaTopMargin.bHasValue ) diff --git a/oox/source/helper/propertymap.cxx b/oox/source/helper/propertymap.cxx index 2858baffff51..0bf875c9c655 100644 --- a/oox/source/helper/propertymap.cxx +++ b/oox/source/helper/propertymap.cxx @@ -234,6 +234,12 @@ const Any* PropertyMap::getProperty( sal_Int32 nPropId ) const return (aIt == end()) ? 0 : &aIt->second; } +void PropertyMap::assignAll( const PropertyMap& rPropMap ) +{ + for( PropertyMap::const_iterator it=rPropMap.begin(); it != rPropMap.end(); it++ ) + (*this)[it->first] = it->second; +} + Sequence< PropertyValue > PropertyMap::makePropertyValueSequence() const { Sequence< PropertyValue > aSeq( static_cast< sal_Int32 >( size() ) ); |