GSOC work, fix runtime crash

Fixes runtime crash by not checking the string length in "Autoclose Quotes" funtion.

Change-Id: I15e58a0fd487ce86b832452a562406b8155b2641
This commit is contained in:
Gergo Mocsi 2013-07-26 10:29:00 +02:00
parent 40433e2ca9
commit 776734d8dd

View File

@ -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