diff options
author | August Sodora <augsod@gmail.com> | 2012-01-14 18:39:17 -0500 |
---|---|---|
committer | August Sodora <augsod@gmail.com> | 2012-01-14 18:39:58 -0500 |
commit | 944140ae44708074ed7f88d3728e06c5e92413f5 (patch) | |
tree | 1468db95297fd6ae12433f8dd31fb3ed0df9dbf6 /basic/source/comp/scanner.cxx | |
parent | e4d6dfae33102891cbea0d330a31bb21572d5959 (diff) |
Remove uses of pLine in scanner
Diffstat (limited to 'basic/source/comp/scanner.cxx')
-rw-r--r-- | basic/source/comp/scanner.cxx | 31 |
1 files changed, 20 insertions, 11 deletions
diff --git a/basic/source/comp/scanner.cxx b/basic/source/comp/scanner.cxx index 4e016793334b..51c7ed455a5a 100644 --- a/basic/source/comp/scanner.cxx +++ b/basic/source/comp/scanner.cxx @@ -317,7 +317,7 @@ bool SbiScanner::NextSym() short ncdig = 0; eScanType = SbxDOUBLE; bool bBufOverflow = false; - while( strchr( "0123456789.DEde", *pLine ) && *pLine ) + while(nCol < aLine.getLength() && strchr("0123456789.DEde", aLine[nCol])) { // from 4.1.1996: buffer full? -> go on scanning empty if( (p-buf) == (BUF_SIZE-1) ) @@ -327,31 +327,40 @@ bool SbiScanner::NextSym() continue; } // point or exponent? - if( *pLine == '.' ) + if(aLine[nCol] == '.') { if( ++comma > 1 ) { ++pLine; ++nCol; continue; } - else *p++ = *pLine++, ++nCol; + else + { + *p = '.'; + ++p, ++pLine, ++nCol; + } } - else if( strchr( "DdEe", *pLine ) ) + else if(strchr("DdEe", aLine[nCol])) { if (++exp > 1) { ++pLine; ++nCol; continue; } - *p++ = 'E'; ++pLine; ++nCol; - if( *pLine == '+' ) + *p = 'E'; + ++p, ++pLine, ++nCol; + + if(aLine[nCol] == '+') ++pLine, ++nCol; - else - if( *pLine == '-' ) - *p++ = *pLine++, ++nCol; + else if(aLine[nCol] == '-') + { + *p = '-'; + ++p, ++pLine, ++nCol; + } } else { - *p++ = *pLine++, ++nCol; + *p = aLine[nCol]; + ++p, ++pLine, ++nCol; if( comma && !exp ) ++ncdig; } if (!exp) ++ndig; @@ -379,7 +388,7 @@ bool SbiScanner::NextSym() GenError( SbERR_MATH_OVERFLOW ); // type recognition? - SbxDataType t = GetSuffixType( *pLine ); + SbxDataType t(GetSuffixType(aLine[nCol])); if( t != SbxVARIANT ) { eScanType = t; |