[Libreoffice-commits] .: sd/source
Muthu Subramanian
sumuthu at kemper.freedesktop.org
Tue Aug 2 00:44:33 PDT 2011
sd/source/core/stlsheet.cxx | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
New commits:
commit cfa734790128aa0c346115b68c9f0ba183c1f6db
Author: Muthu Subramanian <sumuthu at novell.com>
Date: Tue Aug 2 13:35:53 2011 +0530
Styles import: Improve speed as well as fix/avoid n#708518
diff --git a/sd/source/core/stlsheet.cxx b/sd/source/core/stlsheet.cxx
index 2f0a03a..18b1db3 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) )
More information about the Libreoffice-commits
mailing list