From 776734d8dd23766d3bd0bb901b4f97be05681c75 Mon Sep 17 00:00:00 2001 From: Gergo Mocsi Date: Fri, 26 Jul 2013 10:29:00 +0200 Subject: [PATCH] GSOC work, fix runtime crash Fixes runtime crash by not checking the string length in "Autoclose Quotes" funtion. Change-Id: I15e58a0fd487ce86b832452a562406b8155b2641 --- basctl/source/basicide/baside2b.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/basctl/source/basicide/baside2b.cxx b/basctl/source/basicide/baside2b.cxx index cf2530f6e47d..7578f85241b2 100644 --- a/basctl/source/basicide/baside2b.cxx +++ b/basctl/source/basicide/baside2b.cxx @@ -513,7 +513,7 @@ void EditorWindow::KeyInput( const KeyEvent& rKEvt ) HighlightPortions aPortions; aHighlighter.getHighlightPortions( nLine, aLine, aPortions ); - if( aLine[aLine.getLength()-1] != '"' && (aPortions[aPortions.size()-1].tokenType != 4) ) + if( aLine.getLength() > 0 && aLine[aLine.getLength()-1] != '"' && (aPortions[aPortions.size()-1].tokenType != 4) ) { GetEditView()->InsertText(OUString("\"")); //leave the cursor on it's place: inside the two double quotes