summaryrefslogtreecommitdiff
path: root/sot
diff options
context:
space:
mode:
authorJoseph Powers <jpowers27@cox.net>2011-02-01 07:24:09 -0800
committerJoseph Powers <jpowers27@cox.net>2011-02-01 07:24:09 -0800
commit177abf404881b3557ef1cc99ef56cf9b6f90abe4 (patch)
tree2b481d8c3322c9856319c3ff1cd55e6bc77323dd /sot
parent446d59e168318ae1d0e064d7409c4335f20259e8 (diff)
Remove DECLARE_LIST( FileStringList, String* )
Diffstat (limited to 'sot')
-rw-r--r--sot/inc/filelist.hxx22
-rw-r--r--sot/source/base/filelist.cxx54
2 files changed, 28 insertions, 48 deletions
diff --git a/sot/inc/filelist.hxx b/sot/inc/filelist.hxx
index bf9aa3e4084d..e4f920437165 100644
--- a/sot/inc/filelist.hxx
+++ b/sot/inc/filelist.hxx
@@ -32,32 +32,32 @@
#include <tools/stream.hxx>
#include "sot/sotdllapi.h"
-class FileStringList;
+#include <vector>
+typedef ::std::vector< String* > FileStringList;
class SOT_DLLPUBLIC FileList : public SvDataCopyStream
{
- FileStringList* pStrList;
+ FileStringList aStrList;
protected:
// SvData-Methoden
- virtual void Load( SvStream& );
- virtual void Save( SvStream& );
- virtual void Assign( const SvDataCopyStream& );
+ virtual void Load( SvStream& );
+ virtual void Save( SvStream& );
+ virtual void Assign( const SvDataCopyStream& );
// Liste loeschen;
- void ClearAll( void );
+ void ClearAll( void );
public:
TYPEINFO();
- FileList();
- ~FileList();
+ FileList() {};
+ ~FileList();
// Zuweisungsoperator
FileList& operator=( const FileList& rFileList );
-
// Im-/Export
SOT_DLLPUBLIC friend SvStream& operator<<( SvStream& rOStm, const FileList& rFileList );
SOT_DLLPUBLIC friend SvStream& operator>>( SvStream& rIStm, FileList& rFileList );
@@ -68,8 +68,8 @@ public:
// Liste fuellen/abfragen
void AppendFile( const String& rStr );
- String GetFile( ULONG i ) const;
- ULONG Count( void ) const;
+ String GetFile( size_t i ) const;
+ size_t Count( void ) const;
};
diff --git a/sot/source/base/filelist.cxx b/sot/source/base/filelist.cxx
index a35b2ecb80e3..8a2337ea5017 100644
--- a/sot/source/base/filelist.cxx
+++ b/sot/source/base/filelist.cxx
@@ -29,31 +29,22 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sot.hxx"
-#include<tools/list.hxx>
-#include<tools/stream.hxx>
-#include<tools/string.hxx>
-#include<tools/rtti.hxx>
-#include<sot/exchange.hxx>
-#include<filelist.hxx>
+#include <tools/list.hxx>
+#include <tools/stream.hxx>
+#include <tools/string.hxx>
+#include <tools/rtti.hxx>
+#include <sot/exchange.hxx>
+#include <filelist.hxx>
#include <osl/thread.h>
TYPEINIT1_AUTOFACTORY( FileList, SvDataCopyStream );
-// String-Liste zum Speichern der Namen deklarieren
-DECLARE_LIST( FileStringList, String* )
-
-
/*************************************************************************
|*
|* FileList - Ctor/Dtor
|*
\*************************************************************************/
-FileList::FileList()
-{
- pStrList = new FileStringList();
-}
-
FileList::~FileList()
{
ClearAll();
@@ -61,13 +52,9 @@ FileList::~FileList()
void FileList::ClearAll( void )
{
- // Strings in der Liste loeschen
- ULONG nCount = pStrList->Count();
- for( ULONG i = 0 ; i < nCount ; i++ )
- delete pStrList->GetObject( i );
-
- // Liste loeschen
- delete pStrList;
+ for ( size_t i = 0, n = aStrList.size(); i < n; ++i )
+ delete aStrList[ i ];
+ aStrList.clear();
}
/*************************************************************************
@@ -78,14 +65,8 @@ void FileList::ClearAll( void )
FileList& FileList::operator=( const FileList& rFileList )
{
- // Liste duplizieren
- *pStrList = *rFileList.pStrList;
-
- // Strings in der Liste kopieren
- ULONG nCount = pStrList->Count();
- for( ULONG i = 0 ; i < nCount ; i++ )
- pStrList->Replace( new String( *rFileList.pStrList->GetObject( i ) ), i );
-
+ for ( size_t i = 0, n = rFileList.aStrList.size(); i < n; ++i )
+ aStrList.push_back( new String( *rFileList.aStrList[ i ] ) );
return *this;
}
@@ -147,7 +128,6 @@ SvStream& operator<<( SvStream& rOStm, const FileList& /*rFileList*/ )
SvStream& operator>>( SvStream& rIStm, FileList& rFileList )
{
rFileList.ClearAll();
- rFileList.pStrList = new FileStringList();
String aStr;
sal_uInt16 c;
@@ -182,20 +162,20 @@ SvStream& operator>>( SvStream& rIStm, FileList& rFileList )
void FileList::AppendFile( const String& rStr )
{
- pStrList->Insert( new String( rStr ) , pStrList->Count() );
+ aStrList.push_back( new String( rStr ) );
}
-String FileList::GetFile( ULONG i ) const
+String FileList::GetFile( size_t i ) const
{
String aStr;
- if( i < pStrList->Count() )
- aStr = *pStrList->GetObject( i );
+ if( i < aStrList.size() )
+ aStr = *aStrList[ i ];
return aStr;
}
-ULONG FileList::Count( void ) const
+size_t FileList::Count( void ) const
{
- return pStrList->Count();
+ return aStrList.size();
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */