From 3956169f4e4db08346b6cf3a2fd4a8cb81f9d356 Mon Sep 17 00:00:00 2001 From: Markus Mohrhard Date: Tue, 26 Jul 2011 02:47:04 +0200 Subject: change maPasswordList to ptr_vector --- sd/source/ui/dlg/dlgass.cxx | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/sd/source/ui/dlg/dlgass.cxx b/sd/source/ui/dlg/dlgass.cxx index 5ee4d8e40..38f4b2b0f 100644 --- a/sd/source/ui/dlg/dlgass.cxx +++ b/sd/source/ui/dlg/dlgass.cxx @@ -82,6 +82,7 @@ #include #include +#include using namespace ::com::sun::star; using namespace ::com::sun::star::uno; @@ -208,7 +209,7 @@ public: String GetPassword( const String rPath ); void DeletePassords(); - vector< PasswordEntry* > maPasswordList; + boost::ptr_vector< PasswordEntry > maPasswordList; String maDocFile; String maLayoutFile; @@ -1679,9 +1680,9 @@ void AssistentDlgImpl::SavePassword( SfxObjectShellLock xDoc, const String& rPat PasswordEntry* pEntry = NULL; for ( size_t i = 0, n = maPasswordList.size(); i < n; ++i ) { - if ( maPasswordList[ i ]->maPath == rPath ) + if ( maPasswordList[ i ].maPath == rPath ) { - pEntry = maPasswordList[ i ]; + pEntry = &maPasswordList[ i ]; break; } } @@ -1712,7 +1713,7 @@ String AssistentDlgImpl::GetPassword( const String rPath ) { for ( size_t i = 0, n = maPasswordList.size(); i < n; ++i ) { - PasswordEntry* pEntry = maPasswordList[ i ]; + PasswordEntry* pEntry = &maPasswordList[ i ]; if(pEntry->maPath == rPath) return pEntry->maPassword; } @@ -1721,8 +1722,6 @@ String AssistentDlgImpl::GetPassword( const String rPath ) void AssistentDlgImpl::DeletePassords() { - for ( size_t i = 0, n = maPasswordList.size(); i < n; ++i ) - delete maPasswordList[ i ]; maPasswordList.clear(); } -- cgit v1.2.3