summaryrefslogtreecommitdiff
path: root/basic
diff options
context:
space:
mode:
authorAugust Sodora <augsod@gmail.com>2012-01-09 00:27:16 -0500
committerAugust Sodora <augsod@gmail.com>2012-01-09 00:54:30 -0500
commited5b6ace8974e37f51f915d731d3b71dffdc8b49 (patch)
treea127a1b7ab7d40d57057dbce54c0cbb54ee9b45c /basic
parentc3259776aa138ef6afb9fa589edf47554e6524dd (diff)
Remove use of pLine in scanner
Diffstat (limited to 'basic')
-rw-r--r--basic/source/comp/scanner.cxx8
1 files changed, 3 insertions, 5 deletions
diff --git a/basic/source/comp/scanner.cxx b/basic/source/comp/scanner.cxx
index ff6b018cda28..0c359c5c7d3a 100644
--- a/basic/source/comp/scanner.cxx
+++ b/basic/source/comp/scanner.cxx
@@ -219,12 +219,10 @@ bool SbiScanner::NextSym()
sal_Int32 nOldCol1 = nCol1;
sal_Int32 nOldCol2 = nCol2;
sal_Unicode buf[ BUF_SIZE ], *p = buf;
- bHash = false;
eScanType = SbxVARIANT;
aSym = ::rtl::OUString();
- bSymbol =
- bNumber = bSpaces = false;
+ bHash = bSymbol = bNumber = bSpaces = false;
// read in line?
if( !pLine )
@@ -236,7 +234,7 @@ bool SbiScanner::NextSym()
nOldCol1 = nOldCol2 = 0;
}
- while( theBasicCharClass::get().isWhitespace( *pLine ) )
+ while(nCol < aLine.getLength() && theBasicCharClass::get().isWhitespace(aLine[nCol]))
++pLine, ++nCol, bSpaces = true;
nCol1 = nCol;
@@ -256,7 +254,7 @@ bool SbiScanner::NextSym()
}
// copy character if symbol
- if( theBasicCharClass::get().isAlpha( *pLine, bCompatible ) || *pLine == '_' )
+ if(nCol < aLine.getLength() && (theBasicCharClass::get().isAlpha(aLine[nCol], bCompatible) || aLine[nCol] == '_'))
{
// if there's nothing behind '_' , it's the end of a line!
if( *pLine == '_' && !*(pLine+1) )