summaryrefslogtreecommitdiff
path: root/idl
diff options
context:
space:
mode:
authorJoseph Powers <jpowers27@cox.net>2010-12-28 18:02:06 -0800
committerJoseph Powers <jpowers27@cox.net>2010-12-31 06:57:20 -0800
commit2e2bcb6cb9310e8c995f0b03ce1bf990dd03292f (patch)
treedb87a38d49e719d915f46e5ecd098229d5c524cb /idl
parentcdd425de05e1a6098a732115014b258e2a69a076 (diff)
Remove DECLARE_LIST( StringList, String * )
Diffstat (limited to 'idl')
-rw-r--r--idl/inc/command.hxx3
-rw-r--r--idl/source/prj/command.cxx35
-rw-r--r--idl/source/prj/database.cxx22
3 files changed, 26 insertions, 34 deletions
diff --git a/idl/inc/command.hxx b/idl/inc/command.hxx
index 44c221ff4e22..c2d6adfc60a9 100644
--- a/idl/inc/command.hxx
+++ b/idl/inc/command.hxx
@@ -32,10 +32,11 @@
#include <tools/list.hxx>
#include <tools/string.hxx>
+#include <vector>
#ifndef STRING_LIST
#define STRING_LIST
-DECLARE_LIST( StringList, String * )
+typedef ::std::vector< String* > StringList;
#endif
DECLARE_LIST( ByteStringList, ByteString* )
diff --git a/idl/source/prj/command.cxx b/idl/source/prj/command.cxx
index b0e9da40e583..61fbe6106f12 100644
--- a/idl/source/prj/command.cxx
+++ b/idl/source/prj/command.cxx
@@ -172,9 +172,9 @@ void DeInit()
*************************************************************************/
BOOL ReadIdl( SvIdlWorkingBase * pDataBase, const SvCommand & rCommand )
{
- for( USHORT n = 0; n < rCommand.aInFileList.Count(); n++ )
+ for( size_t n = 0; n < rCommand.aInFileList.size(); ++n )
{
- String aFileName ( *rCommand.aInFileList.GetObject( n ) );
+ String aFileName ( *rCommand.aInFileList[ n ] );
SvFileStream aStm( aFileName, STREAM_STD_READ | STREAM_NOCREATE );
if( aStm.GetError() == SVSTREAM_OK )
{
@@ -218,7 +218,7 @@ BOOL ReadIdl( SvIdlWorkingBase * pDataBase, const SvCommand & rCommand )
static BOOL ResponseFile( StringList * pList, int argc, char ** argv )
{
// Programmname
- pList->Insert( new String( String::CreateFromAscii(*argv) ), LIST_APPEND );
+ pList->push_back( new String( String::CreateFromAscii(*argv) ) );
for( int i = 1; i < argc; i++ )
{
if( '@' == **(argv +i) )
@@ -240,12 +240,12 @@ static BOOL ResponseFile( StringList * pList, int argc, char ** argv )
while( aStr.GetChar(n) && !isspace( aStr.GetChar(n) ) )
n++;
if( n != nPos )
- pList->Insert( new String( String::CreateFromAscii( aStr.Copy( nPos, n - nPos ).GetBuffer() ) ), LIST_APPEND );
+ pList->push_back( new String( String::CreateFromAscii( aStr.Copy( nPos, n - nPos ).GetBuffer() ) ) );
}
}
}
else if( argv[ i ] )
- pList->Insert( new String( String::CreateFromAscii( argv[ i ] ) ), LIST_APPEND );
+ pList->push_back( new String( String::CreateFromAscii( argv[ i ] ) ) );
}
return TRUE;
}
@@ -261,9 +261,9 @@ SvCommand::SvCommand( int argc, char ** argv )
StringList aList;
if( ResponseFile( &aList, argc, argv ) )
- for( ULONG i = 1; i < aList.Count(); i++ )
+ for( size_t i = 1; i < aList.size(); i++ )
{
- String aParam( *aList.GetObject( i ) );
+ String aParam( *aList[ i ] );
sal_Unicode aFirstChar( aParam.GetChar(0) );
if( '-' == aFirstChar )
{
@@ -374,9 +374,9 @@ SvCommand::SvCommand( int argc, char ** argv )
}
else if( aParam.EqualsIgnoreCaseAscii( "rsc", 0, 3 ) )
{ // erste Zeile im *.srs File
- if( aList.GetObject( i +1 ) )
+ if( aList[ i + 1 ] )
{
- aSrsLine = ByteString( *aList.GetObject( i +1 ), RTL_TEXTENCODING_UTF8 );
+ aSrsLine = ByteString( *aList[ i +1 ], RTL_TEXTENCODING_UTF8 );
i++;
}
}
@@ -392,7 +392,7 @@ SvCommand::SvCommand( int argc, char ** argv )
}
else
{
- aInFileList.Insert( new String( aParam ), LIST_APPEND );
+ aInFileList.push_back( new String( aParam ) );
}
}
else
@@ -400,12 +400,9 @@ SvCommand::SvCommand( int argc, char ** argv )
printf( "%s", CommandLineSyntax );
}
- String * pStr = aList.First();
- while( pStr )
- {
- delete pStr;
- pStr = aList.Next();
- }
+ for ( size_t i = 0, n = aList.size(); i < n; ++i )
+ delete aList[ i ];
+ aList.clear();
ByteString aInc( getenv( "INCLUDE" ) );
// Include Environmentvariable anhaengen
@@ -427,9 +424,9 @@ SvCommand::SvCommand( int argc, char ** argv )
SvCommand::~SvCommand()
{
// ByteString Liste freigeben
- String * pStr;
- while( NULL != (pStr = aInFileList.Remove()) )
- delete pStr;
+ for ( size_t i = 0, n = aInFileList.size(); i < n; ++i )
+ delete aInFileList[ i ];
+ aInFileList.clear();
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/idl/source/prj/database.cxx b/idl/source/prj/database.cxx
index ba4aa19aeb5e..d2c44f7b5821 100644
--- a/idl/source/prj/database.cxx
+++ b/idl/source/prj/database.cxx
@@ -74,12 +74,10 @@ SvIdlDataBase::SvIdlDataBase( const SvCommand& rCmd )
*************************************************************************/
SvIdlDataBase::~SvIdlDataBase()
{
- String * pStr = aIdFileList.First();
- while( pStr )
- {
- delete pStr;
- pStr = aIdFileList.Next();
- }
+ for ( size_t i = 0, n = aIdFileList.size(); i < n; ++i )
+ delete aIdFileList[ i ];
+ aIdFileList.clear();
+
delete pIdTable;
}
@@ -320,15 +318,11 @@ BOOL SvIdlDataBase::ReadIdFile( const String & rFileName )
DirEntry aFullName( rFileName );
aFullName.Find( GetPath() );
- String * pIdFile = aIdFileList.First();
- while( pIdFile )
- {
- if( *pIdFile == rFileName )
- return TRUE; // schon eingelesen
- pIdFile = aIdFileList.Next();
- }
+ for ( size_t i = 0, n = aIdFileList.size(); i < n; ++i )
+ if ( *aIdFileList[ i ] == rFileName )
+ return TRUE;
- aIdFileList.Insert( new String( rFileName ), LIST_APPEND );
+ aIdFileList.push_back( new String( rFileName ) );
SvTokenStream aTokStm( aFullName.GetFull() );
if( aTokStm.GetStream().GetError() == SVSTREAM_OK )