diff options
Diffstat (limited to 'idl/source/prj/database.cxx')
-rwxr-xr-x[-rw-r--r--] | idl/source/prj/database.cxx | 197 |
1 files changed, 99 insertions, 98 deletions
diff --git a/idl/source/prj/database.cxx b/idl/source/prj/database.cxx index 06e7e2d7c69c..dd199ea4261d 100644..100755 --- a/idl/source/prj/database.cxx +++ b/idl/source/prj/database.cxx @@ -44,7 +44,7 @@ *************************************************************************/ /* void PrimeNumber(){ - USHORT i, n; + sal_uInt16 i, n; for( i = 5001; i < 5500; i += 2 ){ for( n = 2; n < i && ((i % n) != 0); n++ ); if( n == i ){ @@ -56,10 +56,10 @@ void PrimeNumber(){ */ SvIdlDataBase::SvIdlDataBase( const SvCommand& rCmd ) - : bExport( FALSE ) + : bExport( sal_False ) , nUniqueId( 0 ) , nVerbosity( rCmd.nVerbosity ) - , bIsModified( FALSE ) + , bIsModified( sal_False ) , aPersStream( *IDLAPP->pClassMgr, NULL ) , pIdTable( NULL ) { @@ -111,8 +111,9 @@ SvMetaTypeMemberList & SvIdlDataBase::GetTypeList() ADD_TYPE( double, "double", 'F', "double", "Double", "#" ); ADD_TYPE( SbxObject, "VARIANT", 'o', "C_Object", "Object", "" ); + // A c h t u n g !!!, bei hinzufuegen von Typen werden alle - // binren Datenbasen inkompatibel + // bin�ren Datenbasen inkompatibel /* // So tun als ob die Init-Daten auf einem Stream gelesen wurden @@ -138,7 +139,7 @@ SvMetaTypeMemberList & SvIdlDataBase::GetTypeList() *************************************************************************/ SvMetaModule * SvIdlDataBase::GetModule( const ByteString & rName ) { - for( ULONG n = 0; n < aModuleList.Count(); n++ ) + for( sal_uLong n = 0; n < aModuleList.Count(); n++ ) if( aModuleList.GetObject( n )->GetName() == rName ) return aModuleList.GetObject( n ); return NULL; @@ -151,12 +152,12 @@ SvMetaModule * SvIdlDataBase::GetModule( const ByteString & rName ) |* Beschreibung |* *************************************************************************/ -#define DATABASE_SIGNATURE (UINT32)0x13B799F2 +#define DATABASE_SIGNATURE (sal_uInt32)0x13B799F2 #define DATABASE_VER 0x0006 -BOOL SvIdlDataBase::IsBinaryFormat( SvStream & rStm ) +sal_Bool SvIdlDataBase::IsBinaryFormat( SvStream & rStm ) { - UINT32 nSig = 0; - ULONG nPos = rStm.Tell(); + sal_uInt32 nSig = 0; + sal_uLong nPos = rStm.Tell(); rStm >> nSig; rStm.Seek( nPos ); @@ -175,8 +176,8 @@ void SvIdlDataBase::Load( SvStream & rStm ) DBG_ASSERT( aTypeList.Count() == 0, "type list already initialized" ); SvPersistStream aPStm( *IDLAPP->pClassMgr, &rStm ); - USHORT nVersion = 0; - UINT32 nSig = 0; + sal_uInt16 nVersion = 0; + sal_uInt32 nSig = 0; aPStm >> nSig; aPStm >> nVersion; @@ -205,22 +206,22 @@ void SvIdlDataBase::Load( SvStream & rStm ) |* |* Beschreibung *************************************************************************/ -void SvIdlDataBase::Save( SvStream & rStm, UINT32 nFlags ) +void SvIdlDataBase::Save( SvStream & rStm, sal_uInt32 nFlags ) { SvPersistStream aPStm( *IDLAPP->pClassMgr, &rStm ); aPStm.SetContextFlags( nFlags ); - aPStm << (UINT32)DATABASE_SIGNATURE; - aPStm << (USHORT)DATABASE_VER; + aPStm << (sal_uInt32)DATABASE_SIGNATURE; + aPStm << (sal_uInt16)DATABASE_VER; - BOOL bOnlyStreamedObjs = FALSE; + sal_Bool bOnlyStreamedObjs = sal_False; if( nFlags & IDL_WRITE_CALLING ) - bOnlyStreamedObjs = TRUE; + bOnlyStreamedObjs = sal_True; if( bOnlyStreamedObjs ) { SvMetaClassMemberList aList; - for( ULONG n = 0; n < GetModuleList().Count(); n++ ) + for( sal_uLong n = 0; n < GetModuleList().Count(); n++ ) { SvMetaModule * pModule = GetModuleList().GetObject( n ); if( !pModule->IsImported() ) @@ -274,18 +275,18 @@ void SvIdlDataBase::Push( SvMetaObject * pObj ) |* Beschreibung |* *************************************************************************/ -BOOL SvIdlDataBase::FindId( const ByteString & rIdName, ULONG * pVal ) +sal_Bool SvIdlDataBase::FindId( const ByteString & rIdName, sal_uLong * pVal ) { if( pIdTable ) { - UINT32 nHash; + sal_uInt32 nHash; if( pIdTable->Test( rIdName, &nHash ) ) { *pVal = pIdTable->Get( nHash )->GetValue(); - return TRUE; + return sal_True; } } - return FALSE; + return sal_False; } /************************************************************************* @@ -295,18 +296,18 @@ BOOL SvIdlDataBase::FindId( const ByteString & rIdName, ULONG * pVal ) |* Beschreibung |* *************************************************************************/ -BOOL SvIdlDataBase::InsertId( const ByteString & rIdName, ULONG nVal ) +sal_Bool SvIdlDataBase::InsertId( const ByteString & rIdName, sal_uLong nVal ) { if( !pIdTable ) pIdTable = new SvStringHashTable( 20003 ); - UINT32 nHash; + sal_uInt32 nHash; if( pIdTable->Insert( rIdName, &nHash ) ) { pIdTable->Get( nHash )->SetValue( nVal ); - return TRUE; + return sal_True; } - return FALSE; + return sal_False; } /************************************************************************* @@ -314,7 +315,7 @@ BOOL SvIdlDataBase::InsertId( const ByteString & rIdName, ULONG nVal ) |* |* Beschreibung *************************************************************************/ -BOOL SvIdlDataBase::ReadIdFile( const String & rFileName ) +sal_Bool SvIdlDataBase::ReadIdFile( const String & rFileName ) { DirEntry aFullName( rFileName ); aFullName.Find( GetPath() ); @@ -323,7 +324,7 @@ BOOL SvIdlDataBase::ReadIdFile( const String & rFileName ) while( pIdFile ) { if( *pIdFile == rFileName ) - return TRUE; // schon eingelesen + return sal_True; // schon eingelesen pIdFile = aIdFileList.Next(); } @@ -351,21 +352,21 @@ BOOL SvIdlDataBase::ReadIdFile( const String & rFileName ) // Fehler setzen SetError( aStr, pTok ); WriteError( aTokStm ); - return FALSE; + return sal_False; } - ULONG nVal = 0; - BOOL bOk = TRUE; + sal_uLong nVal = 0; + sal_Bool bOk = sal_True; while( bOk ) { pTok = aTokStm.GetToken_Next(); if( pTok->IsIdentifier() ) { - ULONG n; + sal_uLong n; if( FindId( pTok->GetString(), &n ) ) nVal += n; else - bOk = FALSE; + bOk = sal_False; } else if( pTok->IsChar() ) { @@ -383,7 +384,7 @@ BOOL SvIdlDataBase::ReadIdFile( const String & rFileName ) // Fehler setzen SetError( aStr, pTok ); WriteError( aTokStm ); - return FALSE; + return sal_False; } if( pTok->GetChar() != '+' && pTok->GetChar() != '(' @@ -406,7 +407,7 @@ BOOL SvIdlDataBase::ReadIdFile( const String & rFileName ) ByteString aStr = "hash table overflow: "; SetError( aStr, pTok ); WriteError( aTokStm ); - return FALSE; + return sal_False; } } } @@ -431,7 +432,7 @@ BOOL SvIdlDataBase::ReadIdFile( const String & rFileName ) // Fehler setzen SetError( aStr, pTok ); WriteError( aTokStm ); - return FALSE; + return sal_False; } } if( !ReadIdFile( String::CreateFromAscii(aName.GetBuffer()) ) ) @@ -440,7 +441,7 @@ BOOL SvIdlDataBase::ReadIdFile( const String & rFileName ) aStr += aName; SetError( aStr, pTok ); WriteError( aTokStm ); - return FALSE; + return sal_False; } } } @@ -449,8 +450,8 @@ BOOL SvIdlDataBase::ReadIdFile( const String & rFileName ) } } else - return FALSE; - return TRUE; + return sal_False; + return sal_True; } /************************************************************************* @@ -482,39 +483,39 @@ SvMetaType * SvIdlDataBase::FindType( const ByteString & rName ) *************************************************************************/ SvMetaType * SvIdlDataBase::ReadKnownType( SvTokenStream & rInStm ) { - BOOL bIn = FALSE; - BOOL bOut = FALSE; + sal_Bool bIn = sal_False; + sal_Bool bOut = sal_False; int nCall0 = CALL_VALUE; int nCall1 = CALL_VALUE; - BOOL bSet = FALSE; //irgent ein Attribut gesetzt + sal_Bool bSet = sal_False; //irgent ein Attribut gesetzt - UINT32 nTokPos = rInStm.Tell(); + sal_uInt32 nTokPos = rInStm.Tell(); SvToken * pTok = rInStm.GetToken_Next(); if( pTok->HasHash() ) { - UINT32 nBeginPos = 0; // kann mit Tell nicht vorkommen + sal_uInt32 nBeginPos = 0; // kann mit Tell nicht vorkommen while( nBeginPos != rInStm.Tell() ) { nBeginPos = rInStm.Tell(); if( pTok->Is( SvHash_in() ) ) { - bIn = TRUE; + bIn = sal_True; pTok = rInStm.GetToken_Next(); - bSet = TRUE; + bSet = sal_True; } if( pTok->Is( SvHash_out() ) ) { - bOut = TRUE; + bOut = sal_True; pTok = rInStm.GetToken_Next(); - bSet = TRUE; + bSet = sal_True; } if( pTok->Is( SvHash_inout() ) ) { - bIn = TRUE; - bOut = TRUE; + bIn = sal_True; + bOut = sal_True; pTok = rInStm.GetToken_Next(); - bSet = TRUE; + bSet = sal_True; } } } @@ -550,7 +551,7 @@ SvMetaType * SvIdlDataBase::ReadKnownType( SvTokenStream & rInStm ) CALL_POINTER; rInStm.GetToken_Next(); } - bSet = TRUE; + bSet = sal_True; } } /* @@ -602,7 +603,7 @@ SvMetaAttribute * SvIdlDataBase::ReadKnownAttr noch gelesen werden. */ ) { - UINT32 nTokPos = rInStm.Tell(); + sal_uInt32 nTokPos = rInStm.Tell(); if( !pType ) pType = ReadKnownType( rInStm ); @@ -614,7 +615,7 @@ SvMetaAttribute * SvIdlDataBase::ReadKnownAttr /* SvToken * pTok = rInStm.GetToken_Next(); if( pTok->IsIdentifier() ) - for( ULONG n = 0; n < aAttrList.Count(); n++ ) + for( sal_uLong n = 0; n < aAttrList.Count(); n++ ) { SvMetaAttribute * pAttr = aAttrList.GetObject( n ); if( pAttr->GetName() == pTok->GetString() ) @@ -628,10 +629,10 @@ SvMetaAttribute * SvIdlDataBase::ReadKnownAttr SvToken * pTok = rInStm.GetToken_Next(); if( pTok->IsIdentifier() ) { - ULONG n; + sal_uLong n; if( FindId( pTok->GetString(), &n ) ) { - for( ULONG i = 0; i < aAttrList.Count(); i++ ) + for( sal_uLong i = 0; i < aAttrList.Count(); i++ ) { SvMetaAttribute * pAttr = aAttrList.GetObject( i ); if( pAttr->GetSlotId() == pTok->GetString() ) @@ -654,10 +655,10 @@ SvMetaAttribute* SvIdlDataBase::SearchKnownAttr const SvNumberIdentifier& rId ) { - ULONG n; + sal_uLong n; if( FindId( rId, &n ) ) { - for( ULONG i = 0; i < aAttrList.Count(); i++ ) + for( sal_uLong i = 0; i < aAttrList.Count(); i++ ) { SvMetaAttribute * pAttr = aAttrList.GetObject( i ); if( pAttr->GetSlotId() == rId ) @@ -675,11 +676,11 @@ SvMetaAttribute* SvIdlDataBase::SearchKnownAttr *************************************************************************/ SvMetaClass * SvIdlDataBase::ReadKnownClass( SvTokenStream & rInStm ) { - UINT32 nTokPos = rInStm.Tell(); + sal_uInt32 nTokPos = rInStm.Tell(); SvToken * pTok = rInStm.GetToken_Next(); if( pTok->IsIdentifier() ) - for( ULONG n = 0; n < aClassList.Count(); n++ ) + for( sal_uLong n = 0; n < aClassList.Count(); n++ ) { SvMetaClass * pClass = aClassList.GetObject( n ); if( pClass->GetName() == pTok->GetString() ) @@ -709,7 +710,7 @@ void SvIdlDataBase::Write( const ByteString & rText ) void SvIdlDataBase::WriteError( const ByteString & rErrWrn, const ByteString & rFileName, const ByteString & rErrorText, - ULONG nRow, ULONG nColumn ) const + sal_uLong nRow, sal_uLong nColumn ) const { //Fehlerbehandlung fprintf( stderr, "\n%s --- %s: ( %ld, %ld )\n", @@ -731,7 +732,7 @@ void SvIdlDataBase::WriteError( SvTokenStream & rInStm ) //Fehlerbehandlung String aFileName( rInStm.GetFileName() ); ByteString aErrorText; - ULONG nRow = 0, nColumn = 0; + sal_uLong nRow = 0, nColumn = 0; rInStm.SeekEnd(); SvToken *pTok = rInStm.GetToken(); @@ -805,11 +806,11 @@ SvIdlWorkingBase::SvIdlWorkingBase(const SvCommand& rCmd) : SvIdlDataBase(rCmd) |* |* Beschreibung *************************************************************************/ -BOOL SvIdlWorkingBase::ReadSvIdl( SvTokenStream & rInStm, BOOL bImported, const String & rPath ) +sal_Bool SvIdlWorkingBase::ReadSvIdl( SvTokenStream & rInStm, sal_Bool bImported, const String & rPath ) { aPath = rPath; // nur fuer den durchlauf gueltig SvToken * pTok; - BOOL bOk = TRUE; + sal_Bool bOk = sal_True; pTok = rInStm.GetToken(); // nur ein import ganz am Anfang if( pTok->Is( SvHash_import() ) ) @@ -833,34 +834,34 @@ BOOL SvIdlWorkingBase::ReadSvIdl( SvTokenStream & rInStm, BOOL bImported, const aStr += ByteString( aFullName.GetFull(), RTL_TEXTENCODING_UTF8 ); SetError( aStr, pTok ); WriteError( rInStm ); - bOk = FALSE; + bOk = sal_False; } else { aStm.Seek( 0 ); aStm.ResetError(); SvTokenStream aTokStm( aStm, aFullName.GetFull() ); - bOk = ReadSvIdl( aTokStm, TRUE, rPath ); + bOk = ReadSvIdl( aTokStm, sal_True, rPath ); } } } else - bOk = FALSE; + bOk = sal_False; } else - bOk = FALSE; + bOk = sal_False; } - UINT32 nBeginPos = 0xFFFFFFFF; // kann mit Tell nicht vorkommen + sal_uInt32 nBeginPos = 0xFFFFFFFF; // kann mit Tell nicht vorkommen while( bOk && nBeginPos != rInStm.Tell() ) { nBeginPos = rInStm.Tell(); pTok = rInStm.GetToken(); if( pTok->IsEof() ) - return TRUE; + return sal_True; if( pTok->IsEmpty() ) - bOk = FALSE; + bOk = sal_False; // nur ein import ganz am Anfang /*else */if( pTok->Is( SvHash_module() ) ) @@ -869,18 +870,18 @@ BOOL SvIdlWorkingBase::ReadSvIdl( SvTokenStream & rInStm, BOOL bImported, const if( aModule->ReadSvIdl( *this, rInStm ) ) GetModuleList().Append( aModule ); else - bOk = FALSE; + bOk = sal_False; } else - bOk = FALSE; + bOk = sal_False; } if( !bOk || !pTok->IsEof() ) { //Fehlerbehandlung WriteError( rInStm ); - return FALSE; + return sal_False; } - return TRUE; + return sal_True; } /************************************************************************* @@ -888,10 +889,10 @@ BOOL SvIdlWorkingBase::ReadSvIdl( SvTokenStream & rInStm, BOOL bImported, const |* |* Beschreibung *************************************************************************/ -BOOL SvIdlWorkingBase::WriteSvIdl( SvStream & rOutStm ) +sal_Bool SvIdlWorkingBase::WriteSvIdl( SvStream & rOutStm ) { if( rOutStm.GetError() != SVSTREAM_OK ) - return FALSE; + return sal_False; SvStringHashList aList; if( GetIdTable() ) @@ -909,13 +910,13 @@ BOOL SvIdlWorkingBase::WriteSvIdl( SvStream & rOutStm ) } } - for( ULONG n = 0; n < GetModuleList().Count(); n++ ) + for( sal_uLong n = 0; n < GetModuleList().Count(); n++ ) { SvMetaModule * pModule = GetModuleList().GetObject( n ); //if( !pModule->IsImported() ) pModule->WriteSvIdl( *this, rOutStm, 0 ); } - return TRUE; + return sal_True; } /************************************************************************* @@ -923,15 +924,15 @@ BOOL SvIdlWorkingBase::WriteSvIdl( SvStream & rOutStm ) |* |* Beschreibung *************************************************************************/ -BOOL SvIdlWorkingBase::WriteSfx( SvStream & rOutStm ) +sal_Bool SvIdlWorkingBase::WriteSfx( SvStream & rOutStm ) { if( rOutStm.GetError() != SVSTREAM_OK ) - return FALSE; + return sal_False; // alle Tmp-Variablen fuer das Schreiben zuruecksetzen WriteReset(); SvMemoryStream aTmpStm( 256000, 256000 ); - ULONG n; + sal_uLong n; for( n = 0; n < GetModuleList().Count(); n++ ) { SvMetaModule * pModule = GetModuleList().GetObject( n ); @@ -946,16 +947,16 @@ BOOL SvIdlWorkingBase::WriteSfx( SvStream & rOutStm ) } aUsedTypes.Clear(); rOutStm << aTmpStm; - return TRUE; + return sal_True; } -BOOL SvIdlWorkingBase::WriteHelpIds( SvStream& rOutStm ) +sal_Bool SvIdlWorkingBase::WriteHelpIds( SvStream& rOutStm ) { if( rOutStm.GetError() != SVSTREAM_OK ) - return FALSE; + return sal_False; Table aIdTable; - ULONG n; + sal_uLong n; for( n = 0; n < GetModuleList().Count(); n++ ) { SvMetaModule * pModule = GetModuleList().GetObject( n ); @@ -970,7 +971,7 @@ BOOL SvIdlWorkingBase::WriteHelpIds( SvStream& rOutStm ) pAttr->WriteHelpId( *this, rOutStm, &aIdTable ); } - return TRUE; + return sal_True; } /************************************************************************* @@ -978,9 +979,9 @@ BOOL SvIdlWorkingBase::WriteHelpIds( SvStream& rOutStm ) |* |* Beschreibung *************************************************************************/ -BOOL SvIdlWorkingBase::WriteSfxItem( SvStream & ) +sal_Bool SvIdlWorkingBase::WriteSfxItem( SvStream & ) { - return FALSE; + return sal_False; } void SvIdlDataBase::StartNewFile( const String& rName ) @@ -992,14 +993,14 @@ void SvIdlDataBase::AppendAttr( SvMetaAttribute *pAttr ) { aAttrList.Append( pAttr ); if ( bExport ) - pAttr->SetNewAttribute( TRUE ); + pAttr->SetNewAttribute( sal_True ); } -BOOL SvIdlWorkingBase::WriteCSV( SvStream& rStrm ) +sal_Bool SvIdlWorkingBase::WriteCSV( SvStream& rStrm ) { SvMetaAttributeMemberList &rList = GetAttrList(); - ULONG nCount = rList.Count(); - for ( ULONG n=0; n<nCount; n++ ) + sal_uLong nCount = rList.Count(); + for ( sal_uLong n=0; n<nCount; n++ ) { if ( rList.GetObject(n)->IsNewAttribute() ) { @@ -1008,9 +1009,9 @@ BOOL SvIdlWorkingBase::WriteCSV( SvStream& rStrm ) } if ( rStrm.GetError() != SVSTREAM_OK ) - return FALSE; + return sal_False; else - return TRUE; + return sal_True; } /************************************************************************* @@ -1018,18 +1019,18 @@ BOOL SvIdlWorkingBase::WriteCSV( SvStream& rStrm ) |* |* Beschreibung *************************************************************************/ -BOOL SvIdlWorkingBase::WriteDocumentation( SvStream & rOutStm ) +sal_Bool SvIdlWorkingBase::WriteDocumentation( SvStream & rOutStm ) { if( rOutStm.GetError() != SVSTREAM_OK ) - return FALSE; + return sal_False; - for( ULONG n = 0; n < GetModuleList().Count(); n++ ) + for( sal_uLong n = 0; n < GetModuleList().Count(); n++ ) { SvMetaModule * pModule = GetModuleList().GetObject( n ); if( !pModule->IsImported() ) pModule->Write( *this, rOutStm, 0, WRITE_DOCU ); } - return TRUE; + return sal_True; } |