diff options
author | August Sodora <augsod@gmail.com> | 2012-01-09 00:27:16 -0500 |
---|---|---|
committer | August Sodora <augsod@gmail.com> | 2012-01-09 00:54:30 -0500 |
commit | ed5b6ace8974e37f51f915d731d3b71dffdc8b49 (patch) | |
tree | a127a1b7ab7d40d57057dbce54c0cbb54ee9b45c | |
parent | c3259776aa138ef6afb9fa589edf47554e6524dd (diff) |
Remove use of pLine in scanner
-rw-r--r-- | basic/source/comp/scanner.cxx | 8 |
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) ) |