summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorMuthu Subramanian <sumuthu@novell.com>2011-08-02 13:35:53 +0530
committerMuthu Subramanian <sumuthu@novell.com>2011-08-02 13:37:13 +0530
commit857e09fef456922995f6c271c47d8670f27d67e6 (patch)
tree1ccc9a864ca26b1769a73c0c7e194e65f7e689f2 /sd
parent8b8fee622c29e4d793670c2a6aad91c5dd9549a4 (diff)
Styles import: Improve speed as well as fix/avoid n#708518
Diffstat (limited to 'sd')
-rw-r--r--sd/source/core/stlsheet.cxx6
1 files changed, 5 insertions, 1 deletions
diff --git a/sd/source/core/stlsheet.cxx b/sd/source/core/stlsheet.cxx
index fc106cf4f51d..1d6fa463a3ca 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) )