Kaydet (Commit) f461a9b0 authored tarafından Joseph Powers's avatar Joseph Powers

Remove DECLARE_LIST( XMLAttributeList, XMLAttribute * )

üst 5be744ad
...@@ -64,7 +64,6 @@ using namespace std; ...@@ -64,7 +64,6 @@ using namespace std;
#define MAX_LANGUAGES 99 #define MAX_LANGUAGES 99
//#define TESTDRIVER /* use xml2gsi testclass */
//------------------------------------------------------------------------- //-------------------------------------------------------------------------
/** Holds data of Attributes /** Holds data of Attributes
...@@ -96,7 +95,7 @@ public: ...@@ -96,7 +95,7 @@ public:
} }
}; };
DECLARE_LIST( XMLAttributeList, XMLAttribute * ) typedef ::std::vector< XMLAttribute* > XMLAttributeList;
//------------------------------------------------------------------------- //-------------------------------------------------------------------------
......
...@@ -57,11 +57,11 @@ interestingAttributes( XMLAttributeList* lst ) ...@@ -57,11 +57,11 @@ interestingAttributes( XMLAttributeList* lst )
{ {
std::vector<XMLAttribute*> interesting; std::vector<XMLAttribute*> interesting;
if ( lst ) if ( lst )
for ( ULONG i = 0; i < lst->Count(); i++ ) for ( size_t i = 0; i < lst->size(); i++ )
if ( lst->GetObject( i )->Equals( STRING( "id" ) ) ) if ( (*lst)[ i ]->Equals( STRING( "id" ) ) )
interesting.insert( interesting.begin(), lst->GetObject( i ) ); interesting.insert( interesting.begin(), (*lst)[ i ] );
else if ( ! BSTRING( *lst->GetObject( i ) ).CompareTo( "_", 1 ) ) else if ( ! BSTRING( *(*lst)[ i ]).CompareTo( "_", 1 ) )
interesting.push_back( lst->GetObject( i ) ); interesting.push_back( (*lst)[ i ] );
return interesting; return interesting;
} }
......
...@@ -166,9 +166,9 @@ void TranslateLayout::ParseCommandLine() ...@@ -166,9 +166,9 @@ void TranslateLayout::ParseCommandLine()
static XMLAttribute* static XMLAttribute*
findAttribute( XMLAttributeList* lst, String const& name ) findAttribute( XMLAttributeList* lst, String const& name )
{ {
for ( ULONG i = 0; i < lst->Count(); i++ ) for ( size_t i = 0; i < lst->size(); i++ )
if ( lst->GetObject( i )->Equals( name ) ) if ( (*lst)[ i ]->Equals( name ) )
return lst->GetObject( i ); return (*lst)[ i ];
return 0; return 0;
} }
...@@ -177,7 +177,17 @@ translateAttribute( XMLAttributeList* lst, ...@@ -177,7 +177,17 @@ translateAttribute( XMLAttributeList* lst,
String const& name, String const& translation ) String const& name, String const& translation )
{ {
if ( XMLAttribute* a = findAttribute( lst, name ) ) if ( XMLAttribute* a = findAttribute( lst, name ) )
return lst->Replace ( new XMLAttribute( name.Copy( 1 ), translation ), a ); {
for ( XMLAttributeList::iterator it = lst->begin(); it < lst->end(); ++it )
{
if ( *it == a )
{
delete *it;
*it = new XMLAttribute( name.Copy( 1 ), translation );
return *it;
}
}
}
return 0; return 0;
} }
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment