[Libreoffice-commits] core.git: Branch 'aoo/trunk' - basic/source

Damjan Jovanovic damjan at apache.org
Tue Nov 24 16:08:12 PST 2015


 basic/source/comp/token.cxx |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit f8a51d0f5a645704bc2bdc939474ac931d55559c
Author: Damjan Jovanovic <damjan at apache.org>
Date:   Tue Nov 24 18:56:10 2015 +0000

    #i117960# Basic: Line Input doesn't work in single-line If
    
    i92642 added the ability to use certain keywords as variable names (eg. name = 1, line = "hi"),
    but also caused a regression where "Line Input" is broken in single-line If statements.
    This patch fixes that by allowing Then and Else to also be the start-of-line tokens expected to
    immediately preceed the "Line" token in order for that "Line" token to be recognized a keyword instead
    of a variable name. Also added FVT spreadsheet tests for "Line" as both a variable name and as "Line Input".
    
    Patch by: me

diff --git a/basic/source/comp/token.cxx b/basic/source/comp/token.cxx
index bf8c5ef..655655e 100644
--- a/basic/source/comp/token.cxx
+++ b/basic/source/comp/token.cxx
@@ -557,7 +557,8 @@ SbiToken SbiTokenizer::Next()
     }
 special:
     // #i92642
-    bool bStartOfLine = (eCurTok == NIL || eCurTok == REM || eCurTok == EOLN);
+    bool bStartOfLine = (eCurTok == NIL || eCurTok == REM || eCurTok == EOLN ||
+            eCurTok == THEN || eCurTok == ELSE); // single line If
     if( !bStartOfLine && (tp->t == NAME || tp->t == LINE) )
         return eCurTok = SYMBOL;
     else if( tp->t == TEXT )


More information about the Libreoffice-commits mailing list