diff options
author | Xiaofei Zhang <Zhangxiaofei@openoffice.org> | 2010-07-29 10:56:19 +0800 |
---|---|---|
committer | Xiaofei Zhang <Zhangxiaofei@openoffice.org> | 2010-07-29 10:56:19 +0800 |
commit | d210c6ccc30466e98240c1409df0550514668d68 (patch) | |
tree | 0c94d52ecaebd283a92275cb372d5ddf926f5131 /tools/source/communi/parser.cxx | |
parent | 7f0993d43019a0ccb7f89c11fc23704c063b902f (diff) |
#i112600#: clean up l10ntools, rsc, sot, svl, tools and unotools
Diffstat (limited to 'tools/source/communi/parser.cxx')
-rw-r--r-- | tools/source/communi/parser.cxx | 56 |
1 files changed, 28 insertions, 28 deletions
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; |