basic/source/comp/scanner.cxx |   17 +++++++++++++----
 basic/source/inc/scanner.hxx  |    1 +
 2 files changed, 14 insertions(+), 4 deletions(-)

New commits:
commit 40be618fb31754611dbd4241322004b205774976
Author: August Sodora <aug...@gmail.com>
Date:   Sun Dec 4 22:13:24 2011 -0500

    Refactor scanAlphanumeric

diff --git a/basic/source/comp/scanner.cxx b/basic/source/comp/scanner.cxx
index cc17fd5..4b4ba23 100644
--- a/basic/source/comp/scanner.cxx
+++ b/basic/source/comp/scanner.cxx
@@ -150,6 +150,17 @@ static SbxDataType GetSuffixType( sal_Unicode c )
 // return value is sal_False at EOF or errors
 #define BUF_SIZE 80
 
+void SbiScanner::scanAlphanumeric()
+{
+    sal_uInt16 n = nCol;
+    while(theBasicCharClass::get().isAlphaNumeric(*pLine, bCompatible) || 
*pLine == '_')
+    {
+        pLine++;
+        nCol++;
+    }
+    aSym = aLine.copy(n, nCol - n);
+}
+
 void SbiScanner::scanGoto()
 {
     sal_uInt16 nTestCol = nCol;
@@ -240,10 +251,8 @@ bool SbiScanner::NextSym()
         {   pLine++;
             goto eoln;  }
         bSymbol = true;
-        sal_uInt16 n = nCol;
-        for ( ; (theBasicCharClass::get().isAlphaNumeric( *pLine, bCompatible 
) || ( *pLine == '_' ) ); pLine++ )
-            nCol++;
-        aSym = aLine.copy( n, nCol - n );
+
+        scanAlphanumeric();
 
         // Special handling for "go to"
         if( bCompatible && *pLine && aSym.equalsIgnoreAsciiCaseAsciiL( 
RTL_CONSTASCII_STRINGPARAM("go") ) )
diff --git a/basic/source/inc/scanner.hxx b/basic/source/inc/scanner.hxx
index c254cf2..abda26b 100644
--- a/basic/source/inc/scanner.hxx
+++ b/basic/source/inc/scanner.hxx
@@ -46,6 +46,7 @@ class SbiScanner
     const sal_Unicode* pLine;
     const sal_Unicode* pSaveLine;
 
+    void scanAlphanumeric();
     void scanGoto();
 protected:
     ::rtl::OUString aSym;
_______________________________________________
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to