diff options
author | Joseph Powers <jpowers27@cox.net> | 2011-01-01 10:53:48 -0800 |
---|---|---|
committer | Joseph Powers <jpowers27@cox.net> | 2011-01-01 10:53:48 -0800 |
commit | 20c9277f3ad930d31c720e7a1ac0e623eaa55beb (patch) | |
tree | 66a9c832978bc658e14ee3065d5168cd1e933471 /svx | |
parent | a407bbfe8c35a4791b688e375430e1eb2b54e17c (diff) |
Remove DECLARE_LIST( TargetList, String* )
Diffstat (limited to 'svx')
-rw-r--r-- | svx/inc/imapdlg.hxx | 3 | ||||
-rw-r--r-- | svx/inc/svx/svxdlg.hxx | 4 | ||||
-rw-r--r-- | svx/source/dialog/hyprlink.cxx | 14 | ||||
-rw-r--r-- | svx/source/dialog/imapdlg.cxx | 21 | ||||
-rw-r--r-- | svx/source/dialog/imapwnd.cxx | 17 |
5 files changed, 29 insertions, 30 deletions
diff --git a/svx/inc/imapdlg.hxx b/svx/inc/imapdlg.hxx index e456335adfde..7975de4917db 100644 --- a/svx/inc/imapdlg.hxx +++ b/svx/inc/imapdlg.hxx @@ -45,6 +45,7 @@ #include <vcl/status.hxx> #include "svx/svxdllapi.h" +#include <vector> #ifndef _GOMISC_HXX @@ -59,7 +60,7 @@ class ImageMap; \************************************************************************/ class Graphic; -class TargetList; +typedef ::std::vector< String* > TargetList; class SVX_DLLPUBLIC SvxIMapDlgChildWindow : public SfxChildWindow { diff --git a/svx/inc/svx/svxdlg.hxx b/svx/inc/svx/svxdlg.hxx index ab2c8b93978d..5d9d5077b47d 100644 --- a/svx/inc/svx/svxdlg.hxx +++ b/svx/inc/svx/svxdlg.hxx @@ -40,6 +40,7 @@ class SdrView; #include <com/sun/star/container/XIndexContainer.hpp> //add for FmShowColsDialog #include <com/sun/star/container/XNameReplace.hpp> //add for SvxMacroAssignDlg #include "svx/svxdllapi.h" +#include <vector> namespace com{namespace sun{namespace star{ namespace linguistic2{ @@ -56,7 +57,6 @@ typedef USHORT* (*DialogGetRanges)(); struct ExchangeData; class INetURLObject; class GalleryTheme; -class TargetList; class SvxHyperlinkTabPageBase; class SearchAttrItemList; class FmFormShell; @@ -64,6 +64,8 @@ class Graphic; class SdrObject; class SvxSpellWrapper; +typedef ::std::vector< String* > TargetList; + namespace svx{ class SpellDialogChildWindow;} #define EMPTY_FRAME_REF com::sun::star::uno::Reference < com::sun::star::frame::XFrame >() diff --git a/svx/source/dialog/hyprlink.cxx b/svx/source/dialog/hyprlink.cxx index 6b6f562e41c5..ba082a8c7426 100644 --- a/svx/source/dialog/hyprlink.cxx +++ b/svx/source/dialog/hyprlink.cxx @@ -460,9 +460,9 @@ void SvxHyperlinkDlg::TargetMenu(const String& rSelEntry, BOOL bExecute) TargetList aList; pVwFrm->GetTopFrame().GetTargetList(aList); - USHORT nCount = (USHORT)aList.Count(); - if( nCount ) + if ( !aList.empty() ) { + size_t nCount = aList.size(); BOOL bChecked = FALSE; if (pTargetMenu != NULL) @@ -471,10 +471,10 @@ void SvxHyperlinkDlg::TargetMenu(const String& rSelEntry, BOOL bExecute) pTargetMenu = new PopupMenu; pTargetMenu->SetMenuFlags( pTargetMenu->GetMenuFlags() | MENU_FLAG_NOAUTOMNEMONICS ); - USHORT i; - for ( i = 0; i < nCount; i++ ) + + for ( size_t i = 0; i < nCount; i++ ) { - String sEntry(*aList.GetObject(i)); + String sEntry( *aList[ i ] ); pTargetMenu->InsertItem(i + 1, sEntry, MIB_RADIOCHECK|MIB_AUTOCHECK); if (sEntry == rSelEntry) @@ -483,8 +483,8 @@ void SvxHyperlinkDlg::TargetMenu(const String& rSelEntry, BOOL bExecute) bChecked = TRUE; } } - for ( i = nCount; i; i-- ) - delete aList.GetObject( i - 1 ); + for ( size_t i = nCount; i; ) + delete aList[ --i ]; if (!bChecked) pTargetMenu->CheckItem(1); diff --git a/svx/source/dialog/imapdlg.cxx b/svx/source/dialog/imapdlg.cxx index 5f577bb32aa1..a8f9736bede3 100644 --- a/svx/source/dialog/imapdlg.cxx +++ b/svx/source/dialog/imapdlg.cxx @@ -403,8 +403,8 @@ void SvxIMapDlg::SetTargetList( const TargetList& rTargetList ) maCbbTarget.Clear(); - for( String* pStr = aNewList.First(); pStr; pStr = aNewList.Next() ) - maCbbTarget.InsertEntry( *pStr ); + for ( size_t i = 0, n = aNewList.size(); i < n; ++i ) + maCbbTarget.InsertEntry( *aNewList[ i ] ); } @@ -441,9 +441,9 @@ void SvxIMapDlg::Update( const Graphic& rGraphic, const ImageMap* pImageMap, // UpdateTargetList loeschen, da diese Methode // vor dem Zuschlagen des Update-Timers noch // mehrmals gerufen werden kann( #46540 ) - for( String* pStr = pOwnData->aUpdateTargetList.First(); pStr; pStr = pOwnData->aUpdateTargetList.Next() ) - delete pStr; - pOwnData->aUpdateTargetList.Clear(); + for ( size_t i = 0, n = pOwnData->aUpdateTargetList.size(); i < n; ++i ) + delete pOwnData->aUpdateTargetList[ i ]; + pOwnData->aUpdateTargetList.clear(); // TargetListe muss kopiert werden, da sie im // Besitz des Aufrufers ist und von ihm nach diesem @@ -453,8 +453,8 @@ void SvxIMapDlg::Update( const Graphic& rGraphic, const ImageMap* pImageMap, { TargetList aTargetList( *pTargetList ); - for( String* pStr = aTargetList.First(); pStr; pStr = aTargetList.Next() ) - pOwnData->aUpdateTargetList.Insert( new String( *pStr ) ); + for ( size_t i = 0, n = aTargetList.size(); i < n; ++i ) + pOwnData->aUpdateTargetList.push_back( new String( *aTargetList[ i ] ) ); } pOwnData->aTimer.Start(); @@ -948,10 +948,9 @@ IMPL_LINK( SvxIMapDlg, UpdateHdl, Timer*, EMPTYARG ) } // die in der Update-Methode kopierte Liste wieder loeschen - for( String* pStr = pOwnData->aUpdateTargetList.First(); pStr; pStr = pOwnData->aUpdateTargetList.Next() ) - delete pStr; - - pOwnData->aUpdateTargetList.Clear(); + for ( size_t i = 0, n = pOwnData->aUpdateTargetList.size(); i < n; ++i ) + delete pOwnData->aUpdateTargetList[ i ]; + pOwnData->aUpdateTargetList.clear(); GetBindings().Invalidate( SID_IMAP_EXEC ); diff --git a/svx/source/dialog/imapwnd.cxx b/svx/source/dialog/imapwnd.cxx index 792a49493788..83d077f25d1e 100644 --- a/svx/source/dialog/imapwnd.cxx +++ b/svx/source/dialog/imapwnd.cxx @@ -96,8 +96,8 @@ IMapWindow::IMapWindow( Window* pParent, const ResId& rResId, const Reference< X IMapWindow::~IMapWindow() { // Liste loeschen - for( String* pStr = aTargetList.First(); pStr; pStr = aTargetList.Next() ) - delete pStr; + for ( size_t i = 0, n = aTargetList.size(); i < n; ++i ) + delete aTargetList[ i ]; SfxItemPool::Free(pIMapPool); delete[] pItemInfo; @@ -219,17 +219,14 @@ const ImageMap& IMapWindow::GetImageMap() void IMapWindow::SetTargetList( TargetList& rTargetList ) { - String* pStr; - // alte Liste loeschen - for( pStr = aTargetList.First(); pStr; pStr = aTargetList.Next() ) - delete pStr; - - aTargetList.Clear(); + for( size_t i = 0, n = aTargetList.size(); i < n; ++i ) + delete aTargetList[ i ]; + aTargetList.clear(); // mit uebergebener Liste fuellen - for( pStr = rTargetList.First(); pStr; pStr = rTargetList.Next() ) - aTargetList.Insert( new String( *pStr ) ); + for( size_t i = 0, n = rTargetList.size(); i < n; ++i ) + aTargetList.push_back( new String( *rTargetList[ i ] ) ); pModel->SetChanged( sal_False ); } |