[Libreoffice-commits] core.git: Branch 'feature/gsoc-basic-ide-completion-and-other-bits' - basctl/source

Gergo Mocsi gmocsi91 at gmail.com
Fri Jul 26 01:36:09 PDT 2013


 basctl/source/basicide/baside2b.cxx |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit e9d2993bd7a5e5dd354b2d6e8f1ac7d5fc9c7a33
Author: Gergo Mocsi <gmocsi91 at gmail.com>
Date:   Fri Jul 26 10:29:00 2013 +0200

    GSOC work, fix runtime crash
    
    Fixes runtime crash by not checking the string length in "Autoclose Quotes" funtion.
    
    Change-Id: I15e58a0fd487ce86b832452a562406b8155b2641

diff --git a/basctl/source/basicide/baside2b.cxx b/basctl/source/basicide/baside2b.cxx
index d75aae9..c533ebc 100644
--- a/basctl/source/basicide/baside2b.cxx
+++ b/basctl/source/basicide/baside2b.cxx
@@ -507,7 +507,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


More information about the Libreoffice-commits mailing list