Replace List with vector< sal_uLong >

This commit is contained in:
Joseph Powers 2011-06-10 06:37:20 -07:00
parent 99efbe684b
commit aaeb106341
2 changed files with 23 additions and 15 deletions

View file

@ -279,10 +279,14 @@ void SearchProgress::StartExecuteModal( const Link& rEndDialogHdl )
// - TakeThread -
// --------------
TakeThread::TakeThread( TakeProgress* pProgess, TPGalleryThemeProperties* pBrowser, List& rTakenList ) :
mpProgress ( pProgess ),
mpBrowser ( pBrowser ),
mrTakenList ( rTakenList )
TakeThread::TakeThread(
TakeProgress* pProgess,
TPGalleryThemeProperties* pBrowser,
TokenList_impl& rTakenList
) :
mpProgress ( pProgess ),
mpBrowser ( pBrowser ),
mrTakenList ( rTakenList )
{
}
@ -298,9 +302,9 @@ void SAL_CALL TakeThread::run()
{
String aName;
INetURLObject aURL;
sal_uInt16 nEntries;
sal_uInt16 nEntries;
GalleryTheme* pThm = mpBrowser->GetXChgData()->pTheme;
sal_uInt16 nPos;
sal_uInt16 nPos;
GalleryProgress* pStatusProgress;
{
@ -319,7 +323,7 @@ void SAL_CALL TakeThread::run()
aURL = INetURLObject(*mpBrowser->aFoundList[ nPos = mpBrowser->aLbxFound.GetSelectEntryPos( i ) ]);
// Position in Taken-Liste uebernehmen
mrTakenList.Insert( (void*) (sal_uLong)nPos, LIST_APPEND );
mrTakenList.push_back( (sal_uLong)nPos );
{
SolarMutexGuard aGuard;
@ -392,10 +396,9 @@ IMPL_LINK( TakeProgress, CleanUpHdl, void*, EMPTYARG )
mpBrowser->aLbxFound.SetNoSelection();
// mark all taken positions in aRemoveEntries
for( i = 0UL, nCount = maTakenList.Count(); i < nCount; ++i )
aRemoveEntries[ (sal_uLong) maTakenList.GetObject( i ) ] = true;
maTakenList.Clear();
for( i = 0, nCount = maTakenList.size(); i < nCount; ++i )
aRemoveEntries[ maTakenList[ i ] ] = true;
maTakenList.clear();
// refill found list
for( i = 0, nCount = aRemoveEntries.size(); i < nCount; ++i )

View file

@ -59,7 +59,8 @@ class SearchProgress;
class TakeProgress;
class TPGalleryThemeProperties;
typedef ::std::vector< UniString* > StringList;
typedef ::std::vector< UniString* > StringList;
typedef ::std::vector< sal_uLong > TokenList_impl;
// ---------------
// - FilterEntry -
@ -137,14 +138,18 @@ private:
TakeProgress* mpProgress;
TPGalleryThemeProperties* mpBrowser;
List& mrTakenList;
TokenList_impl& mrTakenList;
virtual void SAL_CALL run();
virtual void SAL_CALL onTerminated();
public:
TakeThread( TakeProgress* pProgess, TPGalleryThemeProperties* pBrowser, List& rTakenList );
TakeThread(
TakeProgress* pProgess,
TPGalleryThemeProperties* pBrowser,
TokenList_impl& rTakenList
);
virtual ~TakeThread();
};
@ -160,7 +165,7 @@ private:
FixedLine aFLTakeProgress;
CancelButton aBtnCancel;
TakeThread maTakeThread;
List maTakenList;
TokenList_impl maTakenList;
DECL_LINK( ClickCancelBtn, void* );
void Terminate();