[Libreoffice-commits] .: l10ntools/inc l10ntools/source

Joseph Powers jpowers at kemper.freedesktop.org
Sun Jan 23 07:24:02 PST 2011


 l10ntools/inc/gsicheck.hxx    |    2 
 l10ntools/inc/tagtest.hxx     |   90 +++++++++---------------
 l10ntools/source/gsicheck.cxx |    5 -
 l10ntools/source/tagtest.cxx  |  153 ++++++++++++++++++------------------------
 4 files changed, 104 insertions(+), 146 deletions(-)

New commits:
commit 5d454852490f27d2184d54f73311f4c196142d57
Author: Joseph Powers <jpowers27 at cox.net>
Date:   Sun Jan 23 07:22:37 2011 -0800

    Remove DECLARE_LIST() Impl_ParserMessageList & TokenListImpl

diff --git a/l10ntools/inc/gsicheck.hxx b/l10ntools/inc/gsicheck.hxx
index aff04fe..660ddad 100644
--- a/l10ntools/inc/gsicheck.hxx
+++ b/l10ntools/inc/gsicheck.hxx
@@ -76,7 +76,7 @@ public:
           void        SetTitle( ByteString &aNew ) { aTitle = aNew; ReassembleLine(); }
 
     ParserMessageList* GetMessageList() { return &aMessages; };
-    BOOL HasMessages(){ return ( aMessages.Count() > 0 ); };
+    BOOL HasMessages(){ return ( !aMessages.empty() ); };
 
     BOOL IsOK() const { return bOK; }
     void NotOK();
diff --git a/l10ntools/inc/tagtest.hxx b/l10ntools/inc/tagtest.hxx
index 0c6f91f..be45199 100644
--- a/l10ntools/inc/tagtest.hxx
+++ b/l10ntools/inc/tagtest.hxx
@@ -2,7 +2,7 @@
 /*************************************************************************
  *
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- * 
+ *
  * Copyright 2000, 2010 Oracle and/or its affiliates.
  *
  * OpenOffice.org - a multi-platform office productivity suite
@@ -32,6 +32,7 @@
 #include <tools/string.hxx>
 #include <tools/list.hxx>
 #include <hash_map> /* std::hashmap*/
+#include <vector>
 
 class GSILine;
 
@@ -40,11 +41,10 @@ typedef USHORT TokenId;
 #define TOK_INVALIDPOS  USHORT( 0xFFFF )
 
 class ParserMessage;
+typedef ::std::vector< ParserMessage* > Impl_ParserMessageList;
 
-DECLARE_LIST( Impl_ParserMessageList, ParserMessage* )
 class ParserMessageList;
 
-
 struct equalByteString{
         bool operator()( const ByteString& rKey1, const ByteString& rKey2 ) const {
             return rKey1.CompareTo( rKey2 )==COMPARE_EQUAL;
@@ -123,13 +123,21 @@ explicit    TokenInfo( TokenId pnId, USHORT nP, String paStr, ParserMessageList
 };
 
 
-class ParserMessageList : public Impl_ParserMessageList
+class ParserMessageList
 {
+private:
+    Impl_ParserMessageList maList;
+
 public:
+    ~ParserMessageList() { clear(); }
     void AddError( USHORT nErrorNr, ByteString aErrorText, const TokenInfo &rTag );
     void AddWarning( USHORT nErrorNr, ByteString aErrorText, const TokenInfo &rTag );
 
     BOOL HasErrors();
+    bool empty() const { return maList.empty(); }
+    size_t size() const { return maList.size(); }
+    ParserMessage* operator [] ( size_t i ) { return ( i < maList.size() ) ? maList[ i ] : NULL; }
+    void clear();
 };
 
 
@@ -217,62 +225,42 @@ public:
 
 #define TAG_UNKNOWN_TAG				( TAG_GROUP_MULTI << TAG_GROUPSHIFT | 0x800 )
 
-DECLARE_LIST( TokenListImpl, TokenInfo* )
+typedef ::std::vector< TokenInfo* > TokenListImpl;
 
-class TokenList : private TokenListImpl
+class TokenList
 {
 private:
-
+    TokenListImpl maList;
     TokenList&   operator =( const TokenList& rList );
-//                { TokenListImpl::operator =( rList ); return *this; }
-
 
 public:
-    using TokenListImpl::Count;
-
-
-    TokenList() : TokenListImpl(){};
-    ~TokenList(){ Clear(); };
+    TokenList() {};
+    ~TokenList(){ clear(); };
 
-    void		Clear()
+    size_t size() const { return maList.size(); }
+    void clear()
         {
-            for ( ULONG i = 0 ; i < Count() ; i++ )
-                delete TokenListImpl::GetObject( i );
-            TokenListImpl::Clear();
+            for ( size_t i = 0 ; i < maList.size() ; i++ )
+                delete maList[ i ];
+            maList.clear();
         }
-    void		Insert( TokenInfo p, ULONG nIndex = LIST_APPEND )
-        { TokenListImpl::Insert( new TokenInfo(p), nIndex ); }
-/*    TokenInfo		Remove( ULONG nIndex )
-        {
-            TokenInfo aT = GetObject( nIndex );
-            delete TokenListImpl::GetObject( nIndex );
-            TokenListImpl::Remove( nIndex );
-            return aT;
-        }*/
-//    TokenInfo		Remove( TokenInfo p ){ return Remove( GetPos( p ) ); }
-//    TokenInfo		GetCurObject() const { return *TokenListImpl::GetCurObject(); }
-    TokenInfo&		GetObject( ULONG nIndex ) const
+
+    void insert( TokenInfo p, size_t nIndex = LIST_APPEND )
         {
-//			if ( TokenListImpl::GetObject(nIndex) )
-                return *TokenListImpl::GetObject(nIndex);
-//			else
-//				return TokenInfo();
+            if ( nIndex < maList.size() ) {
+                TokenListImpl::iterator it = maList.begin();
+                ::std::advance( it, nIndex );
+                maList.insert( it, new TokenInfo(p) );
+            } else {
+                maList.push_back( new TokenInfo(p) );
+            }
         }
-/*    ULONG		GetPos( const TokenInfo p ) const
+    TokenInfo& operator [] ( size_t nIndex ) const
         {
-            for ( ULONG i = 0 ; i < Count() ; i++ )
-                if ( p == GetObject( i ) )
-                    return i;
-            return LIST_ENTRY_NOTFOUND;
-        }*/
+            return *maList[ nIndex ];
+        }
 
     TokenList( const TokenList& rList );
-/*		{
-            for ( ULONG i = 0 ; i < rList.Count() ; i++ )
-            {
-                Insert( rList.GetObject( i ), LIST_APPEND );
-            }
-        }*/
 };
 
 class ParserMessage
@@ -363,8 +351,6 @@ class TokenParser
 public:
     TokenParser();
     void Parse( const String &aCode, ParserMessageList* pList );
-//	ParserMessageList& GetErrors(){ return aErrorList; }
-//	BOOL HasErrors(){ return ( aErrorList.Count() > 0 ); }
     TokenList& GetTokenList(){ return aParser.GetTokenList(); }
 };
 
@@ -381,14 +367,8 @@ public:
     void CheckReference( GSILine *aReference );
     void CheckTestee( GSILine *aTestee, BOOL bHasSourceLine, BOOL bFixTags );
 
-//	ParserMessageList& GetReferenceErrors(){ return aReferenceParser.GetErrors(); }
-//	BOOL HasReferenceErrors(){ return aReferenceParser.HasErrors(); }
-
-//	ParserMessageList& GetTesteeErrors(){ return aTesteeParser.GetErrors(); }
-//	BOOL HasTesteeErrors(){ return aTesteeParser.HasErrors(); }
-
     ParserMessageList& GetCompareWarnings(){ return aCompareWarningList; }
-    BOOL HasCompareWarnings(){ return ( aCompareWarningList.Count() > 0 ); }
+    BOOL HasCompareWarnings(){ return ( !aCompareWarningList.empty() ); }
 
     String GetFixedTestee(){ return aFixedTestee; }
 };
diff --git a/l10ntools/source/gsicheck.cxx b/l10ntools/source/gsicheck.cxx
index 7b943f9..eb50168 100644
--- a/l10ntools/source/gsicheck.cxx
+++ b/l10ntools/source/gsicheck.cxx
@@ -375,10 +375,9 @@ void GSIBlock::PrintList( ParserMessageList *pList, ByteString aPrefix,
     GSILine *pLine )
 /*****************************************************************************/
 {
-    ULONG i;
-    for ( i = 0 ; i < pList->Count() ; i++ )
+    for ( size_t i = 0 ; i < pList->size() ; i++ )
     {
-        ParserMessage *pMsg = pList->GetObject( i );
+        ParserMessage *pMsg = (*pList)[ i ];
         ByteString aContext;
         if ( bPrintContext )
         {
diff --git a/l10ntools/source/tagtest.cxx b/l10ntools/source/tagtest.cxx
index 0806319..d9e69fc 100644
--- a/l10ntools/source/tagtest.cxx
+++ b/l10ntools/source/tagtest.cxx
@@ -2,7 +2,7 @@
 /*************************************************************************
  *
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- * 
+ *
  * Copyright 2000, 2010 Oracle and/or its affiliates.
  *
  * OpenOffice.org - a multi-platform office productivity suite
@@ -96,7 +96,7 @@ void TokenInfo::SplitTag( ParserMessageList &rErrorList )
     String aDelims( String::CreateFromAscii( " \\=>/" ) );
     String aPortion;
     String aValue;      // store the value of a property
-    ByteString aName;   // store the name of a property/tag 
+    ByteString aName;   // store the name of a property/tag
     BOOL bCheckName = FALSE;
     BOOL bCheckEmpty = FALSE;
     sal_Unicode cDelim;
@@ -112,7 +112,7 @@ void TokenInfo::SplitTag( ParserMessageList &rErrorList )
         aPortion = aTokenString.Copy( nLastPos, nCheckPos-nLastPos );
 
         if ( aTokenString.GetChar( nCheckPos ) == '\\' )
-            nCheckPos++;         
+            nCheckPos++;
 
         cDelim = aTokenString.GetChar( nCheckPos );
         nCheckPos++;
@@ -129,7 +129,7 @@ void TokenInfo::SplitTag( ParserMessageList &rErrorList )
                     case ' ':  aState = TC_HAS_TAG_NAME;
                                bCheckName = TRUE;
                                break;
-                    case '/':  
+                    case '/':
                         {
                             if ( aPortion.Len() == 0 )
                             {
@@ -216,7 +216,7 @@ void TokenInfo::SplitTag( ParserMessageList &rErrorList )
             case TC_INSIDE_STRING:
                 switch ( cDelim )
                 {
-                    case '\"': 
+                    case '\"':
                         {
                             aState = TC_PROP_FINISHED;
                             aValue += aPortion;
@@ -236,7 +236,7 @@ void TokenInfo::SplitTag( ParserMessageList &rErrorList )
                             }
                         }
                                break;
-                    default:   
+                    default:
                         {
                             aState = TC_INSIDE_STRING;
                             aValue += aPortion;
@@ -336,7 +336,7 @@ void TokenInfo::SplitTag( ParserMessageList &rErrorList )
             else
             {
                 aName = ByteString( aPortion, RTL_TEXTENCODING_UTF8 );
-                // "a-zA-Z_-.0-9" 
+                // "a-zA-Z_-.0-9"
                 xub_StrLen nCount;
                 BOOL bBroken = FALSE;
                 const sal_Char* aBuf = aName.GetBuffer();
@@ -396,7 +396,7 @@ BOOL TokenInfo::IsPropertyRelevant( const ByteString &aName, const String &aValu
         return FALSE;
     if ( aTagName.EqualsAscii( "image" ) && (aName.Equals( "width" ) || aName.Equals( "height" )) )
         return FALSE;
-    
+
     return TRUE;
 }
 
@@ -438,10 +438,10 @@ BOOL TokenInfo::IsPropertyInvariant( const ByteString &aName, const String &aVal
 BOOL TokenInfo::IsPropertyFixable( const ByteString &aName ) const
 {
     // name everything that is allowed to be fixed automatically here
-    if ( (aTagName.EqualsAscii( "ahelp" ) && aName.Equals( "hid" )) 
-      || (aTagName.EqualsAscii( "link" ) && aName.Equals( "href" )) 
-      || (aTagName.EqualsAscii( "alt" ) && aName.Equals( "id" )) 
-      || (aTagName.EqualsAscii( "variable" ) && aName.Equals( "id" )) 
+    if ( (aTagName.EqualsAscii( "ahelp" ) && aName.Equals( "hid" ))
+      || (aTagName.EqualsAscii( "link" ) && aName.Equals( "href" ))
+      || (aTagName.EqualsAscii( "alt" ) && aName.Equals( "id" ))
+      || (aTagName.EqualsAscii( "variable" ) && aName.Equals( "id" ))
       || (aTagName.EqualsAscii( "image" ) && aName.Equals( "src" ))
       || (aTagName.EqualsAscii( "image" ) && aName.Equals( "id" ) ))
         return TRUE;
@@ -514,7 +514,7 @@ BOOL TokenInfo::MatchesTranslation( TokenInfo& rInfo, BOOL bGenErrors, ParserMes
         }
     }
 
-    // if we reach here eather 
+    // if we reach here eather
     //   the tags match completely or
     //   the tags match but not the properties and we generated errors for that
     return TRUE;
@@ -551,23 +551,29 @@ String TokenInfo::MakeTag() const
 
 void ParserMessageList::AddError( USHORT nErrorNr, ByteString aErrorText, const TokenInfo &rTag )
 {
-    Insert( new ParserError( nErrorNr, aErrorText, rTag ), LIST_APPEND );
+    maList.push_back( new ParserError( nErrorNr, aErrorText, rTag ) );
 }
 
 void ParserMessageList::AddWarning( USHORT nErrorNr, ByteString aErrorText, const TokenInfo &rTag )
 {
-    Insert( new ParserWarning( nErrorNr, aErrorText, rTag ), LIST_APPEND );
+    maList.push_back( new ParserWarning( nErrorNr, aErrorText, rTag ) );
 }
 
 BOOL ParserMessageList::HasErrors()
 {
-    USHORT i;
-    for ( i=0 ; i < Count() ; i++ )
-        if ( GetObject( i )->IsError() )
+    for ( size_t i = 0, n = maList.size(); i < n; ++i )
+        if ( maList[ i ]->IsError() )
             return TRUE;
     return FALSE;
 }
 
+void ParserMessageList::clear()
+{
+    for ( size_t i = 0, n = maList.size(); i < n; ++i )
+        delete maList[ i ];
+    maList.clear();
+}
+
 struct Tag
 {
     String GetName() const { return String::CreateFromAscii( pName ); };
@@ -664,7 +670,7 @@ void SimpleParser::Parse( String PaSource )
     nPos = 0;
     aLastToken.Erase();
     aNextTag = TokenInfo( TAG_NOMORETAGS, TOK_INVALIDPOS );
-    aTokenList.Clear();
+    aTokenList.clear();
 };
 
 TokenInfo SimpleParser::GetNextToken( ParserMessageList &rErrorList )
@@ -736,24 +742,18 @@ TokenInfo SimpleParser::GetNextToken( ParserMessageList &rErrorList )
 
     if ( aResult.nId == TAG_UNKNOWN_TAG )
         aResult = TokenInfo( TAG_UNKNOWN_TAG, nTokenStartPos, aLastToken );
-    aTokenList.Insert( aResult, LIST_APPEND );
+    aTokenList.insert( aResult );
     return aResult;
 }
 
 String SimpleParser::GetNextTokenString( ParserMessageList &rErrorList, USHORT &rTagStartPos )
 {
-//	USHORT nStyle1StartPos = aSource.SearchAscii( "<#", nPos );
     USHORT nStyle2StartPos = aSource.SearchAscii( "$[", nPos );
     USHORT nStyle3StartPos = aSource.SearchAscii( "\\<", nPos );
     USHORT nStyle4StartPos = aSource.SearchAscii( "\\\\", nPos );    // this is only to kick out quoted backslashes
 
     rTagStartPos = 0;
 
-/* removing since a \<... is not likely
-    // check if the tag starts with a letter to avoid things like <> <= ... >
-    while ( STRING_NOTFOUND != nStyle3StartPos && !( aSource.Copy( nStyle3StartPos+2, 1 ).IsAlphaAscii() || aSource.GetChar( nStyle3StartPos+2 ) == '/' ) )
-        nStyle3StartPos = aSource.SearchAscii( "\\<", nStyle3StartPos+1 );
-*/
     if ( STRING_NOTFOUND == nStyle2StartPos && STRING_NOTFOUND == nStyle3StartPos )
         return String();  // no more tokens
 
@@ -763,19 +763,7 @@ String SimpleParser::GetNextTokenString( ParserMessageList &rErrorList, USHORT &
         return GetNextTokenString( rErrorList, rTagStartPos );
     }
 
-/*	if ( nStyle1StartPos < nStyle2StartPos && nStyle1StartPos <= nStyle3StartPos )  // <= to make sure our spechial tags are recognized before all others
-    {	// test for <# ... > style tokens
-        USHORT nEndPos = aSource.SearchAscii( ">", nStyle1StartPos );
-        if ( nEndPos == STRING_NOTFOUND )
-        {   // Token is incomplete. Skip start and search for better ones
-            nPos = nStyle1StartPos +2;
-            return GetNextTokenString( rErrorList, rTagStartPos );
-        }
-        nPos = nEndPos;
-        rTagStartPos = nStyle1StartPos;
-        return aSource.Copy( nStyle1StartPos, nEndPos-nStyle1StartPos +1 ).ToUpperAscii();
-    }
-    else*/ if ( nStyle2StartPos < nStyle3StartPos )
+    if ( nStyle2StartPos < nStyle3StartPos )
     {	// test for $[ ... ] style tokens
         USHORT nEndPos = aSource.SearchAscii( "]", nStyle2StartPos);
         if ( nEndPos == STRING_NOTFOUND )
@@ -877,11 +865,6 @@ void TokenParser::Parse( const String &aCode, ParserMessageList* pList )
                     ParseError( 17, "<#UNDER> expected before <#/UNDER>.", aTag );
                 }
                 break;
-/*			case TAG_MISSPARENTHESIS:
-                {
-                    ParseError( 14, "missing closing parenthesis '>'", aTag );
-                }
-                break;*/
             case TAG_AEND:
                 {
                     ParseError( 5, "Extra Tag <#AEND>. <#AVIS> or <#AHID> expected.", aTag );
@@ -1422,13 +1405,9 @@ BOOL LingTest::IsTagMandatory( TokenInfo const &aToken, TokenId &aMetaTokens )
 
 void LingTest::CheckTags( TokenList &aReference, TokenList &aTestee, BOOL bFixTags )
 {
-    ULONG i=0,j=0;
+    size_t i=0,j=0;
     // Clean old Warnings
-    while ( aCompareWarningList.Count() )
-    {
-        delete aCompareWarningList.GetCurObject();
-        aCompareWarningList.Remove();
-    }
+    aCompareWarningList.clear();
 
     /* in xml tags, do not require the following tags
         comment
@@ -1440,35 +1419,35 @@ void LingTest::CheckTags( TokenList &aReference, TokenList &aTestee, BOOL bFixTa
 
     // filter uninteresting Tags
     TokenId aMetaTokens = 0;
-    for ( i=0 ; i < aReference.Count() ; i++ )
+    for ( i=0 ; i < aReference.size() ; i++ )
     {
-        if ( !IsTagMandatory( aReference.GetObject( i ), aMetaTokens ) )
-            aReference.GetObject( i ).SetDone();
+        if ( !IsTagMandatory( aReference[ i ], aMetaTokens ) )
+            aReference[ i ].SetDone();
     }
 
     aMetaTokens = 0;
-    for ( i=0 ; i < aTestee.Count() ; i++ )
+    for ( i=0 ; i < aTestee.size() ; i++ )
     {
-        if ( !IsTagMandatory( aTestee.GetObject( i ), aMetaTokens ) )
-            aTestee.GetObject( i ).SetDone();
+        if ( !IsTagMandatory( aTestee[ i ], aMetaTokens ) )
+            aTestee[ i ].SetDone();
     }
 
     // remove all matching tags
-    for ( i=0 ; i < aReference.Count() ; i++ )
+    for ( i=0 ; i < aReference.size() ; i++ )
     {
-        if ( aReference.GetObject( i ).IsDone() )
+        if ( aReference[ i ].IsDone() )
             continue;
 
         BOOL bTagFound = FALSE;
-        for ( j=0 ; j < aTestee.Count() && !bTagFound ; j++ )
+        for ( j=0 ; j < aTestee.size() && !bTagFound ; j++ )
         {
-            if ( aTestee.GetObject( j ).IsDone() )
+            if ( aTestee[ j ].IsDone() )
                 continue;
 
-            if ( aReference.GetObject( i ).MatchesTranslation( aTestee.GetObject( j ), FALSE, aCompareWarningList ) )
+            if ( aReference[ i ].MatchesTranslation( aTestee[ j ], FALSE, aCompareWarningList ) )
             {
-                aReference.GetObject( i ).SetDone();
-                aTestee.GetObject( j ).SetDone();
+                aReference[ i ].SetDone();
+                aTestee[ j ].SetDone();
                 bTagFound = TRUE;
             }
         }
@@ -1480,62 +1459,62 @@ void LingTest::CheckTags( TokenList &aReference, TokenList &aTestee, BOOL bFixTa
     {
         // we fix only if its a really simple case
         USHORT nTagCount = 0;
-        for ( i=0 ; i < aReference.Count() ; i++ )
-            if ( !aReference.GetObject( i ).IsDone() )
+        for ( i=0 ; i < aReference.size() ; i++ )
+            if ( !aReference[ i ].IsDone() )
                 nTagCount++;
         if ( nTagCount > 1 )
             bCanFix = FALSE;
 
         nTagCount = 0;
-        for ( i=0 ; i < aTestee.Count() ; i++ )
-            if ( !aTestee.GetObject( i ).IsDone() )
+        for ( i=0 ; i < aTestee.size() ; i++ )
+            if ( !aTestee[ i ].IsDone() )
                 nTagCount++;
         if ( nTagCount > 1 )
             bCanFix = FALSE;
     }
 
     // generate errors for tags that have differing attributes
-    for ( i=0 ; i < aReference.Count() ; i++ )
+    for ( i=0 ; i < aReference.size() ; i++ )
     {
-        if ( aReference.GetObject( i ).IsDone() )
+        if ( aReference[ i ].IsDone() )
             continue;
 
         BOOL bTagFound = FALSE;
-        for ( j=0 ; j < aTestee.Count() && !bTagFound ; j++ )
+        for ( j=0 ; j < aTestee.size() && !bTagFound ; j++ )
         {
-            if ( aTestee.GetObject( j ).IsDone() )
+            if ( aTestee[ j ].IsDone() )
                 continue;
 
-            if ( aReference.GetObject( i ).MatchesTranslation( aTestee.GetObject( j ), TRUE, aCompareWarningList, bCanFix && bFixTags ) )
+            if ( aReference[ i ].MatchesTranslation( aTestee[ j ], TRUE, aCompareWarningList, bCanFix && bFixTags ) )
             {
-                aReference.GetObject( i ).SetDone();
-                aTestee.GetObject( j ).SetDone();
+                aReference[ i ].SetDone();
+                aTestee[ j ].SetDone();
                 bTagFound = TRUE;
             }
         }
     }
 
     // list remaining tags as errors
-    for ( i=0 ; i < aReference.Count() ; i++ )
+    for ( i=0 ; i < aReference.size() ; i++ )
     {
-        if ( aReference.GetObject( i ).IsDone() )
+        if ( aReference[ i ].IsDone() )
             continue;
 
-        aCompareWarningList.AddError( 20, "Missing Tag in Translation", aReference.GetObject( i ) );
+        aCompareWarningList.AddError( 20, "Missing Tag in Translation", aReference[ i ] );
     }
-    for ( i=0 ; i < aTestee.Count() ; i++ )
+    for ( i=0 ; i < aTestee.size() ; i++ )
     {
-        if ( aTestee.GetObject( i ).IsDone() )
+        if ( aTestee[ i ].IsDone() )
             continue;
 
-        aCompareWarningList.AddError( 21, "Extra Tag in Translation", aTestee.GetObject( i ) );
+        aCompareWarningList.AddError( 21, "Extra Tag in Translation", aTestee[ i ] );
     }
 
-    for ( i=0 ; i < aReference.Count() ; i++ )
-        aReference.GetObject( i ).SetDone( FALSE );
+    for ( i=0 ; i < aReference.size() ; i++ )
+        aReference[ i ].SetDone( FALSE );
 
-    for ( i=0 ; i < aTestee.Count() ; i++ )
-        aTestee.GetObject( i ).SetDone( FALSE );
+    for ( i=0 ; i < aTestee.size() ; i++ )
+        aTestee[ i ].SetDone( FALSE );
 }
 
 void LingTest::CheckReference( GSILine *aReference )
@@ -1557,12 +1536,12 @@ void LingTest::CheckTestee( GSILine *aTestee, BOOL bHasSourceLine, BOOL bFixTags
         BOOL bFixesDone = FALSE;
         // count backwards to allow replacing from right to left
         int i;
-        for ( i=aTesteeTokens.Count()-1 ; i>=0 ; i-- )
+        for ( i = aTesteeTokens.size() ; i > 0 ; )
         {
-            if ( aTesteeTokens.GetObject( i ).HasBeenFixed() )
+            if ( aTesteeTokens[ --i ].HasBeenFixed() )
             {
                 bFixesDone = TRUE;
-                aFixedTestee.Replace( aTesteeTokens.GetObject( i ).nPos, aTesteeTokens.GetObject( i ).aTokenString.Len(), aTesteeTokens.GetObject( i ).MakeTag() );
+                aFixedTestee.Replace( aTesteeTokens[ i ].nPos, aTesteeTokens[ i ].aTokenString.Len(), aTesteeTokens[ i ].MakeTag() );
             }
         }
         if ( bFixesDone )


More information about the Libreoffice-commits mailing list