[Libreoffice-commits] .: sd/source

Joseph Powers jpowers at kemper.freedesktop.org
Sat Dec 11 14:41:47 PST 2010


 sd/source/ui/dlg/dlgass.cxx |   36 +++++++++++++++---------------------
 1 file changed, 15 insertions(+), 21 deletions(-)

New commits:
commit 5a5c0eda6970ad9ea61ba834e4bf8b21a06fa479
Author: Joseph Powers <jpowers27 at cox.net>
Date:   Sat Dec 11 12:29:43 2010 -0800

    remove DECLARE_LIST( PasswordEntryList, PasswordEntry * )

diff --git a/sd/source/ui/dlg/dlgass.cxx b/sd/source/ui/dlg/dlgass.cxx
index 0ab9b87..db73831 100644
--- a/sd/source/ui/dlg/dlgass.cxx
+++ b/sd/source/ui/dlg/dlgass.cxx
@@ -81,11 +81,13 @@
 #include "WindowUpdater.hxx"
 
 #include <comphelper/processfactory.hxx>
+#include <vector>
 
 using namespace ::com::sun::star;
 using namespace ::com::sun::star::uno;
 using namespace ::sd;
 
+using ::std::vector;
 
 void InterpolateFixedBitmap( FixedBitmap * pBitmap )
 {
@@ -117,8 +119,6 @@ public:
     String maPath;
 };
 
-DECLARE_LIST( PasswordEntryList, PasswordEntry * )
-
 // ====================================================================
 
 /** A simple wrapper that looks like a PushButton and is used to force the
@@ -208,7 +208,7 @@ public:
     String GetPassword( const String rPath );
     void DeletePassords();
 
-    PasswordEntryList maPasswordList;
+    vector< PasswordEntry* > maPasswordList;
 
     String maDocFile;
     String maLayoutFile;
@@ -1674,21 +1674,21 @@ void AssistentDlgImpl::SavePassword( SfxObjectShellLock xDoc, const String& rPat
             if(aPass.Len() == 0)
                 return;
 
-            PasswordEntry* pEntry = maPasswordList.First();
-            while(pEntry)
+            PasswordEntry* pEntry = NULL;
+            for ( size_t i = 0, n = maPasswordList.size(); i < n; ++i )
             {
-                if(pEntry->maPath == rPath)
+                if ( maPasswordList[ i ]->maPath == rPath )
+                {
+                    pEntry = maPasswordList[ i ];
                     break;
-
-                pEntry = maPasswordList.Next();
-
+                }
             }
 
             if(pEntry == NULL)
             {
                 pEntry = new PasswordEntry();
                 pEntry->maPath = rPath;
-                maPasswordList.Insert( pEntry );
+                maPasswordList.push_back( pEntry );
             }
 
             if(pEntry)
@@ -1708,26 +1708,20 @@ void AssistentDlgImpl::RestorePassword( SfxItemSet* pSet, const String& rPath )
 
 String AssistentDlgImpl::GetPassword( const String rPath )
 {
-    PasswordEntry* pEntry = maPasswordList.First();
-    while(pEntry)
+    for ( size_t i = 0, n = maPasswordList.size(); i < n; ++i )
     {
+        PasswordEntry* pEntry = maPasswordList[ i ];
         if(pEntry->maPath == rPath)
             return pEntry->maPassword;
-
-        pEntry = maPasswordList.Next();
     }
-
     return String();
 }
 
 void AssistentDlgImpl::DeletePassords()
 {
-    PasswordEntry* pEntry = maPasswordList.First();
-    while(pEntry)
-    {
-        delete pEntry;
-        pEntry = maPasswordList.Next();
-    }
+    for ( size_t i = 0, n = maPasswordList.size(); i < n; ++i )
+        delete maPasswordList[ i ];
+    maPasswordList.clear();
 }
 
 BOOL AssistentDlgImpl::IsOwnFormat( const String& rPath )


More information about the Libreoffice-commits mailing list