diff options
Diffstat (limited to 'tools/source/communi')
-rw-r--r-- | tools/source/communi/geninfo.cxx | 70 | ||||
-rw-r--r-- | tools/source/communi/parser.cxx | 56 |
2 files changed, 63 insertions, 63 deletions
diff --git a/tools/source/communi/geninfo.cxx b/tools/source/communi/geninfo.cxx index 97326836de2d..01a325054a69 100644 --- a/tools/source/communi/geninfo.cxx +++ b/tools/source/communi/geninfo.cxx @@ -55,7 +55,7 @@ GenericInformation::GenericInformation( const ByteString &rKey, /*****************************************************************************/ GenericInformation::GenericInformation( const GenericInformation& rInf, - BOOL bCopySubs) + sal_Bool bCopySubs) /*****************************************************************************/ : ByteString( rInf ), sValue( rInf.sValue ), @@ -80,15 +80,15 @@ GenericInformation::~GenericInformation() } /*****************************************************************************/ -BOOL GenericInformation::InsertSubInfo( GenericInformation *pInfo ) +sal_Bool GenericInformation::InsertSubInfo( GenericInformation *pInfo ) /*****************************************************************************/ { return ( pInfoList && pInfoList->InsertInfo( pInfo )); } /*****************************************************************************/ -BOOL GenericInformation::InsertSubInfo( const ByteString &rPathKey, const ByteString &rValue, - BOOL bSearchByPath, BOOL bNewPath ) +sal_Bool GenericInformation::InsertSubInfo( const ByteString &rPathKey, const ByteString &rValue, + sal_Bool bSearchByPath, sal_Bool bNewPath ) /*****************************************************************************/ { return (pInfoList && pInfoList->InsertInfo( rPathKey, rValue, bSearchByPath, bNewPath )); @@ -96,14 +96,14 @@ BOOL GenericInformation::InsertSubInfo( const ByteString &rPathKey, const ByteSt /*****************************************************************************/ void GenericInformation::RemoveSubInfo( GenericInformation *pInfo, - BOOL bDelete ) + sal_Bool bDelete ) /*****************************************************************************/ { pInfoList->RemoveInfo( pInfo, bDelete ); } /*****************************************************************************/ -//void GenericInformation::RemoveSelf( BOOL bDelete ) +//void GenericInformation::RemoveSelf( sal_Bool bDelete ) /*****************************************************************************/ /*{ if ( pParent ) @@ -118,8 +118,8 @@ void GenericInformation::RemoveSubInfo( GenericInformation *pInfo, /*****************************************************************************/ GenericInformation *GenericInformation::GetSubInfo( ByteString &rKey, - BOOL bSearchByPath, - BOOL bCreatePath ) + sal_Bool bSearchByPath, + sal_Bool bCreatePath ) /*****************************************************************************/ { if ( !pInfoList && bCreatePath ) @@ -147,7 +147,7 @@ GenericInformationList::GenericInformationList(const GenericInformationList& rLi /*****************************************************************************/ : GenericInformationList_Impl() { - USHORT i; + sal_uInt16 i; GenericInformation* pTemp,*pWork; pOwner = pParent; @@ -155,7 +155,7 @@ GenericInformationList::GenericInformationList(const GenericInformationList& rLi for(i=0;i<rList.Count();i++) { pTemp = rList.GetObject(i); - pWork = new GenericInformation(*pTemp,TRUE); + pWork = new GenericInformation(*pTemp,sal_True); Insert(pWork,LIST_APPEND); } @@ -167,7 +167,7 @@ GenericInformationList::~GenericInformationList() { // delete all Informations stored in this List // ### GH: Hier werden dann wohl etwa die H�lfte der Eintr�ge gel�scht -/* for ( ULONG i = 0; i < Count(); i++ ) { +/* for ( sal_uIntPtr i = 0; i < Count(); i++ ) { GetObject( i )->ListDeleted(); delete GetObject( i ); Remove( i );*/ @@ -175,13 +175,13 @@ GenericInformationList::~GenericInformationList() while ( Count() ) { GetObject( 0 )->ListDeleted(); delete GetObject( 0 ); - Remove( (ULONG)0 ); + Remove( (sal_uIntPtr)0 ); } } /*****************************************************************************/ -GenericInformation *GenericInformationList::Search( ULONG &rPos, ByteString sKey, - ULONG nStart, ULONG nEnd ) +GenericInformation *GenericInformationList::Search( sal_uIntPtr &rPos, ByteString sKey, + sal_uIntPtr nStart, sal_uIntPtr nEnd ) /*****************************************************************************/ { if ( Count() == 0 ) { @@ -202,7 +202,7 @@ GenericInformation *GenericInformationList::Search( ULONG &rPos, ByteString sKey } // search binary in existing list - ULONG nActPos = nStart + (( nEnd - nStart ) / 2 ); + sal_uIntPtr nActPos = nStart + (( nEnd - nStart ) / 2 ); rPos = nActPos; ByteString sCandidate = ByteString( *GetObject( nActPos )); @@ -218,8 +218,8 @@ GenericInformation *GenericInformationList::Search( ULONG &rPos, ByteString sKey /*****************************************************************************/ GenericInformation *GenericInformationList::GetInfo( ByteString &rKey, - BOOL bSearchByPath, - BOOL bCreatePath ) + sal_Bool bSearchByPath, + sal_Bool bCreatePath ) /*****************************************************************************/ { @@ -232,7 +232,7 @@ GenericInformation *GenericInformationList::GetInfo( ByteString &rKey, else sKey = rKey; - ULONG nPos = 0; + sal_uIntPtr nPos = 0; GenericInformation *pReturnInfo = Search( nPos, sKey, 0, Count() - 1 ); /* wenn kein Searchpath gesetzt und kein Returninfo vorhanden, * gib NULL zurueck @@ -241,7 +241,7 @@ GenericInformation *GenericInformationList::GetInfo( ByteString &rKey, * wenn searchpath gesetzt kein returninfo vorhanden und newpath gesetzt, * mache neues Verzeichniss */ - USHORT nTokenCount = rKey.GetTokenCount('/'); + sal_uInt16 nTokenCount = rKey.GetTokenCount('/'); // search for next key of path in next level of tree if ( bSearchByPath && (nTokenCount > 1)) { ByteString sPath = ByteString(rKey.Copy( sKey.Len() + 1 )); @@ -251,7 +251,7 @@ GenericInformation *GenericInformationList::GetInfo( ByteString &rKey, pReturnInfo = new GenericInformation( sKey, "", this, NULL); pReturnInfo->SetSubList( new GenericInformationList( pReturnInfo )); } - return pReturnInfo->GetSubInfo( sPath, TRUE, bCreatePath ); + return pReturnInfo->GetSubInfo( sPath, sal_True, bCreatePath ); } if ( !pReturnInfo && bCreatePath ) { pReturnInfo = new GenericInformation ( sKey, "", this, NULL); @@ -261,9 +261,9 @@ GenericInformation *GenericInformationList::GetInfo( ByteString &rKey, } /*****************************************************************************/ -ULONG GenericInformationList::InsertSorted( GenericInformation *pInfo, - BOOL bOverwrite, - ULONG nStart, ULONG nEnd ) +sal_uIntPtr GenericInformationList::InsertSorted( GenericInformation *pInfo, + sal_Bool bOverwrite, + sal_uIntPtr nStart, sal_uIntPtr nEnd ) /*****************************************************************************/ { if ( Count() == 0 ) { @@ -292,11 +292,11 @@ ULONG GenericInformationList::InsertSorted( GenericInformation *pInfo, if ( sCandidate.ToUpperAscii() == sKey ) { // key allready exists in list if ( bOverwrite ) - Replace( pInfo, ULONG(0)); // ### Laut NF scheint hier ein Memory Leak zu sein + Replace( pInfo, sal_uIntPtr(0)); // ### Laut NF scheint hier ein Memory Leak zu sein return 0; } else if ( sCandidate > sKey ) { - Insert( pInfo, ULONG(0)); + Insert( pInfo, sal_uIntPtr(0)); return 0; } else { @@ -306,7 +306,7 @@ ULONG GenericInformationList::InsertSorted( GenericInformation *pInfo, } // ### GH: /ENDE/ dieser Block schein �berfl�ssig zu sein - ULONG nActPos = nStart + (( nEnd - nStart ) / 2 ); + sal_uIntPtr nActPos = nStart + (( nEnd - nStart ) / 2 ); ByteString sCandidate = ByteString( *GetObject( nActPos )); if ( sCandidate.ToUpperAscii() == sKey ) { @@ -348,21 +348,21 @@ ULONG GenericInformationList::InsertSorted( GenericInformation *pInfo, } /*****************************************************************************/ -BOOL GenericInformationList::InsertInfo( GenericInformation *pInfo, - BOOL bOverwrite ) +sal_Bool GenericInformationList::InsertInfo( GenericInformation *pInfo, + sal_Bool bOverwrite ) /*****************************************************************************/ { if ( !pInfo->Len()) - return FALSE; + return sal_False; InsertSorted( pInfo, bOverwrite, 0, Count() - 1 ); - return TRUE; + return sal_True; } /*****************************************************************************/ -BOOL GenericInformationList::InsertInfo( const ByteString &rPathKey, const ByteString &rValue, - BOOL bSearchByPath, BOOL bNewPath ) +sal_Bool GenericInformationList::InsertInfo( const ByteString &rPathKey, const ByteString &rValue, + sal_Bool bSearchByPath, sal_Bool bNewPath ) /*****************************************************************************/ { GenericInformation *pInfo; @@ -374,14 +374,14 @@ BOOL GenericInformationList::InsertInfo( const ByteString &rPathKey, const ByteS if ( pInfo ) { pInfo->SetValue( rValue ); - return TRUE; + return sal_True; } - return FALSE; + return sal_False; } /*****************************************************************************/ void GenericInformationList::RemoveInfo( GenericInformation *pInfo, - BOOL bDelete ) + sal_Bool bDelete ) /*****************************************************************************/ { Remove( pInfo ); diff --git a/tools/source/communi/parser.cxx b/tools/source/communi/parser.cxx index 20c2bb3ba059..f3baa37049e2 100644 --- a/tools/source/communi/parser.cxx +++ b/tools/source/communi/parser.cxx @@ -44,9 +44,9 @@ #define cKeyLevelChar '\t' /*****************************************************************************/ -InformationParser::InformationParser( BOOL bReplace ) +InformationParser::InformationParser( sal_Bool bReplace ) /*****************************************************************************/ - : bRecover( FALSE ), + : bRecover( sal_False ), sOldLine( "" ), bReplaceVariables( bReplace ), nLevel( 0 ), @@ -73,24 +73,24 @@ ByteString &InformationParser::ReadLine() ByteString sLine; if ( bRecover ) { - bRecover = FALSE; + bRecover = sal_False; } else { if ( !pActStream->IsEof()) { pActStream->ReadLine( sLine ); xub_StrLen nStart = 0; xub_StrLen nEnd = sLine.Len(); - BOOL bCopy = FALSE; + sal_Bool bCopy = sal_False; while ( nStart < nEnd && ( sLine.GetChar( nStart ) == ' ' || sLine.GetChar( nStart ) == 0x09 ) ) { nStart++; - bCopy = TRUE; + bCopy = sal_True; } while ( nStart < nEnd && ( sLine.GetChar( nEnd-1 ) == ' ' || sLine.GetChar( nEnd-1 ) == 0x09 ) ) { nEnd--; - bCopy = TRUE; + bCopy = sal_True; } if ( bCopy ) @@ -164,7 +164,7 @@ GenericInformation *InformationParser::ReadKey( sCurrentComment = ""; // key separated from value by tab? - USHORT nWSPos = sLine.Search( ' ' ); + sal_uInt16 nWSPos = sLine.Search( ' ' ); if ( sLine.Search( '\t' ) < nWSPos ) { nWSPos = sLine.Search( '\t' ); sLine.SearchAndReplace( "\t", " " ); @@ -213,17 +213,17 @@ GenericInformation *InformationParser::ReadKey( void InformationParser::Recover() /*****************************************************************************/ { - bRecover = TRUE; + bRecover = sal_True; } /*****************************************************************************/ -BOOL InformationParser::Save( SvStream &rOutStream, +sal_Bool InformationParser::Save( SvStream &rOutStream, const GenericInformationList *pSaveList, - USHORT level, BOOL bStripped ) + sal_uInt16 level, sal_Bool bStripped ) /*****************************************************************************/ { - USHORT i; - ULONG nInfoListCount; + sal_uInt16 i; + sal_uIntPtr nInfoListCount; ByteString sTmpStr; GenericInformation *pGenericInfo; GenericInformationList *pGenericInfoList; @@ -250,7 +250,7 @@ BOOL InformationParser::Save( SvStream &rOutStream, sTmpStr += ' '; sTmpStr += pGenericInfo->GetValue(); if ( !rOutStream.WriteLine( sTmpStr ) ) - return FALSE; + return sal_False; // wenn vorhanden, bearbeite recursive die Sublisten if (( pGenericInfoList = pGenericInfo->GetSubList() ) != NULL ) { @@ -260,20 +260,20 @@ BOOL InformationParser::Save( SvStream &rOutStream, sTmpStr.Append( aKeyLevel.GetBuffer(), level ); sTmpStr += '{'; if ( !rOutStream.WriteLine( sTmpStr ) ) - return FALSE; + return sal_False; // recursiv die sublist abarbeiten if ( !Save( rOutStream, pGenericInfoList, level+1, bStripped ) ) - return FALSE; + return sal_False; // schliessende Klammer sTmpStr = ""; if ( !bStripped && level ) sTmpStr.Append( aKeyLevel.GetBuffer(), level ); sTmpStr += '}'; if ( !rOutStream.WriteLine( sTmpStr ) ) - return FALSE; + return sal_False; } } - return TRUE; + return sal_True; } /*****************************************************************************/ @@ -373,7 +373,7 @@ GenericInformationList *InformationParser::Execute( Dir &rDir, else pList = new GenericInformationList(); - for ( USHORT i = 0; i < rDir.Count(); i++ ) { + for ( sal_uInt16 i = 0; i < rDir.Count(); i++ ) { // execute this dir UniString sNextFile( rDir[i].GetFull()); @@ -397,33 +397,33 @@ GenericInformationList *InformationParser::Execute( Dir &rDir, } /*****************************************************************************/ -BOOL InformationParser::Save( SvFileStream &rSourceStream, +sal_Bool InformationParser::Save( SvFileStream &rSourceStream, const GenericInformationList *pSaveList ) /*****************************************************************************/ { - if ( !rSourceStream.IsOpen() || !Save( (SvStream &)rSourceStream, pSaveList, 0, FALSE )) + if ( !rSourceStream.IsOpen() || !Save( (SvStream &)rSourceStream, pSaveList, 0, sal_False )) { printf( "ERROR saving file \"%s\"\n",ByteString( rSourceStream.GetFileName(), gsl_getSystemTextEncoding()).GetBuffer() ); - return FALSE; + return sal_False; } - return TRUE; + return sal_True; } /*****************************************************************************/ -BOOL InformationParser::Save( SvMemoryStream &rSourceStream, +sal_Bool InformationParser::Save( SvMemoryStream &rSourceStream, const GenericInformationList *pSaveList ) /*****************************************************************************/ { Time a; - BOOL bRet = Save( (SvStream &)rSourceStream, pSaveList, 0, TRUE ); + sal_Bool bRet = Save( (SvStream &)rSourceStream, pSaveList, 0, sal_True ); Time b; b = b - a; return bRet; } /*****************************************************************************/ -BOOL InformationParser::Save( const UniString &rSourceFile, +sal_Bool InformationParser::Save( const UniString &rSourceFile, const GenericInformationList *pSaveList ) /*****************************************************************************/ { @@ -431,14 +431,14 @@ BOOL InformationParser::Save( const UniString &rSourceFile, if ( !Save( *pOutFile, pSaveList )) { delete pOutFile; - return FALSE; + return sal_False; } delete pOutFile; - return TRUE; + return sal_True; } /*****************************************************************************/ -USHORT InformationParser::GetErrorCode() +sal_uInt16 InformationParser::GetErrorCode() /*****************************************************************************/ { return nErrorCode; |