diff options
author | Joseph Powers <jpowers27@cox.net> | 2010-12-28 18:25:01 -0800 |
---|---|---|
committer | Joseph Powers <jpowers27@cox.net> | 2010-12-31 06:57:20 -0800 |
commit | ef41521e87108f2f02e273d5bfc5fa912560436a (patch) | |
tree | 68dadd11716337a3359884b243529e68596e4d29 /idl | |
parent | 77957cd623217fcffae043eba428346226b7cf90 (diff) |
Remove DECLARE_LIST( ByteStringList, ByteString* )
I also removed some commented out code.
Diffstat (limited to 'idl')
-rw-r--r-- | idl/inc/command.hxx | 2 | ||||
-rw-r--r-- | idl/source/objects/object.cxx | 189 | ||||
-rw-r--r-- | idl/source/objects/slot.cxx | 24 | ||||
-rw-r--r-- | idl/source/prj/database.cxx | 52 |
4 files changed, 13 insertions, 254 deletions
diff --git a/idl/inc/command.hxx b/idl/inc/command.hxx index c2d6adfc60..8332569453 100644 --- a/idl/inc/command.hxx +++ b/idl/inc/command.hxx @@ -39,7 +39,7 @@ typedef ::std::vector< String* > StringList; #endif -DECLARE_LIST( ByteStringList, ByteString* ) +typedef ::std::vector< ByteString* > ByteStringList; /******************** class SvCommand ************************************/ class SvCommand diff --git a/idl/source/objects/object.cxx b/idl/source/objects/object.cxx index fb76ff10af..025338bdd7 100644 --- a/idl/source/objects/object.cxx +++ b/idl/source/objects/object.cxx @@ -167,73 +167,6 @@ void SvMetaClass::Save( SvPersistStream & rStm ) if( nMask & 0x10 ) rStm << aAutomation; } -/************************************************************************* -|* SvMetaClass::FillSbxObject() -|* -|* Beschreibung -*************************************************************************/ -/* -void SvMetaClass::FillSbxMemberObject( SvIdlDataBase & rBase, - SbxObject * pObj, - StringList & rSuperList, - BOOL bVariable ) -{ - // alle Attribute der Klasse schreiben - ULONG n ; - for( n = 0; n < aAttrList.Count(); n++ ) - { - SvMetaAttribute * pAttr = aAttrList.GetObject( n ); - - ByteString aMangleName = pAttr->GetMangleName( bVariable ); - ByteString * pS = SvIdlDataBase::FindName( aMangleName, rSuperList ); - - if( !pS && pAttr->GetExport() ) - { - // nicht doppelt - if( bVariable && pAttr->IsVariable() ) - { - rSuperList.Insert( new ByteString( aMangleName ), LIST_APPEND ); - pAttr->FillSbxObject( rBase, pObj, bVariable ); - } - else if( !bVariable && pAttr->IsMethod() ) - { - rSuperList.Insert( new ByteString( aMangleName ), LIST_APPEND ); - pAttr->FillSbxObject( rBase, pObj, bVariable ); - } - } - } - // alle Attribute der importierten Klassen schreiben - for( n = 0; n < aClassList.Count(); n++ ) - { - SvClassElement * pEle = aClassList.GetObject( n ); - SvMetaClass * pClass = pEle->GetClass(); - pClass->FillSbxMemberObject( rBase, pObj, rSuperList, bVariable ); - } - // alle Attribute der Superklassen schreiben - if( aSuperClass.Is() ) - aSuperClass->FillSbxMemberObject( rBase, pObj, rSuperList, bVariable ); -} -*/ -/************************************************************************* -|* SvMetaClass::FillSbxObject() -|* -|* Beschreibung -*************************************************************************/ -/* -void SvMetaClass::FillSbxObject( SvIdlDataBase & rBase, SbxObject * pObj ) -{ - StringList aSuperList; - FillSbxMemberObject( rBase, pObj, aSuperList, TRUE ); - FillSbxMemberObject( rBase, pObj, aSuperList, FALSE ); - - ByteString * pStr = aSuperList.First(); - while( pStr ) - { - delete pStr; - pStr = aSuperList.Next(); - } -} - */ #ifdef IDL_COMPILER /************************************************************************* |* SvMetaClass::ReadAttributesSvIdl() @@ -524,63 +457,6 @@ void SvMetaClass::WriteSvIdl( SvIdlDataBase & rBase, SvStream & rOutStm, } /************************************************************************* -|* SvMetaClass::WriteOdlMember() -|* -|* Beschreibung -*************************************************************************/ -/* -void SvMetaClass::WriteOdlMembers( ByteStringList & rSuperList, - BOOL bVariable, BOOL bWriteTab, - SvIdlDataBase & rBase, - SvStream & rOutStm, USHORT nTab ) -{ - // alle Attribute schreiben - ULONG n; - for( n = 0; n < aAttrList.Count(); n++ ) - { - SvMetaAttribute * pAttr = aAttrList.GetObject( n ); - - ByteString aMangleName = pAttr->GetMangleName( bVariable ); - ByteString * pS = rBase.FindName( aMangleName, rSuperList ); - - if( !pS && pAttr->GetExport() ) - { - // nicht doppelt - if( bVariable && pAttr->IsVariable() ) - { - rSuperList.Insert( new ByteString( aMangleName ), LIST_APPEND ); - pAttr->Write( rBase, rOutStm, nTab +1, WRITE_ODL, - WA_VARIABLE ); - rOutStm << ';' << endl; - } - else if( !bVariable && pAttr->IsMethod() ) - { - rSuperList.Insert( new ByteString( aMangleName ), LIST_APPEND ); - pAttr->Write( rBase, rOutStm, nTab +1, WRITE_ODL, - WA_METHOD ); - rOutStm << ';' << endl; - } - } - else - continue; - } - // alle Attribute der importierten Klassen schreiben - for( n = 0; n < aClassList.Count(); n++ ) - { - SvClassElement * pEle = aClassList.GetObject( n ); - SvMetaClass * pCl = pEle->GetClass(); - pCl->WriteOdlMembers( rSuperList, bVariable, bWriteTab, - rBase, rOutStm, nTab ); - } - // alle Attribute der Superklassen schreiben - SvMetaClass * pSC = aSuperClass; - if( pSC ) - pSC->WriteOdlMembers( rSuperList, bVariable, bWriteTab, - rBase, rOutStm, nTab ); -} - */ - -/************************************************************************* |* SvMetaClass::Write() |* |* Beschreibung @@ -595,53 +471,12 @@ void SvMetaClass::Write( SvIdlDataBase & rBase, SvStream & rOutStm, case WRITE_ODL: { DBG_ERROR( "Not supported anymore!" ); -/* - // Schreibt die Attribute - SvMetaName::Write( rBase, rOutStm, nTab, nT, nA ); - - WriteTab( rOutStm, nTab ); - rOutStm << "dispinterface " << GetName().GetBuffer() << endl; - WriteTab( rOutStm, nTab ); - rOutStm << '{' << endl; - - WriteTab( rOutStm, nTab ); - rOutStm << "properties:"; - rOutStm << endl; - - StringList aSuperList; - WriteOdlMembers( aSuperList, TRUE, TRUE, rBase, rOutStm, nTab ); - - WriteTab( rOutStm, nTab ); - rOutStm << "methods:"; - rOutStm << endl; - - WriteOdlMembers( aSuperList, FALSE, TRUE, rBase, rOutStm, nTab ); - - ByteString * pStr = aSuperList.First(); - while( pStr ) - { - delete pStr; - pStr = aSuperList.Next(); - } - - WriteTab( rOutStm, 1 ); - rOutStm << '}' << endl; - */ break; } case WRITE_C_SOURCE: case WRITE_C_HEADER: { DBG_ERROR( "Not supported anymore!" ); -/* - StringList aSuperList; - if( nT == WRITE_C_SOURCE ) - { - rOutStm << "#pragma code_seg (\"" << GetName().GetBuffer() - << "\",\"CODE\")" << endl; - } - WriteCFunctions( aSuperList, rBase, rOutStm, nTab, nT ); - */ break; } case WRITE_DOCU: @@ -847,20 +682,6 @@ void SvMetaClass::WriteSfx( SvIdlDataBase & rBase, SvStream & rOutStm ) rOutStm << "#undef " << GetName().GetBuffer() << endl; rOutStm << "#define ShellClass " << GetName().GetBuffer() << endl; -// rOutStm << "SFX_TYPELIB(" << GetName().GetBuffer() << ',' << endl -// << "\t/* library type */" -// << '"' << ByteString( GetModule()->GetUUId().GetHexName(), RTL_TEXTENCODING_UTF8 ).GetBuffer() << "\"," << endl -// << "\t\"" << GetModule()->GetTypeLibFileName().GetBuffer() << "\"," -// << ByteString::CreateFromInt32( GetModule()->GetVersion().GetMajorVersion() ).GetBuffer() << ',' -// << ByteString::CreateFromInt32( GetModule()->GetVersion().GetMinorVersion() ).GetBuffer() << ',' << endl -// << "\t/* shell type */" -// << '"'; -// if( xAutomationInterface.Is() ) -// rOutStm << ByteString( xAutomationInterface->GetUUId().GetHexName(), RTL_TEXTENCODING_UTF8 ).GetBuffer(); -// else -// rOutStm << ByteString( GetUUId().GetHexName(), RTL_TEXTENCODING_UTF8 ).GetBuffer(); -// rOutStm << "\");" << endl << endl; - // Fuer Interfaces werden kein Slotmaps geschrieben if( !IsShell() ) { @@ -868,7 +689,6 @@ void SvMetaClass::WriteSfx( SvIdlDataBase & rBase, SvStream & rOutStm ) return; } // Parameter Array schreiben - //rOutStm << "SfxArgList " << GetName().GetBuffer() << "ArgMap[] = {" << endl; rOutStm << "SFX_ARGUMENTMAP(" << GetName().GetBuffer() << ')' << endl << '{' << endl; @@ -900,12 +720,9 @@ void SvMetaClass::WriteSfx( SvIdlDataBase & rBase, SvStream & rOutStm ) ByteStringList aStringList; WriteSlotStubs( GetName(), aSlotList, aStringList, rOutStm ); - ByteString * pStr = aStringList.First(); - while( pStr ) - { - delete pStr; - pStr = aStringList.Next(); - } + for ( size_t i = 0, n = aStringList.size(); i < n; ++i ) + delete aStringList[ i ]; + aStringList.clear(); rOutStm << endl; diff --git a/idl/source/objects/slot.cxx b/idl/source/objects/slot.cxx index 2ebc6c1d6d..bff0efa183 100644 --- a/idl/source/objects/slot.cxx +++ b/idl/source/objects/slot.cxx @@ -1197,18 +1197,6 @@ void SvMetaSlot::WriteSlotStubs( const ByteString & rShellName, ByteStringList & rList, SvStream & rOutStm ) { -/* - ByteString aName = GetName(); - SvMetaAttribute * pAttr = rAttrList.First(); - while( pAttr ) - { - if( pAttr->GetName() == aName ) - break; - pAttr = rAttrList.Next(); - } - if( pAttr ) - return; -*/ if ( !GetExport() && !GetHidden() ) return; @@ -1216,9 +1204,9 @@ void SvMetaSlot::WriteSlotStubs( const ByteString & rShellName, if ( aMethodName.Len() && aMethodName != "NoExec" ) { BOOL bIn = FALSE; - for( USHORT n = 0; n < rList.Count(); n++ ) + for( size_t n = 0; n < rList.size(); n++ ) { - if( *(rList.GetObject(n)) == aMethodName ) + if( *(rList[ n ]) == aMethodName ) { bIn=TRUE; break; @@ -1227,7 +1215,7 @@ void SvMetaSlot::WriteSlotStubs( const ByteString & rShellName, if ( !bIn ) { - rList.Insert( new ByteString(aMethodName), LIST_APPEND ); + rList.push_back( new ByteString(aMethodName) ); rOutStm << "SFX_EXEC_STUB(" << rShellName.GetBuffer() << ',' @@ -1240,9 +1228,9 @@ void SvMetaSlot::WriteSlotStubs( const ByteString & rShellName, if ( aMethodName.Len() && aMethodName != "NoState" ) { BOOL bIn = FALSE; - for ( USHORT n=0; n < rList.Count(); n++ ) + for ( size_t n=0; n < rList.size(); n++ ) { - if ( *(rList.GetObject(n)) == aMethodName ) + if ( *(rList[ n ]) == aMethodName ) { bIn=TRUE; break; @@ -1251,7 +1239,7 @@ void SvMetaSlot::WriteSlotStubs( const ByteString & rShellName, if ( !bIn ) { - rList.Insert( new ByteString(aMethodName), LIST_APPEND ); + rList.push_back( new ByteString(aMethodName) ); rOutStm << "SFX_STATE_STUB(" << rShellName.GetBuffer() << ',' diff --git a/idl/source/prj/database.cxx b/idl/source/prj/database.cxx index fbdc9beb0a..649d1b3db3 100644 --- a/idl/source/prj/database.cxx +++ b/idl/source/prj/database.cxx @@ -43,19 +43,6 @@ |* |* Beschreibung *************************************************************************/ -/* -void PrimeNumber(){ - USHORT i, n; - for( i = 5001; i < 5500; i += 2 ){ - for( n = 2; n < i && ((i % n) != 0); n++ ); - if( n == i ){ - printf( "\nPrimzahl: %d\n", i ); - return; - } - } -} -*/ - SvIdlDataBase::SvIdlDataBase( const SvCommand& rCmd ) : bExport( FALSE ) , nUniqueId( 0 ) @@ -64,7 +51,6 @@ SvIdlDataBase::SvIdlDataBase( const SvCommand& rCmd ) , aPersStream( *IDLAPP->pClassMgr, NULL ) , pIdTable( NULL ) { - //PrimeNumber(); } /************************************************************************* @@ -513,10 +499,7 @@ SvMetaType * SvIdlDataBase::ReadKnownType( SvTokenStream & rInStm ) } } } -/* - SvMetaTypeList aTmpTypeList; - if( FillTypeList( aTmpTypeList, pTok ) ) -*/ + if( pTok->IsIdentifier() ) { ByteString aName = pTok->GetString(); @@ -548,21 +531,7 @@ SvMetaType * SvIdlDataBase::ReadKnownType( SvTokenStream & rInStm ) bSet = TRUE; } } - /* - SvMetaType * pMetaType = aTmpTypeList.First(); - while( pMetaType ) - { - if( pMetaType->GetIn() == bIn - && pMetaType->GetOut() == bOut - && pMetaType->GetCall0() == nCall0 - && pMetaType->GetCall1() == nCall1 ) - { - return pMetaType; - } - pMetaType = aTmpTypeList.Next(); - } - */ - //SvMetaType * pType = aTmpTypeList.First(); + if( !bSet ) // Ist genau dieser Typ return pType; @@ -602,22 +571,7 @@ SvMetaAttribute * SvIdlDataBase::ReadKnownAttr if( !pType ) pType = ReadKnownType( rInStm ); - if( pType ) - { - // Wenn wir Slots auf die Wiese stellen, d"urfen wir nicht voraussetzen, - // da\s jeder Slot einen anderen Namen hat! -/* - SvToken * pTok = rInStm.GetToken_Next(); - if( pTok->IsIdentifier() ) - for( ULONG n = 0; n < aAttrList.Count(); n++ ) - { - SvMetaAttribute * pAttr = aAttrList.GetObject( n ); - if( pAttr->GetName() == pTok->GetString() ) - return pAttr; - } -*/ - } - else + if( !pType ) { // sonst SlotId? SvToken * pTok = rInStm.GetToken_Next(); |