summaryrefslogtreecommitdiff
path: root/basic
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2014-01-14 18:06:04 +0100
committerStephan Bergmann <sbergman@redhat.com>2014-01-14 18:11:10 +0100
commit0d29aab156fb2eaf780fd152f0923b4850684846 (patch)
tree3761ece42e5b7aa25d73bb625fb9c441bc761fd7 /basic
parent1110840db78c2960b6848a9f336fe96b3a53b39b (diff)
bool improvements
Change-Id: Ic9ea40c430e0b0ab0d46bac3ba150ddac96c6acc
Diffstat (limited to 'basic')
-rw-r--r--basic/source/runtime/methods.cxx6
-rw-r--r--basic/source/runtime/runtime.cxx4
-rw-r--r--basic/source/sbx/sbxscan.cxx2
3 files changed, 6 insertions, 6 deletions
diff --git a/basic/source/runtime/methods.cxx b/basic/source/runtime/methods.cxx
index 86ae936e9f73..59514949b933 100644
--- a/basic/source/runtime/methods.cxx
+++ b/basic/source/runtime/methods.cxx
@@ -1643,16 +1643,16 @@ RTLFUNC(StrComp)
const OUString& rStr2 = rPar.Get(2)->GetOUString();
SbiInstance* pInst = GetSbData()->pInst;
- sal_Int16 nTextCompare;
+ bool nTextCompare;
bool bCompatibility = ( pInst && pInst->IsCompatibility() );
if( bCompatibility )
{
SbiRuntime* pRT = pInst->pRun;
- nTextCompare = pRT ? pRT->GetImageFlag( SBIMG_COMPARETEXT ) : sal_False;
+ nTextCompare = pRT && pRT->GetImageFlag( SBIMG_COMPARETEXT );
}
else
{
- nTextCompare = sal_True;
+ nTextCompare = true;
}
if ( rPar.Count() == 4 )
nTextCompare = rPar.Get(3)->GetInteger();
diff --git a/basic/source/runtime/runtime.cxx b/basic/source/runtime/runtime.cxx
index ad31f7812f83..21ae531ebbc2 100644
--- a/basic/source/runtime/runtime.cxx
+++ b/basic/source/runtime/runtime.cxx
@@ -1585,8 +1585,8 @@ void SbiRuntime::StepLIKE()
SbxVariable* pRes = new SbxVariable;
utl::TextSearch aSearch(aSearchOpt);
sal_Int32 nStart=0, nEnd=value.getLength();
- int bRes = aSearch.SearchForward(value, &nStart, &nEnd);
- pRes->PutBool( bRes != 0 );
+ bool bRes = aSearch.SearchForward(value, &nStart, &nEnd);
+ pRes->PutBool( bRes );
PushVar( pRes );
}
diff --git a/basic/source/sbx/sbxscan.cxx b/basic/source/sbx/sbxscan.cxx
index 15c507487076..6d39ba772466 100644
--- a/basic/source/sbx/sbxscan.cxx
+++ b/basic/source/sbx/sbxscan.cxx
@@ -76,7 +76,7 @@ bool ImpStrChr( const sal_Unicode* p, sal_Unicode c )
bool ImpIsAlNum( sal_Unicode c )
{
- return (c < 128) ? isalnum( static_cast<char>(c) ) : false;
+ return c < 128 && isalnum( static_cast<char>(c) );
}
// scanning a string according to BASIC-conventions