From a99b8aaa33fd9b5e07d5ed264bebc5fda464596d Mon Sep 17 00:00:00 2001 From: Joseph Powers Date: Sat, 1 Jan 2011 10:56:18 -0800 Subject: [PATCH] Remove DECLARE_LIST( TargetList, String* ) --- sw/source/ui/chrdlg/chardlg.cxx | 12 ++++++------ sw/source/ui/frmdlg/frmpage.cxx | 13 ++++++------- sw/source/ui/shells/basesh.cxx | 8 ++------ 3 files changed, 14 insertions(+), 19 deletions(-) diff --git a/sw/source/ui/chrdlg/chardlg.cxx b/sw/source/ui/chrdlg/chardlg.cxx index 26f69fd1a724..9b75820e623d 100644 --- a/sw/source/ui/chrdlg/chardlg.cxx +++ b/sw/source/ui/chrdlg/chardlg.cxx @@ -209,18 +209,18 @@ SwCharURLPage::SwCharURLPage( Window* pParent, TargetList* pList = new TargetList; const SfxFrame& rFrame = pView->GetViewFrame()->GetTopFrame(); rFrame.GetTargetList(*pList); - USHORT nCount = (USHORT)pList->Count(); - if( nCount ) + if ( !pList->empty() ) { - USHORT i; + size_t nCount = pList->size(); + size_t i; for ( i = 0; i < nCount; i++ ) { - aTargetFrmLB.InsertEntry(*pList->GetObject(i)); + aTargetFrmLB.InsertEntry( *pList->at( i ) ); } - for ( i = nCount; i; i-- ) + for ( i = nCount; i; ) { - delete pList->GetObject( i - 1 ); + delete pList->at( --i ); } } delete pList; diff --git a/sw/source/ui/frmdlg/frmpage.cxx b/sw/source/ui/frmdlg/frmpage.cxx index e86660a79479..245c75cca4e4 100644 --- a/sw/source/ui/frmdlg/frmpage.cxx +++ b/sw/source/ui/frmdlg/frmpage.cxx @@ -2554,17 +2554,16 @@ void SwFrmURLPage::Reset( const SfxItemSet &rSet ) { TargetList* pList = new TargetList; ((const SfxFrameItem*)pItem)->GetFrame()->GetTargetList(*pList); - USHORT nCount = (USHORT)pList->Count(); - if( nCount ) + if( !pList->empty() ) { - USHORT i; - for ( i = 0; i < nCount; i++ ) + size_t nCount = pList->size(); + for ( size_t i = 0; i < nCount; i++ ) { - aFrameCB.InsertEntry(*pList->GetObject(i)); + aFrameCB.InsertEntry( *pList->at( i ) ); } - for ( i = nCount; i; i-- ) + for ( size_t i = nCount; i; ) { - delete pList->GetObject( i - 1 ); + delete pList->at( --i ); } } delete pList; diff --git a/sw/source/ui/shells/basesh.cxx b/sw/source/ui/shells/basesh.cxx index e7a4c4847ecc..d686fcd45501 100644 --- a/sw/source/ui/shells/basesh.cxx +++ b/sw/source/ui/shells/basesh.cxx @@ -181,12 +181,8 @@ void lcl_UpdateIMapDlg( SwWrtShell& rSh ) SvxIMapDlgChildWindow::UpdateIMapDlg( aGrf, rURL.GetMap(), pList, pEditObj ); - USHORT nCount = (USHORT)pList->Count(); - if(nCount) - for( USHORT i = nCount; i; i-- ) - { - delete pList->GetObject(i-1); - } + for ( size_t i = 0, n = pList->size(); i < n; ++i ) + delete pList->at( i ); delete pList; }