Re: [Libreoffice] [PATCH] Replace List with std::vectorSfxStyleSheetBase* in SD

2011-06-16 Thread Rafael Dominguez
Ooops forgot to attach patch

On Wed, Jun 15, 2011 at 7:35 PM, Rafael Dominguez venccsra...@gmail.comwrote:



From 1b72022c8169b41786c71ee52776da60418341c5 Mon Sep 17 00:00:00 2001
From: Rafael Dominguez venccsra...@gmail.com
Date: Sun, 12 Jun 2011 18:37:27 -0430
Subject: [PATCH 3/9] Replace List with std::vectorSfxStyleSheetBase*.

---
 sd/source/core/stlpool.cxx |   24 +---
 1 files changed, 5 insertions(+), 19 deletions(-)

diff --git a/sd/source/core/stlpool.cxx b/sd/source/core/stlpool.cxx
index d1bee44..407c1bf 100644
--- a/sd/source/core/stlpool.cxx
+++ b/sd/source/core/stlpool.cxx
@@ -870,7 +870,7 @@ void SdStyleSheetPool::UpdateStdNames()
 {
 String aHelpFile;
 sal_uInt32  nCount = aStyles.size();
-List* pEraseList = NULL;
+std::vectorSfxStyleSheetBase* aEraseList;
 
 for( sal_uInt32 n=0; n  nCount; n++ )
 {
@@ -953,30 +953,16 @@ void SdStyleSheetPool::UpdateStdNames()
 else
 {
 // Sheet existiert schon: Altes Sheet muss entfernt werden
-if( !pEraseList )
-{
-pEraseList = new List();
-}
-
-pEraseList-Insert( pStyle );
+aEraseList.push_back( pStyle );
 }
 }
 }
 }
 }
 
-if ( pEraseList )
-{
-// Styles, welche nicht umbenannt werden konnten, muessen entfernt werden
-for ( sal_uLong i = 0; i  pEraseList-Count(); i++ )
-{
-SfxStyleSheetBase* pEraseSheet = ( SfxStyleSheetBase* ) pEraseList-GetObject( i );
-Remove( pEraseSheet );
-}
-
-delete pEraseList;
-pEraseList = NULL;
-}
+// Styles, welche nicht umbenannt werden konnten, muessen entfernt werden
+for ( size_t i = 0, n = aEraseList.size(); i  n; ++i )
+Remove( aEraseList[ i ] );
 }
 // 
 // Neues SvxNumBulletItem fuer das jeweilige StyleSheet setzen
-- 
1.7.3.4

___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


[Libreoffice] [PATCH] Replace List with std::vectorSfxStyleSheetBase* in SD

2011-06-15 Thread Rafael Dominguez

___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice