diff options
author | Takeshi Abe <tabe@fixedpoint.jp> | 2012-08-12 09:07:20 +0900 |
---|---|---|
committer | Takeshi Abe <tabe@fixedpoint.jp> | 2012-08-12 09:16:58 +0900 |
commit | 1817cf60d1d5461b57b9b6fdb0b2849bb29389a8 (patch) | |
tree | be18508a066566569701a40d9dda51edd029b637 /basic/source | |
parent | c18c4f0547c5bdc388670af2f1501199c34ef540 (diff) |
sal_Bool to bool
Change-Id: I61a6675df622232923a827fc20bf121dd03cd7da
Diffstat (limited to 'basic/source')
-rw-r--r-- | basic/source/classes/image.cxx | 16 | ||||
-rw-r--r-- | basic/source/comp/exprnode.cxx | 18 | ||||
-rw-r--r-- | basic/source/comp/exprtree.cxx | 50 | ||||
-rw-r--r-- | basic/source/inc/expr.hxx | 10 | ||||
-rw-r--r-- | basic/source/inc/image.hxx | 4 | ||||
-rw-r--r-- | basic/source/inc/runtime.hxx | 2 | ||||
-rw-r--r-- | basic/source/inc/scanner.hxx | 20 | ||||
-rw-r--r-- | basic/source/runtime/runtime.cxx | 4 | ||||
-rw-r--r-- | basic/source/runtime/step0.cxx | 4 | ||||
-rw-r--r-- | basic/source/sbx/sbxbool.cxx | 4 |
10 files changed, 67 insertions, 65 deletions
diff --git a/basic/source/classes/image.cxx b/basic/source/classes/image.cxx index c511e443fea0..7b31f6b923d4 100644 --- a/basic/source/classes/image.cxx +++ b/basic/source/classes/image.cxx @@ -37,7 +37,7 @@ SbiImage::SbiImage() nLegacyCodeSize = nDimBase = 0; bInit = - bError = sal_False; + bError = false; bFirstInit = sal_True; eCharSet = osl_getThreadTextEncoding(); } @@ -63,7 +63,7 @@ void SbiImage::Clear() nCodeSize = 0; eCharSet = osl_getThreadTextEncoding(); nDimBase = 0; - bError = sal_False; + bError = false; } /************************************************************************** @@ -225,7 +225,7 @@ sal_Bool SbiImage::Load( SvStream& r, sal_uInt32& nVersion ) done: r.Seek( nLast ); if( !SbiGood( r ) ) - bError = sal_True; + bError = true; return sal_Bool( !bError ); } @@ -347,7 +347,7 @@ sal_Bool SbiImage::Save( SvStream& r, sal_uInt32 nVer ) // Set overall length SbiCloseRecord( r, nStart ); if( !SbiGood( r ) ) - bError = sal_True; + bError = true; return sal_Bool( !bError ); } @@ -372,7 +372,7 @@ void SbiImage::MakeStrings( short nSize ) memset( pStrings, 0, nStringSize * sizeof( sal_Unicode ) ); } else - bError = sal_True; + bError = true; } // Add a string to StringPool. The String buffer is dynamically @@ -380,13 +380,13 @@ void SbiImage::MakeStrings( short nSize ) void SbiImage::AddString( const String& r ) { if( nStringIdx >= nStrings ) - bError = sal_True; + bError = true; if( !bError ) { xub_StrLen len = r.Len() + 1; sal_uInt32 needed = nStringOff + len; if( needed > 0xFFFFFF00L ) - bError = sal_True; // out of mem! + bError = true; // out of mem! else if( needed > nStringSize ) { sal_uInt32 nNewLen = needed + 1024; @@ -402,7 +402,7 @@ void SbiImage::AddString( const String& r ) nStringSize = sal::static_int_cast< sal_uInt16 >(nNewLen); } else - bError = sal_True; + bError = true; } if( !bError ) { diff --git a/basic/source/comp/exprnode.cxx b/basic/source/comp/exprnode.cxx index 1ca35fcb1d74..8f1ca35a7584 100644 --- a/basic/source/comp/exprnode.cxx +++ b/basic/source/comp/exprnode.cxx @@ -103,7 +103,7 @@ void SbiExprNode::BaseInit( SbiParser* p ) pLeft = NULL; pRight = NULL; pWithParent = NULL; - bError = sal_False; + bError = false; } SbiExprNode::~SbiExprNode() @@ -224,12 +224,12 @@ void SbiExprNode::CollectBits() if( pLeft ) { pLeft->CollectBits(); - bError |= pLeft->bError; + bError = bError || pLeft->bError; } if( pRight ) { pRight->CollectBits(); - bError |= pRight->bError; + bError = bError || pRight->bError; } } @@ -296,7 +296,7 @@ void SbiExprNode::FoldConstants() break; default: pGen->GetParser()->Error( SbERR_CONVERSION ); - bError = sal_True; + bError = true; } } } @@ -323,7 +323,7 @@ void SbiExprNode::FoldConstants() if( err ) { pGen->GetParser()->Error( SbERR_MATH_OVERFLOW ); - bError = sal_True; + bError = true; } } sal_Bool bBothInt = sal_Bool( pLeft->eType < SbxSINGLE @@ -345,7 +345,7 @@ void SbiExprNode::FoldConstants() if( !nr ) { pGen->GetParser()->Error( SbERR_ZERODIV ); nVal = HUGE_VAL; - bError = sal_True; + bError = true; } else nVal = nl / nr; break; case PLUS: @@ -376,14 +376,14 @@ void SbiExprNode::FoldConstants() if( !lr ) { pGen->GetParser()->Error( SbERR_ZERODIV ); nVal = HUGE_VAL; - bError = sal_True; + bError = true; } else nVal = ll / lr; eType = SbxLONG; break; case MOD: if( !lr ) { pGen->GetParser()->Error( SbERR_ZERODIV ); nVal = HUGE_VAL; - bError = sal_True; + bError = true; } else nVal = llMod % lrMod; eType = SbxLONG; break; case AND: @@ -435,7 +435,7 @@ void SbiExprNode::FoldConstants() if( err ) { pGen->GetParser()->Error( SbERR_MATH_OVERFLOW ); - bError = sal_True; + bError = true; } nVal = (double) ~((long) nVal); eType = SbxLONG; diff --git a/basic/source/comp/exprtree.cxx b/basic/source/comp/exprtree.cxx index 267576afa5ce..053bf42f4780 100644 --- a/basic/source/comp/exprtree.cxx +++ b/basic/source/comp/exprtree.cxx @@ -32,7 +32,8 @@ SbiExpression::SbiExpression( SbiParser* p, SbiExprType t, SbiExprMode eMode, const KeywordSymbolInfo* pKeywordSymbolInfo ) { pParser = p; - bError = bByVal = bBased = bBracket = sal_False; + bError = false; + bByVal = bBased = bBracket = sal_False; nParenLevel = 0; eCurExpr = t; m_eMode = eMode; @@ -51,7 +52,8 @@ SbiExpression::SbiExpression( SbiParser* p, double n, SbxDataType t ) pParser = p; eCurExpr = SbOPERAND; pNext = NULL; - bError = bByVal = bBased = bBracket = sal_False; + bError = false; + bByVal = bBased = bBracket = sal_False; pExpr = new SbiExprNode( pParser, n, t ); pExpr->Optimize(); } @@ -60,7 +62,8 @@ SbiExpression::SbiExpression( SbiParser* p, const SbiSymDef& r, SbiExprList* pPa { pParser = p; pNext = NULL; - bError = bByVal = bBased = bBracket = sal_False; + bError = false; + bByVal = bBased = bBracket = sal_False; eCurExpr = SbOPERAND; pExpr = new SbiExprNode( pParser, r, SbxVARIANT, pPar ); } @@ -203,7 +206,7 @@ SbiExprNode* SbiExpression::Term( const KeywordSymbolInfo* pKeywordSymbolInfo ) else { pParser->Error( SbERR_SYNTAX ); - bError = sal_True; + bError = true; } } @@ -211,7 +214,7 @@ SbiExprNode* SbiExpression::Term( const KeywordSymbolInfo* pKeywordSymbolInfo ) { bool bStandaloneExpression = (m_eMode == EXPRMODE_STANDALONE); pPar = new SbiParameters( pParser, bStandaloneExpression ); - bError |= !pPar->IsValid(); + bError = bError || !pPar->IsValid(); if( !bError ) bBracket = pPar->IsBracket(); eTok = pParser->Peek(); @@ -223,7 +226,7 @@ SbiExprNode* SbiExpression::Term( const KeywordSymbolInfo* pKeywordSymbolInfo ) pvMoreParLcl = new SbiExprListVector(); SbiParameters* pAddPar = new SbiParameters( pParser ); pvMoreParLcl->push_back( pAddPar ); - bError |= !pAddPar->IsValid(); + bError = bError || !pAddPar->IsValid(); eTok = pParser->Peek(); } } @@ -241,7 +244,7 @@ SbiExprNode* SbiExpression::Term( const KeywordSymbolInfo* pKeywordSymbolInfo ) { // Name%. really does not work! pParser->Error( SbERR_BAD_DECLARATION, aSym ); - bError = sal_True; + bError = true; } } // Search: @@ -296,7 +299,7 @@ SbiExprNode* SbiExpression::Term( const KeywordSymbolInfo* pKeywordSymbolInfo ) { // How? Define with AS first and take a Suffix then? pParser->Error( SbERR_BAD_DECLARATION, aSym ); - bError = sal_True; + bError = true; } else if ( eType == SbxVARIANT ) // if there's nothing named, take the type of the entry, @@ -321,7 +324,7 @@ SbiExprNode* SbiExpression::Term( const KeywordSymbolInfo* pKeywordSymbolInfo ) else { pParser->Error( SbERR_BAD_DECLARATION, aSym ); - bError = sal_True; + bError = true; } } } @@ -343,7 +346,7 @@ SbiExprNode* SbiExpression::Term( const KeywordSymbolInfo* pKeywordSymbolInfo ) if ( !pParser->IsVBASupportOn() ) { pParser->Error( SbERR_BAD_DECLARATION, aSym ); - bError = sal_True; + bError = true; } } if( !bError ) @@ -369,7 +372,7 @@ SbiExprNode* SbiExpression::ObjTerm( SbiSymDef& rObj ) eTok != XOR && eTok != EQV && eTok != IMP && eTok != IS ) { pParser->Error( SbERR_VAR_EXPECTED ); - bError = sal_True; + bError = true; } } @@ -386,7 +389,7 @@ SbiExprNode* SbiExpression::ObjTerm( SbiSymDef& rObj ) { bool bStandaloneExpression = false; pPar = new SbiParameters( pParser, bStandaloneExpression ); - bError |= !pPar->IsValid(); + bError = bError || !pPar->IsValid(); eTok = pParser->Peek(); // i109624 check for additional sets of parameters @@ -396,7 +399,7 @@ SbiExprNode* SbiExpression::ObjTerm( SbiSymDef& rObj ) pvMoreParLcl = new SbiExprListVector(); SbiParameters* pAddPar = new SbiParameters( pParser ); pvMoreParLcl->push_back( pAddPar ); - bError |= !pPar->IsValid(); + bError = bError || !pPar->IsValid(); eTok = pParser->Peek(); } @@ -410,7 +413,7 @@ SbiExprNode* SbiExpression::ObjTerm( SbiSymDef& rObj ) { // Name%. does really not work! pParser->Error( SbERR_BAD_DECLARATION, aSym ); - bError = sal_True; + bError = true; } } @@ -435,7 +438,7 @@ SbiExprNode* SbiExpression::ObjTerm( SbiSymDef& rObj ) if( pDef->GetType() != SbxOBJECT ) { pParser->Error( SbERR_BAD_DECLARATION, aSym ); - bError = sal_True; + bError = true; } if( !bError ) { @@ -724,7 +727,7 @@ SbiExprNode* SbiExpression::Like() if( nCount > 1 && !pParser->IsVBASupportOn() ) { pParser->Error( SbERR_SYNTAX ); - bError = sal_True; + bError = true; } } return pNd; @@ -840,7 +843,7 @@ SbiExprList::SbiExprList( SbiParser* p ) pFirst = NULL; nExpr = nDim = 0; - bError = + bError = false; bBracket = sal_False; } @@ -1003,7 +1006,7 @@ SbiParameters::SbiParameters( SbiParser* p, sal_Bool bStandaloneExpression, sal_ else pLast->pNext = pExpr, pLast = pExpr; nExpr++; - bError |= !pExpr->IsValid(); + bError = bError || !pExpr->IsValid(); if( bAssumeArrayMode ) break; @@ -1017,7 +1020,7 @@ SbiParameters::SbiParameters( SbiParser* p, sal_Bool bStandaloneExpression, sal_ pParser->Error( bBracket ? SbERR_BAD_BRACKETS : SbERR_EXPECTED, COMMA ); - bError = sal_True; + bError = true; } else { @@ -1035,7 +1038,7 @@ SbiParameters::SbiParameters( SbiParser* p, sal_Bool bStandaloneExpression, sal_ if( !bBracket ) { pParser->Error( SbERR_BAD_BRACKETS ); - bError = sal_True; + bError = true; } } nDim = nExpr; @@ -1058,7 +1061,7 @@ SbiDimList::SbiDimList( SbiParser* p ) : SbiExprList( p ) if( pParser->Next() != LPAREN ) { pParser->Error( SbERR_EXPECTED, LPAREN ); - bError = sal_True; return; + bError = true; return; } if( pParser->Peek() != RPAREN ) @@ -1074,8 +1077,7 @@ SbiDimList::SbiDimList( SbiParser* p ) : SbiExprList( p ) pExpr2 = new SbiExpression( pParser ); eTok = pParser->Next(); bConst &= pExpr1->IsIntConstant() & pExpr2->IsIntConstant(); - bError |= !pExpr1->IsValid(); - bError |= !pExpr2->IsValid(); + bError = bError || !pExpr1->IsValid() || !pExpr2->IsValid(); pExpr1->pNext = pExpr2; if( !pLast ) pFirst = pExpr1; @@ -1089,7 +1091,7 @@ SbiDimList::SbiDimList( SbiParser* p ) : SbiExprList( p ) pExpr1->SetBased(); pExpr1->pNext = NULL; bConst &= pExpr1->IsIntConstant(); - bError |= !pExpr1->IsValid(); + bError = bError || !pExpr1->IsValid(); if( !pLast ) pFirst = pLast = pExpr1; else diff --git a/basic/source/inc/expr.hxx b/basic/source/inc/expr.hxx index 85804936c81b..4b10c14ab425 100644 --- a/basic/source/inc/expr.hxx +++ b/basic/source/inc/expr.hxx @@ -102,7 +102,7 @@ class SbiExprNode { // operators (and operands) SbiNodeType eNodeType; SbxDataType eType; SbiToken eTok; - sal_Bool bError; // sal_True: error + bool bError; // true: error void FoldConstants(); void CollectBits(); // converting numbers to strings sal_Bool IsOperand() @@ -125,7 +125,7 @@ public: SbiExprNode( SbiParser*, sal_uInt16 ); // new <type> virtual ~SbiExprNode(); - sal_Bool IsValid() { return sal_Bool( !bError ); } + bool IsValid() { return !bError; } sal_Bool IsConstant() // sal_True constant operand { return sal_Bool( eNodeType == SbxSTRVAL || eNodeType == SbxNUMVAL ); } sal_Bool IsIntConst(); @@ -163,7 +163,7 @@ protected: SbiExprType eCurExpr; // type of expression SbiExprMode m_eMode; // expression context sal_Bool bBased; // sal_True: easy DIM-part (+BASE) - sal_Bool bError; + bool bError; sal_Bool bByVal; // sal_True: ByVal-Parameter sal_Bool bBracket; // sal_True: Parameter list with brackets sal_uInt16 nParenLevel; @@ -225,13 +225,13 @@ protected: SbiExpression* pFirst; short nExpr; short nDim; - sal_Bool bError; + bool bError; sal_Bool bBracket; public: SbiExprList( SbiParser* ); virtual ~SbiExprList(); sal_Bool IsBracket() { return bBracket; } - sal_Bool IsValid() { return sal_Bool( !bError ); } + bool IsValid() { return !bError; } short GetSize() { return nExpr; } short GetDims() { return nDim; } SbiExpression* Get( short ); diff --git a/basic/source/inc/image.hxx b/basic/source/inc/image.hxx index ac3fd41d3ebd..f62ac2569b23 100644 --- a/basic/source/inc/image.hxx +++ b/basic/source/inc/image.hxx @@ -36,7 +36,7 @@ class SbiImage { sal_Unicode* pStrings; // StringPool char* pCode; // Code-Image char* pLegacyPCode; // Code-Image - sal_Bool bError; + bool bError; sal_uInt16 nFlags; short nStrings; sal_uInt32 nStringSize; @@ -68,7 +68,7 @@ public: // nVer is set to version // of image sal_Bool Save( SvStream&, sal_uInt32 = B_CURVERSION ); - sal_Bool IsError() { return bError; } + bool IsError() { return bError; } const char* GetCode() const { return pCode; } sal_uInt32 GetCodeSize() const { return nCodeSize; } diff --git a/basic/source/inc/runtime.hxx b/basic/source/inc/runtime.hxx index 1fe346deb1e1..dd6fa5205e75 100644 --- a/basic/source/inc/runtime.hxx +++ b/basic/source/inc/runtime.hxx @@ -264,7 +264,7 @@ class SbiRuntime // #74254, one refSaveObj is not enough! new: pRefSaveList (see above) short nArgc; sal_Bool bRun; - sal_Bool bError; // sal_True: handle errors + bool bError; // true: handle errors sal_Bool bInError; // sal_True: in an error handler sal_Bool bBlocked; // sal_True: blocked by next call level, #i48868 sal_Bool bVBAEnabled; diff --git a/basic/source/inc/scanner.hxx b/basic/source/inc/scanner.hxx index d0dd44a34af5..0697b10f5737 100644 --- a/basic/source/inc/scanner.hxx +++ b/basic/source/inc/scanner.hxx @@ -53,16 +53,16 @@ protected: sal_Int32 nBufPos; sal_Int32 nLine; sal_Int32 nCol1, nCol2; - 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 bSymbol; // true: symbol scanned + bool bNumber; // true: number scanned + bool bSpaces; // true: whitespace before token + bool bErrors; // true: generate errors bool bAbort; - bool bHash; // sal_True: # has been read in - bool bError; // sal_True: generate error - 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 "... _" + bool bHash; // true: # has been read in + bool bError; // true: generate error + bool bCompatible; // true: OPTION compatible + bool bVBASupportOn; // true: OPTION VBASupport 1 otherwise default False + bool bPrevLineExtentsComment; // true: Previous line is comment and ends on "... _" bool bInStatement; void GenError( SbError ); @@ -70,7 +70,7 @@ public: SbiScanner( const ::rtl::OUString&, StarBASIC* = NULL ); ~SbiScanner(); - void EnableErrors() { bError = sal_False; } + void EnableErrors() { bError = false; } bool IsHash() { return bHash; } bool IsCompatible() { return bCompatible; } void SetCompatible( bool b ) { bCompatible = b; } // #118206 diff --git a/basic/source/runtime/runtime.cxx b/basic/source/runtime/runtime.cxx index 27517b5f0dd7..32d0abb71954 100644 --- a/basic/source/runtime/runtime.cxx +++ b/basic/source/runtime/runtime.cxx @@ -526,7 +526,7 @@ SbiRuntime::SbiRuntime( SbModule* pm, SbMethod* pe, sal_uInt32 nStart ) pCode = pStmnt = (const sal_uInt8* ) pImg->GetCode() + nStart; bRun = - bError = sal_True; + bError = true; bInError = sal_False; bBlocked = sal_False; nLine = 0; @@ -775,7 +775,7 @@ sal_Bool SbiRuntime::Step() SbiRuntime* pRt = this; while( NULL != (pRt = pRt->pNext) ) { - if( pRt->bError == sal_False || pRt->pError != NULL ) + if( !pRt->bError || pRt->pError != NULL ) { pRtErrHdl = pRt; break; diff --git a/basic/source/runtime/step0.cxx b/basic/source/runtime/step0.cxx index 9a48a9beafbb..869ddcc32ca1 100644 --- a/basic/source/runtime/step0.cxx +++ b/basic/source/runtime/step0.cxx @@ -1242,7 +1242,7 @@ void SbiRuntime::StepENDCASE() void SbiRuntime::StepSTDERROR() { - pError = NULL; bError = sal_True; + pError = NULL; bError = true; pInst->aErrorMsg = String(); pInst->nErr = 0L; pInst->nErl = 0; @@ -1257,7 +1257,7 @@ void SbiRuntime::StepNOERROR() pInst->nErl = 0; nError = 0L; SbxErrObject::getUnoErrObject()->Clear(); - bError = sal_False; + bError = false; } // leave UP diff --git a/basic/source/sbx/sbxbool.cxx b/basic/source/sbx/sbxbool.cxx index 25f8624af037..c843f1689273 100644 --- a/basic/source/sbx/sbxbool.cxx +++ b/basic/source/sbx/sbxbool.cxx @@ -75,7 +75,7 @@ enum SbxBOOL ImpGetBool( const SbxValues* p ) else if( !p->pOUString->equalsIgnoreAsciiCase( SbxRes( STRING_FALSE ) ) ) { // it can be convertable to a number - sal_Bool bError = sal_True; + bool bError = true; double n; SbxDataType t; sal_uInt16 nLen = 0; @@ -83,7 +83,7 @@ enum SbxBOOL ImpGetBool( const SbxValues* p ) { if( nLen == p->pOUString->getLength() ) { - bError = sal_False; + bError = false; if( n != 0.0 ) nRes = SbxTRUE; } |