diff options
author | Muthu Subramanian <sumuthu@novell.com> | 2011-08-02 13:35:53 +0530 |
---|---|---|
committer | Muthu Subramanian <sumuthu@novell.com> | 2011-08-02 13:37:13 +0530 |
commit | cfa734790128aa0c346115b68c9f0ba183c1f6db (patch) | |
tree | 1c9d59f090c5d572aa534f79dc9c6f2668d20bb9 | |
parent | d59a1554f85d0228082ea65c4b97e4deeda76971 (diff) |
Styles import: Improve speed as well as fix/avoid n#708518
-rw-r--r-- | sd/source/core/stlsheet.cxx | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/sd/source/core/stlsheet.cxx b/sd/source/core/stlsheet.cxx index 2f0a03ac9..18b1db390 100644 --- a/sd/source/core/stlsheet.cxx +++ b/sd/source/core/stlsheet.cxx @@ -1017,7 +1017,11 @@ void SAL_CALL SdStyleSheet::setParentStyle( const OUString& rParentName ) throw { const SfxStyles& rStyles = mxPool->GetStyles(); - for( SfxStyles::const_iterator iter( rStyles.begin() ); iter != rStyles.end(); ++iter ) + /* Use reverse iterator to find the parents quicker - most probably its inserted recently. + * Also avoids/fixes the issue n#708518 + * To fix it completely its probably wiser to compare this->GetName() and pStyle->GetName() or use complete names for styles (?) + */ + for( SfxStyles::const_reverse_iterator iter( rStyles.rbegin() ); iter != rStyles.rend(); ++iter ) { SdStyleSheet* pStyle = static_cast< SdStyleSheet* >( (*iter).get() ); if( pStyle && (pStyle->nFamily == nFamily) && (pStyle->msApiName == rParentName) ) |