[Libreoffice-commits] .: 2 commits - oox/inc oox/source

Muthu Subramanian sumuthu at kemper.freedesktop.org
Mon Jan 23 23:18:43 PST 2012


 oox/inc/oox/helper/propertymap.hxx               |    3 +++
 oox/source/drawingml/textparagraph.cxx           |    2 +-
 oox/source/drawingml/textparagraphproperties.cxx |    2 +-
 oox/source/helper/propertymap.cxx                |    6 ++++++
 4 files changed, 11 insertions(+), 2 deletions(-)

New commits:
commit 5fb4b78559a44133673a49a028c691fa474aee75
Author: Muthu Subramanian <sumuthu at suse.com>
Date:   Tue Jan 24 13:03:11 2012 +0530

    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.

diff --git a/oox/inc/oox/helper/propertymap.hxx b/oox/inc/oox/helper/propertymap.hxx
index bf1e5d5..37b723e 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 eeb8409..ff6e972 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 2858baf..0bf875c 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() ) );
commit a21c7f835bd7034614fa8ac606fd60a0cbeef1ec
Author: Muthu Subramanian <sumuthu at suse.com>
Date:   Tue Jan 24 13:02:03 2012 +0530

    Fix for a probable crash. (code review)

diff --git a/oox/source/drawingml/textparagraph.cxx b/oox/source/drawingml/textparagraph.cxx
index 964932f..689ab90 100644
--- a/oox/source/drawingml/textparagraph.cxx
+++ b/oox/source/drawingml/textparagraph.cxx
@@ -113,8 +113,8 @@ void TextParagraph::insertAt(
         {
             pTextParagraphStyle->pushToPropSet( &rFilterBase, xProps, aioBulletList, NULL, sal_False, fCharacterSize );
             fCharacterSize = pTextParagraphStyle->getCharHeightPoints( fCharacterSize );
+            maProperties.pushToPropSet( &rFilterBase, xProps, aioBulletList, &pTextParagraphStyle->getBulletList(), sal_True, fCharacterSize );
         }
-        maProperties.pushToPropSet( &rFilterBase, xProps, aioBulletList, &pTextParagraphStyle->getBulletList(), sal_True, fCharacterSize );
 
         // empty paragraphs do not have bullets in ppt
         if ( !nParagraphSize )


More information about the Libreoffice-commits mailing list