summaryrefslogtreecommitdiff
path: root/basic/source/comp
diff options
context:
space:
mode:
authorGergo Mocsi <gmocsi91@gmail.com>2013-08-13 18:11:26 +0200
committerGergo Mocsi <gmocsi91@gmail.com>2013-09-02 18:16:58 +0200
commit9b534193a3132764f7c5a659025ab2c49bfb2605 (patch)
tree87120c12459bcf72ec84afe1caef241cb0e6faa7 /basic/source/comp
parent8a1e19f4ff627d9ac15bbdf7ef04d27158b45569 (diff)
GSOC work, behavior fixes
Code completition: left/right arrow keys handled. Left arrow dismisses the dialog when reaches the dot. Right arrow dismissed the dialog when reaches the next line. ListBox appearance fixed. TAB key can insert the first matching entry. Autocorrect: "Autocorrect Keywords" has been renamed to "Autcorrect" (in the UI, and the config file, after this patch a make dev-install is needed). Keyword case correction is not just capitalizing the first letter ( eg. Elseif -> ElseIf ). Autoclose procedures: cursor is being placed inside the preocedure. Change-Id: Ie7e9ae96b49bd94562db83f96e1c4ad63ab3f3d6
Diffstat (limited to 'basic/source/comp')
-rw-r--r--basic/source/comp/parser.cxx1
-rw-r--r--basic/source/comp/token.cxx21
2 files changed, 21 insertions, 1 deletions
diff --git a/basic/source/comp/parser.cxx b/basic/source/comp/parser.cxx
index e24f89b020a8..680f4dcd40cc 100644
--- a/basic/source/comp/parser.cxx
+++ b/basic/source/comp/parser.cxx
@@ -155,7 +155,6 @@ SbiParser::SbiParser( StarBASIC* pb, SbModule* pm )
}
-
// part of the runtime-library?
SbiSymDef* SbiParser::CheckRTLForSym( const OUString& rSym, SbxDataType eType )
{
diff --git a/basic/source/comp/token.cxx b/basic/source/comp/token.cxx
index 57614271c857..a2df363308f6 100644
--- a/basic/source/comp/token.cxx
+++ b/basic/source/comp/token.cxx
@@ -547,4 +547,25 @@ bool SbiTokenizer::MayBeLabel( bool bNeedsColon )
}
}
+
+OUString SbiTokenizer::GetKeywordCase( const OUString& sKeyword )
+{
+ if( !nToken )
+ {
+ TokenTable *tp;
+ for( nToken = 0, tp = pTokTable; tp->t; nToken++, tp++ )
+ {}
+ }
+ TokenTable* tp = pTokTable;
+ for( short i = 0; i < nToken; i++, tp++ )
+ {
+ OUString sStr = OStringToOUString(tp->s, RTL_TEXTENCODING_ASCII_US);
+ if( sStr.equalsIgnoreAsciiCase(sKeyword) )
+ {
+ return sStr;
+ }
+ }
+ return OUString("");
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */