diff options
author | Noel Grandin <noel@peralex.com> | 2014-01-08 14:29:55 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2014-01-09 10:59:58 +0200 |
commit | 6d25220ad6c869bb7cd79cf678d092b81558a8d2 (patch) | |
tree | 84bbb32ef5233d5a162eb4f3073de96ca8dc1d13 | |
parent | f85b2f676dabd388254fb411d497e36ccecd2ddb (diff) |
remove unnecessary use of OUString*
in FileList. There no benefit in storing a ref-counted value class like
OUString by pointer in a std::vector.
Change-Id: I302bc460de67c7fe324d745f3225df4e17195486
-rw-r--r-- | include/sot/filelist.hxx | 3 | ||||
-rw-r--r-- | sot/source/base/filelist.cxx | 8 |
2 files changed, 5 insertions, 6 deletions
diff --git a/include/sot/filelist.hxx b/include/sot/filelist.hxx index 32499df78133..631f3ca05a1d 100644 --- a/include/sot/filelist.hxx +++ b/include/sot/filelist.hxx @@ -24,7 +24,8 @@ #include <tools/stream.hxx> #include <vector> -typedef ::std::vector< OUString* > FileStringList; + +typedef ::std::vector< OUString > FileStringList; class SOT_DLLPUBLIC FileList : public SvDataCopyStream { diff --git a/sot/source/base/filelist.cxx b/sot/source/base/filelist.cxx index da4cd9f446a1..4493fcf129ed 100644 --- a/sot/source/base/filelist.cxx +++ b/sot/source/base/filelist.cxx @@ -39,8 +39,6 @@ FileList::~FileList() void FileList::ClearAll( void ) { - for ( size_t i = 0, n = aStrList.size(); i < n; ++i ) - delete aStrList[ i ]; aStrList.clear(); } @@ -53,7 +51,7 @@ void FileList::ClearAll( void ) FileList& FileList::operator=( const FileList& rFileList ) { for ( size_t i = 0, n = rFileList.aStrList.size(); i < n; ++i ) - aStrList.push_back( new OUString( *rFileList.aStrList[ i ] ) ); + aStrList.push_back( rFileList.aStrList[ i ] ); return *this; } @@ -137,14 +135,14 @@ SvStream& operator>>( SvStream& rIStm, FileList& rFileList ) void FileList::AppendFile( const OUString& rStr ) { - aStrList.push_back( new OUString( rStr ) ); + aStrList.push_back( rStr ); } OUString FileList::GetFile( size_t i ) const { OUString aStr; if( i < aStrList.size() ) - aStr = *aStrList[ i ]; + aStr = aStrList[ i ]; return aStr; } |