summaryrefslogtreecommitdiff
path: root/basic
diff options
context:
space:
mode:
authorAugust Sodora <augsod@gmail.com>2011-11-18 01:53:30 -0500
committerAugust Sodora <augsod@gmail.com>2011-11-18 01:53:30 -0500
commit2edba1241274cc5eec1c9a5c440a15f8bda62aa6 (patch)
treeb4aa6fc3d5559b3d38af727a53e0e7556f8e5d11 /basic
parentc8f0503a1b2ab399468125288803d16802064c94 (diff)
sal_Bool to bool
Diffstat (limited to 'basic')
-rw-r--r--basic/source/comp/scanner.cxx53
-rw-r--r--basic/source/inc/scanner.hxx34
2 files changed, 44 insertions, 43 deletions
diff --git a/basic/source/comp/scanner.cxx b/basic/source/comp/scanner.cxx
index 3c2ec97d6174..5d1f36b74e86 100644
--- a/basic/source/comp/scanner.cxx
+++ b/basic/source/comp/scanner.cxx
@@ -80,14 +80,14 @@ void SbiScanner::GenError( SbError code )
{
if( GetSbData()->bBlockCompilerError )
{
- bAbort = sal_True;
+ bAbort = true;
return;
}
if( !bError && bErrors )
{
- sal_Bool bRes = sal_True;
+ bool bRes = true;
// report only one error per statement
- bError = sal_True;
+ bError = true;
if( pBasic )
{
// in case of EXPECTED or UNEXPECTED it always refers
@@ -114,14 +114,15 @@ void SbiScanner::GenError( SbError code )
// used by SbiTokenizer::MayBeLabel() to detect a label
-
-sal_Bool SbiScanner::DoesColonFollow()
+bool SbiScanner::DoesColonFollow()
{
if( pLine && *pLine == ':' )
{
- pLine++; nCol++; return sal_True;
+ pLine++; nCol++;
+ return true;
}
- else return sal_False;
+ else
+ return false;
}
// test for legal suffix
@@ -160,19 +161,19 @@ inline bool lclIsWhitespace( sal_Unicode cChar )
} // namespace
-sal_Bool SbiScanner::NextSym()
+bool SbiScanner::NextSym()
{
// memorize for the EOLN-case
sal_uInt16 nOldLine = nLine;
sal_uInt16 nOldCol1 = nCol1;
sal_uInt16 nOldCol2 = nCol2;
sal_Unicode buf[ BUF_SIZE ], *p = buf;
- bHash = sal_False;
+ bHash = false;
eScanType = SbxVARIANT;
aSym = ::rtl::OUString();
bSymbol =
- bNumber = bSpaces = sal_False;
+ bNumber = bSpaces = false;
// read in line?
if( !pLine )
@@ -180,7 +181,7 @@ sal_Bool SbiScanner::NextSym()
sal_Int32 n = nBufPos;
sal_Int32 nLen = aBuf.getLength();
if( nBufPos >= nLen )
- return sal_False;
+ return false;
const sal_Unicode* p2 = aBuf.getStr();
p2 += n;
while( ( n < nLen ) && ( *p2 != '\n' ) && ( *p2 != '\r' ) )
@@ -206,7 +207,7 @@ sal_Bool SbiScanner::NextSym()
while( lclIsWhitespace( *pLine ) )
- pLine++, nCol++, bSpaces = sal_True;
+ pLine++, nCol++, bSpaces = true;
nCol1 = nCol;
@@ -221,7 +222,7 @@ sal_Bool SbiScanner::NextSym()
{
pLine++;
nCol++;
- bHash = sal_True;
+ bHash = true;
}
// copy character if symbol
@@ -231,7 +232,7 @@ sal_Bool SbiScanner::NextSym()
if( *pLine == '_' && !*(pLine+1) )
{ pLine++;
goto eoln; }
- bSymbol = sal_True;
+ bSymbol = true;
short n = nCol;
for ( ; (BasicSimpleCharClass::isAlphaNumeric( *pLine, bCompatible ) || ( *pLine == '_' ) ); pLine++ )
nCol++;
@@ -296,13 +297,13 @@ sal_Bool SbiScanner::NextSym()
short ndig = 0;
short ncdig = 0;
eScanType = SbxDOUBLE;
- sal_Bool bBufOverflow = sal_False;
+ bool bBufOverflow = false;
while( strchr( "0123456789.DEde", *pLine ) && *pLine )
{
// from 4.1.1996: buffer full? -> go on scanning empty
if( (p-buf) == (BUF_SIZE-1) )
{
- bBufOverflow = sal_True;
+ bBufOverflow = true;
pLine++, nCol++;
continue;
}
@@ -337,7 +338,7 @@ sal_Bool SbiScanner::NextSym()
if (!exp) ndig++;
}
*p = 0;
- aSym = p; bNumber = sal_True;
+ aSym = p; bNumber = true;
if( comma > 1 || exp > 1 )
{ aError = '.';
@@ -390,10 +391,10 @@ sal_Bool SbiScanner::NextSym()
aSym = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("&"));
return SYMBOL;
}
- bNumber = sal_True;
+ bNumber = true;
long l = 0;
int i;
- sal_Bool bBufOverflow = sal_False;
+ bool bBufOverflow = false;
while( BasicSimpleCharClass::isAlphaNumeric( *pLine & 0xFF, bCompatible ) )
{
sal_Unicode ch = sal::static_int_cast< sal_Unicode >(
@@ -401,7 +402,7 @@ sal_Bool SbiScanner::NextSym()
pLine++; nCol++;
// from 4.1.1996: buffer full, go on scanning empty
if( (p-buf) == (BUF_SIZE-1) )
- bBufOverflow = sal_True;
+ bBufOverflow = true;
else if( String( cmp ).Search( ch ) != STRING_NOTFOUND )
//else if( strchr( cmp, ch ) )
*p++ = ch;
@@ -434,7 +435,7 @@ sal_Bool SbiScanner::NextSym()
{
sal_Unicode cSep = *pLine;
if( cSep == '[' )
- bSymbol = sal_True, cSep = ']';
+ bSymbol = true, cSep = ']';
short n = nCol+1;
while( *pLine )
{
@@ -489,15 +490,15 @@ PrevLineCommentLbl:
if( bPrevLineExtentsComment || (eScanType != SbxSTRING &&
( aSym[0] == '\'' || aSym.equalsIgnoreAsciiCaseAsciiL( RTL_CONSTASCII_STRINGPARAM("REM") ) ) ) )
{
- bPrevLineExtentsComment = sal_False;
+ bPrevLineExtentsComment = false;
aSym = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("REM"));
sal_uInt16 nLen = String( pLine ).Len();
if( bCompatible && pLine[ nLen - 1 ] == '_' && pLine[ nLen - 2 ] == ' ' )
- bPrevLineExtentsComment = sal_True;
+ bPrevLineExtentsComment = true;
nCol2 = nCol2 + nLen;
pLine = NULL;
}
- return sal_True;
+ return true;
eoln:
@@ -511,7 +512,7 @@ eoln:
// .Method
// ^^^ <- spaces is legal in MSO VBA
OSL_TRACE("*** resetting bSpaces***");
- bSpaces = sal_False;
+ bSpaces = false;
}
return bRes;
}
@@ -523,7 +524,7 @@ eoln:
nCol2 = nOldCol2;
aSym = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\n"));
nColLock = 0;
- return sal_True;
+ return true;
}
}
diff --git a/basic/source/inc/scanner.hxx b/basic/source/inc/scanner.hxx
index baba425925e1..c96387ebbe3e 100644
--- a/basic/source/inc/scanner.hxx
+++ b/basic/source/inc/scanner.hxx
@@ -59,17 +59,17 @@ protected:
sal_Int32 nBufPos;
sal_uInt16 nLine;
sal_uInt16 nCol1, nCol2;
- sal_Bool bSymbol; // sal_True: symbol scanned
- sal_Bool bNumber; // sal_True: number scanned
- sal_Bool bSpaces; // sal_True: whitespace before token
- sal_Bool bErrors; // sal_True: generate errors
- sal_Bool bAbort;
- sal_Bool bHash; // sal_True: # has been read in
- sal_Bool bError; // sal_True: generate error
- sal_Bool bUsedForHilite;
- sal_Bool bCompatible; // sal_True: OPTION compatible
- sal_Bool bVBASupportOn; // sal_True: OPTION VBASupport 1 otherwise default False
- sal_Bool bPrevLineExtentsComment; // sal_True: Previous line is comment and ends on "... _"
+ bool bSymbol; // sal_True: symbol scanned
+ bool bNumber; // sal_True: number scanned
+ bool bSpaces; // sal_True: whitespace before token
+ bool bErrors; // sal_True: generate errors
+ bool bAbort;
+ bool bHash; // sal_True: # has been read in
+ bool bError; // sal_True: generate error
+ bool bUsedForHilite;
+ bool bCompatible; // sal_True: OPTION compatible
+ bool bVBASupportOn; // sal_True: OPTION VBASupport 1 otherwise default False
+ bool bPrevLineExtentsComment; // sal_True: Previous line is comment and ends on "... _"
void GenError( SbError );
public:
@@ -77,12 +77,12 @@ public:
~SbiScanner();
void EnableErrors() { bError = sal_False; }
- sal_Bool IsHash() { return bHash; }
- sal_Bool IsCompatible() { return bCompatible; }
+ bool IsHash() { return bHash; }
+ bool IsCompatible() { return bCompatible; }
void SetCompatible( bool b ) { bCompatible = b; } // #118206
- sal_Bool IsVBASupportOn() { return bVBASupportOn; }
+ bool IsVBASupportOn() { return bVBASupportOn; }
void SetVBASupportOn( bool b ) { bVBASupportOn = b; }
- sal_Bool WhiteSpace() { return bSpaces; }
+ bool WhiteSpace() { return bSpaces; }
short GetErrors() { return nErrors; }
short GetLine() { return nLine; }
short GetCol1() { return nCol1; }
@@ -93,9 +93,9 @@ public:
void RestoreLine(void) { pLine = pSaveLine; }
void LockColumn();
void UnlockColumn();
- sal_Bool DoesColonFollow();
+ bool DoesColonFollow();
- sal_Bool NextSym();
+ bool NextSym();
const ::rtl::OUString& GetSym() { return aSym; }
SbxDataType GetType() { return eScanType; }
double GetDbl() { return nVal; }