diff options
author | Noel Grandin <noel@peralex.com> | 2012-08-07 16:56:51 +0200 |
---|---|---|
committer | Tor Lillqvist <tlillqvist@suse.com> | 2012-08-08 13:53:07 +0300 |
commit | 016918cf9459eccc177bfedbe75c6296b3b4bb67 (patch) | |
tree | d6966ad5b74e79d8aff54cefb6e34309b671f8df /idl/source/objects | |
parent | 552cc040866bb2d25cf6187c92d9c4acd0db82d8 (diff) |
STL'ify SV_DECL_IMPL_PERSIST_LIST
Converts it to a template based on std::vector
Change-Id: Id7f89f494164c61a3a573cff443ac0e0488e93f1
Diffstat (limited to 'idl/source/objects')
-rw-r--r-- | idl/source/objects/module.cxx | 56 | ||||
-rw-r--r-- | idl/source/objects/object.cxx | 40 | ||||
-rw-r--r-- | idl/source/objects/slot.cxx | 31 | ||||
-rw-r--r-- | idl/source/objects/types.cxx | 79 |
4 files changed, 106 insertions, 100 deletions
diff --git a/idl/source/objects/module.cxx b/idl/source/objects/module.cxx index 20e38af369da..43a6869efa65 100644 --- a/idl/source/objects/module.cxx +++ b/idl/source/objects/module.cxx @@ -184,9 +184,9 @@ void SvMetaModule::ReadContextSvIdl( SvIdlDataBase & rBase, SvMetaClassRef aClass = new SvMetaClass(); if( aClass->ReadSvIdl( rBase, rInStm ) ) { - aClassList.Append( aClass ); + aClassList.push_back( aClass ); // announce globally - rBase.GetClassList().Append( aClass ); + rBase.GetClassList().push_back( aClass ); } } else if( rInStm.GetToken()->Is( SvHash_enum() ) ) @@ -196,9 +196,9 @@ void SvMetaModule::ReadContextSvIdl( SvIdlDataBase & rBase, if( aEnum->ReadSvIdl( rBase, rInStm ) ) { // declared in module - aTypeList.Append( aEnum ); + aTypeList.push_back( aEnum ); // announce globally - rBase.GetTypeList().Append( aEnum ); + rBase.GetTypeList().push_back( aEnum ); } } else if( rInStm.GetToken()->Is( SvHash_item() ) @@ -210,9 +210,9 @@ void SvMetaModule::ReadContextSvIdl( SvIdlDataBase & rBase, if( xItem->ReadSvIdl( rBase, rInStm ) ) { // declared in module - aTypeList.Append( xItem ); + aTypeList.push_back( xItem ); // announce globally - rBase.GetTypeList().Append( xItem ); + rBase.GetTypeList().push_back( xItem ); } } else if( rInStm.GetToken()->Is( SvHash_include() ) ) @@ -280,7 +280,7 @@ void SvMetaModule::ReadContextSvIdl( SvIdlDataBase & rBase, if( xSlot->Test( rBase, rInStm ) ) { // declared in module - aAttrList.Append( xSlot ); + aAttrList.push_back( xSlot ); // announce globally rBase.AppendAttr( xSlot ); } @@ -294,22 +294,22 @@ void SvMetaModule::WriteContextSvIdl( SvIdlDataBase & rBase, { SvMetaExtern::WriteContextSvIdl( rBase, rOutStm, nTab ); sal_uLong n; - for( n = 0; n < aTypeList.Count(); n++ ) + for( n = 0; n < aTypeList.size(); n++ ) { WriteTab( rOutStm, nTab ); - aTypeList.GetObject( n )->WriteSvIdl( rBase, rOutStm, nTab ); + aTypeList[n]->WriteSvIdl( rBase, rOutStm, nTab ); } rOutStm << endl; - for( n = 0; n < aAttrList.Count(); n++ ) + for( n = 0; n < aAttrList.size(); n++ ) { WriteTab( rOutStm, nTab ); - aAttrList.GetObject( n )->WriteSvIdl( rBase, rOutStm, nTab ); + aAttrList[n]->WriteSvIdl( rBase, rOutStm, nTab ); } rOutStm << endl; - for( n = 0; n < aClassList.Count(); n++ ) + for( n = 0; n < aClassList.size(); n++ ) { WriteTab( rOutStm, nTab ); - aClassList.GetObject( n )->WriteSvIdl( rBase, rOutStm, nTab ); + aClassList[n]->WriteSvIdl( rBase, rOutStm, nTab ); } } @@ -368,9 +368,9 @@ void SvMetaModule::WriteSvIdl( SvIdlDataBase & rBase, SvStream & rOutStm, void SvMetaModule::WriteSfx( SvIdlDataBase & rBase, SvStream & rOutStm ) { - for( sal_uLong n = 0; n < aClassList.Count(); n++ ) + for( sal_uLong n = 0; n < aClassList.size(); n++ ) { - SvMetaClass * pClass = aClassList.GetObject( n ); + SvMetaClass * pClass = aClassList[n]; pClass->WriteSfx( rBase, rOutStm ); } } @@ -378,9 +378,9 @@ void SvMetaModule::WriteSfx( SvIdlDataBase & rBase, SvStream & rOutStm ) void SvMetaModule::WriteHelpIds( SvIdlDataBase & rBase, SvStream & rOutStm, HelpIdTable& rTable ) { - for( sal_uLong n = 0; n < aClassList.Count(); n++ ) + for( sal_uLong n = 0; n < aClassList.size(); n++ ) { - SvMetaClass * pClass = aClassList.GetObject( n ); + SvMetaClass * pClass = aClassList[n]; pClass->WriteHelpIds( rBase, rOutStm, rTable ); } } @@ -422,15 +422,15 @@ void SvMetaModule::Write( SvIdlDataBase & rBase, SvStream & rOutStm, WriteTab( rOutStm, nTab ); rOutStm << "importlib(\"STDOLE.TLB\");" << endl; - for( sal_uLong n = 0; n < aClassList.Count(); n++ ) + for( sal_uLong n = 0; n < aClassList.size(); n++ ) { - SvMetaClass * pClass = aClassList.GetObject( n ); + SvMetaClass * pClass = aClassList[n]; if( !pClass->IsShell() && pClass->GetAutomation() ) { WriteTab( rOutStm, nTab ); WriteStars( rOutStm ); pClass->Write( rBase, rOutStm, nTab +1, nT, nA ); - if( n +1 < aClassList.Count() ) + if( n +1 < aClassList.size() ) rOutStm << endl; } } @@ -446,9 +446,9 @@ void SvMetaModule::Write( SvIdlDataBase & rBase, SvStream & rOutStm, rOutStm << "</MODULE>" << endl << endl; rOutStm << "<CLASSES>" << endl; - for( sal_uLong n = 0; n < aClassList.Count(); n++ ) + for( sal_uLong n = 0; n < aClassList.size(); n++ ) { - SvMetaClass * pClass = aClassList.GetObject( n ); + SvMetaClass * pClass = aClassList[n]; if( !pClass->IsShell() ) { rOutStm << pClass->GetName().getString().getStr(); @@ -458,16 +458,16 @@ void SvMetaModule::Write( SvIdlDataBase & rBase, SvStream & rOutStm, // imported classes const SvClassElementMemberList& rClassList = pClass->GetClassList(); - if ( rClassList.Count() ) + if ( !rClassList.empty() ) { rOutStm << " ( "; - for( sal_uLong m=0; m<rClassList.Count(); ++m ) + for( sal_uLong m=0; m<rClassList.size(); ++m ) { - SvClassElement *pEle = rClassList.GetObject(m); + SvClassElement *pEle = rClassList[m]; SvMetaClass *pCl = pEle->GetClass(); rOutStm << pCl->GetName().getString().getStr(); - if ( m+1 == rClassList.Count() ) + if ( m+1 == rClassList.size() ) rOutStm << " )"; else rOutStm << " , "; @@ -484,9 +484,9 @@ void SvMetaModule::Write( SvIdlDataBase & rBase, SvStream & rOutStm, case WRITE_C_SOURCE: case WRITE_C_HEADER: { - for( sal_uLong n = 0; n < aClassList.Count(); n++ ) + for( sal_uLong n = 0; n < aClassList.size(); n++ ) { - SvMetaClass * pClass = aClassList.GetObject( n ); + SvMetaClass * pClass = aClassList[n]; if( !pClass->IsShell() ) pClass->Write( rBase, rOutStm, nTab, nT, nA ); } diff --git a/idl/source/objects/object.cxx b/idl/source/objects/object.cxx index e26e1dd05419..953886d97974 100644 --- a/idl/source/objects/object.cxx +++ b/idl/source/objects/object.cxx @@ -109,9 +109,9 @@ void SvMetaClass::Save( SvPersistStream & rStm ) // create mask sal_uInt8 nMask = 0; - if( aAttrList.Count() ) nMask |= 0x1; + if( !aAttrList.empty() ) nMask |= 0x1; if( aSuperClass.Is() ) nMask |= 0x2; - if( aClassList.Count() ) nMask |= 0x4; + if( !aClassList.empty() ) nMask |= 0x4; if( xAutomationInterface.Is() ) nMask |= 0x8; if( aAutomation.IsSet() ) nMask |= 0x10; @@ -162,7 +162,7 @@ void SvMetaClass::ReadContextSvIdl( SvIdlDataBase & rBase, { SvClassElementRef xEle = new SvClassElement(); xEle->SetClass( pClass ); - aClassList.Append( xEle ); + aClassList.push_back( xEle ); if( rInStm.Read( '[' ) ) { @@ -241,7 +241,7 @@ void SvMetaClass::ReadContextSvIdl( SvIdlDataBase & rBase, aI.SetValue( rBase.GetUniqueId() ); xAttr->SetSlotId( aI ); } - aAttrList.Append( xAttr ); + aAttrList.push_back( xAttr ); return; } } @@ -256,15 +256,15 @@ void SvMetaClass::WriteContextSvIdl ) { sal_uLong n; - for( n = 0; n < aAttrList.Count(); n++ ) + for( n = 0; n < aAttrList.size(); n++ ) { WriteTab( rOutStm, nTab ); - aAttrList.GetObject( n )->WriteSvIdl( rBase, rOutStm, nTab ); + aAttrList[n]->WriteSvIdl( rBase, rOutStm, nTab ); rOutStm << ';' << endl; } - for( n = 0; n < aClassList.Count(); n++ ) + for( n = 0; n < aClassList.size(); n++ ) { - SvClassElement * pEle = aClassList.GetObject( n ); + SvClassElement * pEle = aClassList[n]; WriteTab( rOutStm, nTab ); rOutStm << SvHash_import()->GetName().getStr() << ' ' << pEle->GetPrefix().getStr(); @@ -316,9 +316,9 @@ sal_Bool SvMetaClass::TestAttribute( SvIdlDataBase & rBase, SvTokenStream & rInS OSL_FAIL( rAttr.GetSlotId().getString().getStr() ); } - for( sal_uLong n = 0; n < aAttrList.Count(); n++ ) + for( sal_uLong n = 0; n < aAttrList.size(); n++ ) { - SvMetaAttribute * pS = aAttrList.GetObject( n ); + SvMetaAttribute * pS = aAttrList[n]; if( pS->GetName().getString() == rAttr.GetName().getString() ) { // values have to match @@ -407,9 +407,9 @@ void SvMetaClass::Write( SvIdlDataBase & rBase, SvStream & rOutStm, // write all attributes sal_uLong n; - for( n = 0; n < aAttrList.Count(); n++ ) + for( n = 0; n < aAttrList.size(); n++ ) { - SvMetaAttribute * pAttr = aAttrList.GetObject( n ); + SvMetaAttribute * pAttr = aAttrList[n]; if( !pAttr->GetHidden() ) { if( pAttr->IsMethod() ) @@ -473,9 +473,9 @@ void SvMetaClass::InsertSlots( SvSlotElementList& rList, std::vector<sal_uLong>& // write all direct attributes sal_uLong n; - for( n = 0; n < aAttrList.Count(); n++ ) + for( n = 0; n < aAttrList.size(); n++ ) { - SvMetaAttribute * pAttr = aAttrList.GetObject( n ); + SvMetaAttribute * pAttr = aAttrList[n]; sal_uLong nId = pAttr->GetSlotId().GetValue(); @@ -500,9 +500,9 @@ void SvMetaClass::InsertSlots( SvSlotElementList& rList, std::vector<sal_uLong>& // Write all attributes of the imported classes, as long as they have // not already been imported by the superclass. - for( n = 0; n < aClassList.Count(); n++ ) + for( n = 0; n < aClassList.size(); n++ ) { - SvClassElement * pEle = aClassList.GetObject( n ); + SvClassElement * pEle = aClassList[n]; SvMetaClass * pCl = pEle->GetClass(); rtl::OStringBuffer rPre(rPrefix); if( rPre.getLength() && pEle->GetPrefix().getLength() ) @@ -531,9 +531,9 @@ void SvMetaClass::FillClasses( SvMetaClassList & rList ) rList.push_back( this ); // my imports - for( sal_uInt32 n = 0; n < aClassList.Count(); n++ ) + for( sal_uInt32 n = 0; n < aClassList.size(); n++ ) { - SvClassElement * pEle = aClassList.GetObject( n ); + SvClassElement * pEle = aClassList[n]; SvMetaClass * pCl = pEle->GetClass(); pCl->FillClasses( rList ); } @@ -645,9 +645,9 @@ void SvMetaClass::WriteSfx( SvIdlDataBase & rBase, SvStream & rOutStm ) void SvMetaClass::WriteHelpIds( SvIdlDataBase & rBase, SvStream & rOutStm, HelpIdTable& rTable ) { - for( sal_uLong n=0; n<aAttrList.Count(); n++ ) + for( sal_uLong n=0; n<aAttrList.size(); n++ ) { - SvMetaAttribute * pAttr = aAttrList.GetObject( n ); + SvMetaAttribute * pAttr = aAttrList[n]; pAttr->WriteHelpId( rBase, rOutStm, rTable ); } } diff --git a/idl/source/objects/slot.cxx b/idl/source/objects/slot.cxx index e0ed2d372f7d..e55712eb6423 100644 --- a/idl/source/objects/slot.cxx +++ b/idl/source/objects/slot.cxx @@ -1013,9 +1013,9 @@ void SvMetaSlot::Insert( SvSlotElementList& rList, const rtl::OString& rPrefix, rtl::OString aSId = aBuf.makeStringAndClear(); xEnumSlot = NULL; - for( m=0; m<rBase.GetAttrList().Count(); m++ ) + for( m=0; m<rBase.GetAttrList().size(); m++ ) { - SvMetaAttribute * pAttr = rBase.GetAttrList().GetObject( m ); + SvMetaAttribute * pAttr = rBase.GetAttrList()[m]; if (aSId.equals(pAttr->GetSlotId().getString())) { SvMetaSlot* pSlot = PTR_CAST( SvMetaSlot, pAttr ); @@ -1024,7 +1024,7 @@ void SvMetaSlot::Insert( SvSlotElementList& rList, const rtl::OString& rPrefix, } } - if ( m == rBase.GetAttrList().Count() ) + if ( m == rBase.GetAttrList().size() ) { OSL_FAIL("Invalid EnumSlot!"); xEnumSlot = Clone(); @@ -1347,7 +1347,7 @@ void SvMetaSlot::WriteSlot( const rtl::OString& rShellName, sal_uInt16 nCount, { rOutStm << pT->GetName().getString().getStr(); if( !rBase.FindType( pT, rBase.aUsedTypes ) ) - rBase.aUsedTypes.Append( pT ); + rBase.aUsedTypes.push_back( pT ); } else rOutStm << "SfxVoidItem not defined"; @@ -1356,7 +1356,7 @@ void SvMetaSlot::WriteSlot( const rtl::OString& rShellName, sal_uInt16 nCount, { SvMetaType *pT = rBase.FindType( "SfxBoolItem" ); if ( pT && !rBase.FindType( pT, rBase.aUsedTypes ) ) - rBase.aUsedTypes.Append( pT ); + rBase.aUsedTypes.push_back( pT ); } if( !bIsEnumSlot ) @@ -1436,13 +1436,13 @@ sal_uInt16 SvMetaSlot::WriteSlotParamArray( SvIdlDataBase & rBase, SvStream & rO pType = GetType(); if( !rBase.FindType( pType, rBase.aUsedTypes ) ) - rBase.aUsedTypes.Append( pType ); + rBase.aUsedTypes.push_back( pType ); const SvMetaAttributeMemberList & rList = pType->GetAttrList(); - for( sal_uLong n = 0; n < rList.Count(); n++ ) + for( sal_uLong n = 0; n < rList.size(); n++ ) { - SvMetaAttribute * pPar = rList.GetObject( n ); + SvMetaAttribute * pPar = rList[n]; SvMetaType * pPType = pPar->GetType(); WriteTab( rOutStm, 1 ); rOutStm << "SFX_ARGUMENT(" @@ -1452,9 +1452,9 @@ sal_uInt16 SvMetaSlot::WriteSlotParamArray( SvIdlDataBase & rBase, SvStream & rO // item name << pPType->GetName().getString().getStr() << ")," << endl; if( !rBase.FindType( pPType, rBase.aUsedTypes ) ) - rBase.aUsedTypes.Append( pPType ); + rBase.aUsedTypes.push_back( pPType ); } - return (sal_uInt16)rList.Count(); + return (sal_uInt16)rList.size(); } return 0; } @@ -1624,15 +1624,16 @@ void SvMetaSlot::WriteCSV( SvIdlDataBase& rBase, SvStream& rStrm ) if ( GetMethod() ) pList = &GetMethod()->GetType()->GetAttrList(); - if( pList && pList->Count() ) + if( pList && !pList->empty() ) { rStrm << "\"("; - SvMetaAttribute* pAttr = pList->First(); - while( pAttr ) + SvMetaAttributeMemberList::const_iterator it = pList->begin(); + while( it != pList->end() ) { + SvMetaAttribute* pAttr = *it; pAttr->WriteCSV( rBase, rStrm ); - pAttr = pList->Next(); - if( pAttr ) + ++it; + if( it != pList->end() ) rStrm << ','; } rStrm << ")\""; diff --git a/idl/source/objects/types.cxx b/idl/source/objects/types.cxx index 16e559a6940a..9186857fe81f 100644 --- a/idl/source/objects/types.cxx +++ b/idl/source/objects/types.cxx @@ -334,10 +334,10 @@ void SvMetaAttribute::WriteParam( SvIdlDataBase & rBase, if( pBaseType->GetType() == TYPE_STRUCT ) { const SvMetaAttributeMemberList & rList = pBaseType->GetAttrList(); - sal_uLong nCount = rList.Count(); + sal_uLong nCount = rList.size(); for( sal_uLong i = 0; i < nCount; i++ ) { - rList.GetObject( i )->WriteParam( rBase, rOutStm, nTab, nT ); + rList[i]->WriteParam( rBase, rOutStm, nTab, nT ); if( i+1<nCount ) { rOutStm << ','; @@ -505,7 +505,7 @@ void SvMetaAttribute::WriteRecursiv_Impl( SvIdlDataBase & rBase, WriteType nT, WriteAttribute nA ) { const SvMetaAttributeMemberList & rList = GetType()->GetBaseType()->GetAttrList(); - sal_uLong nCount = rList.Count(); + sal_uLong nCount = rList.size(); SvNumberIdentifier slotId = rBase.aStructSlotId; if ( !GetSlotId().getString().isEmpty() ) @@ -517,7 +517,7 @@ void SvMetaAttribute::WriteRecursiv_Impl( SvIdlDataBase & rBase, for( sal_uLong i = 0; i < nCount; i++ ) { - SvMetaAttribute *pAttr = rList.GetObject( i ); + SvMetaAttribute *pAttr = rList[i]; if ( nT == WRITE_DOCU ) pAttr->SetDescription( GetDescription().getString() ); pAttr->Write( rBase, rOutStm, nTab, nT, nA ); @@ -1130,15 +1130,16 @@ void SvMetaType::WriteContext( SvIdlDataBase & rBase, SvStream & rOutStm, { if( GetAttrCount() ) { - SvMetaAttribute * pAttr = pAttrList->First(); - while( pAttr ) + SvMetaAttributeMemberList::const_iterator it = pAttrList->begin(); + while( it != pAttrList->end() ) { + SvMetaAttribute * pAttr = *it; pAttr->Write( rBase, rOutStm, nTab, nT, nA ); if( GetType() == TYPE_METHOD ) rOutStm << ',' << endl; else rOutStm << ';' << endl; - pAttr = pAttrList->Next(); + ++it; } } } @@ -1337,7 +1338,7 @@ void SvMetaType::ReadContextSvIdl( SvIdlDataBase & rBase, if( xAttr->ReadSvIdl( rBase, rInStm ) ) { if( xAttr->Test( rBase, rInStm ) ) - GetAttrList().Append( xAttr ); + GetAttrList().push_back( xAttr ); } } @@ -1350,16 +1351,17 @@ void SvMetaType::WriteContextSvIdl { if( GetAttrCount() ) { - SvMetaAttribute * pAttr = pAttrList->First(); - while( pAttr ) + SvMetaAttributeMemberList::const_iterator it = pAttrList->begin(); + while( it != pAttrList->end() ) { + SvMetaAttribute * pAttr = *it; WriteTab( rOutStm, nTab ); pAttr->WriteSvIdl( rBase, rOutStm, nTab ); if( GetType() == TYPE_METHOD ) rOutStm << ',' << endl; else rOutStm << ';' << endl; - pAttr = pAttrList->Next(); + ++it; } } } @@ -1381,7 +1383,7 @@ sal_uLong SvMetaType::MakeSfx( rtl::OStringBuffer& rAttrArray ) // write the single attributes for( sal_uLong n = 0; n < nAttrCount; n++ ) { - nC += pAttrList->GetObject( n )->MakeSfx( rAttrArray ); + nC += (*pAttrList)[n]->MakeSfx( rAttrArray ); if( n +1 < nAttrCount ) rAttrArray.append(", "); } @@ -1467,13 +1469,14 @@ void SvMetaType::WriteMethodArgs WriteTab( rOutStm, nTab ); rOutStm << '(' << endl; - SvMetaAttribute * pAttr = pAttrList->First(); - while( pAttr ) + SvMetaAttributeMemberList::const_iterator it = pAttrList->begin(); + while( it != pAttrList->end() ) { + SvMetaAttribute * pAttr = *it; WriteTab( rOutStm, nTab +1 ); pAttr->WriteSvIdl( rBase, rOutStm, nTab +1 ); - pAttr = pAttrList->Next(); - if( pAttr ) + ++it; + if( it != pAttrList->end() ) rOutStm << ',' << endl; } rOutStm << endl; @@ -1489,12 +1492,13 @@ void SvMetaType::WriteMethodArgs rOutStm << '('; if( GetAttrCount() ) { - SvMetaAttribute * pAttr = pAttrList->First(); - while( pAttr ) + SvMetaAttributeMemberList::const_iterator it = pAttrList->begin(); + while( it != pAttrList->end() ) { + SvMetaAttribute * pAttr = *it; pAttr->WriteParam( rBase, rOutStm, nTab+1, nT ); - pAttr = pAttrList->Next(); - if( pAttr ) + ++it; + if( it != pAttrList->end() ) rOutStm << ','; else rOutStm << ' '; @@ -1517,9 +1521,10 @@ void SvMetaType::WriteMethodArgs if( GetAttrCount() ) { rOutStm << endl; - SvMetaAttribute * pAttr = pAttrList->First(); - while( pAttr ) + SvMetaAttributeMemberList::const_iterator it = pAttrList->begin(); + while( it != pAttrList->end() ) { + SvMetaAttribute* pAttr = *it; switch( nT ) { case WRITE_C_HEADER: @@ -1535,8 +1540,8 @@ void SvMetaType::WriteMethodArgs DBG_ASSERT( sal_False, "WriteType not implemented" ); } } - pAttr = pAttrList->Next(); - if( pAttr ) + ++it; + if( it != pAttrList->end() ) rOutStm << ',' << endl; } if( nT != WRITE_C_HEADER && nT != WRITE_C_SOURCE ) @@ -1685,7 +1690,7 @@ rtl::OString SvMetaType::GetParserString() const // write the single attributes for( sal_uLong n = 0; n < nAttrCount; n++ ) { - SvMetaAttribute * pT = pAttrList->GetObject( n ); + SvMetaAttribute * pT = (*pAttrList)[n]; aPStr += pT->GetType()->GetParserString(); } } @@ -1711,7 +1716,7 @@ void SvMetaType::WriteParamNames( SvIdlDataBase & rBase, // write the single attributes for( sal_uLong n = 0; n < nAttrCount; n++ ) { - SvMetaAttribute * pA = pAttrList->GetObject( n ); + SvMetaAttribute * pA = (*pAttrList)[n]; rtl::OString aStr = pA->GetName().getString(); pA->GetType()->WriteParamNames( rBase, rOutStm, aStr ); if( n +1 < nAttrCount ) @@ -1822,7 +1827,7 @@ void SvMetaTypeEnum::Save( SvPersistStream & rStm ) // create mask sal_uInt8 nMask = 0; - if( aEnumValueList.Count() ) nMask |= 0x01; + if( !aEnumValueList.empty() ) nMask |= 0x01; if( !aPrefix.isEmpty() ) nMask |= 0x02; // write data @@ -1856,7 +1861,7 @@ void SvMetaTypeEnum::ReadContextSvIdl( SvIdlDataBase & rBase, sal_Bool bOk = aEnumVal->ReadSvIdl( rBase, rInStm ); if( bOk ) { - if( 0 == aEnumValueList.Count() ) + if( aEnumValueList.empty() ) { // the first aPrefix = aEnumVal->GetName().getString(); @@ -1865,7 +1870,7 @@ void SvMetaTypeEnum::ReadContextSvIdl( SvIdlDataBase & rBase, { aPrefix = getCommonSubPrefix(aPrefix, aEnumVal->GetName().getString()); } - aEnumValueList.Append( aEnumVal ); + aEnumValueList.push_back( aEnumVal ); } if( !bOk ) rInStm.Seek( nTokPos ); @@ -1876,10 +1881,10 @@ void SvMetaTypeEnum::WriteContextSvIdl( SvIdlDataBase & rBase, sal_uInt16 nTab ) { WriteTab( rOutStm, nTab +1 ); - for( sal_uLong n = 0; n < aEnumValueList.Count(); n++ ) + for( sal_uLong n = 0; n < aEnumValueList.size(); n++ ) { - aEnumValueList.GetObject( n )->WriteSvIdl( rBase, rOutStm, nTab ); - if( n +1 != aEnumValueList.Count() ) + aEnumValueList[n]->WriteSvIdl( rBase, rOutStm, nTab ); + if( n + 1 != aEnumValueList.size() ) rOutStm << ", "; else rOutStm << endl; @@ -1921,11 +1926,11 @@ void SvMetaTypeEnum::WriteContext( SvIdlDataBase & rBase, SvStream & rOutStm, WriteType nT, WriteAttribute nA ) { WriteTab( rOutStm, nTab +1 ); - for( sal_uLong n = 0; n < aEnumValueList.Count(); n++ ) + for( sal_uLong n = 0; n < aEnumValueList.size(); n++ ) { - aEnumValueList.GetObject( n )->Write( rBase, rOutStm, nTab +1, nT, nA ); + aEnumValueList[n]->Write( rBase, rOutStm, nTab +1, nT, nA ); - if( n +1 != aEnumValueList.Count() ) + if( n + 1 != aEnumValueList.size() ) { if( 2 == n % 3 ) { @@ -1987,8 +1992,8 @@ rtl::OString SvMetaAttribute::Compare( SvMetaAttribute* pAttr ) { for ( sal_uInt16 n=0; n<nCount; n++ ) { - SvMetaAttribute *pAttr1 = rList.GetObject(n); - SvMetaAttribute *pAttr2 = rOtherList.GetObject(n); + SvMetaAttribute *pAttr1 = rList[n]; + SvMetaAttribute *pAttr2 = rOtherList[n]; pAttr1->Compare( pAttr2 ); } } |