Date: prev next · Thread: first prev next last
2011 Archives by date, by thread · List index


Ooops forgot to attach patch

On Wed, Jun 15, 2011 at 7:35 PM, Rafael Dominguez <venccsralph@gmail.com>wrote:



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

---
 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::vector<SfxStyleSheetBase*> 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


Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.