diff options
author | Caolán McNamara <caolanm@redhat.com> | 2013-04-16 13:40:04 +0100 |
---|---|---|
committer | Petr Mladek <pmladek@suse.cz> | 2013-05-06 17:34:38 +0200 |
commit | 8443407096ac4e6848c38874aaebcef01c585f4f (patch) | |
tree | e290cc52146104737415cbc64e4ae9bfdcc770a7 /svtools | |
parent | 221f54aa0179f5633e85529d1cb1d0b582e0f73f (diff) |
Resolves: fdo#47209 and rhbz#927223 syntax highlighter crash
when trying to parse empty lines looking for the matching
bracket
Change-Id: I3961a3d0e804d136de286e21934c6ba5ab0496cf
(cherry picked from commit 02917cb57e2c2e9fcab2db8f72960023f3e4edaf)
Reviewed-on: https://gerrit.libreoffice.org/3414
Reviewed-by: Michael Stahl <mstahl@redhat.com>
Tested-by: Michael Stahl <mstahl@redhat.com>
Diffstat (limited to 'svtools')
-rw-r--r-- | svtools/source/edit/editsyntaxhighlighter.cxx | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/svtools/source/edit/editsyntaxhighlighter.cxx b/svtools/source/edit/editsyntaxhighlighter.cxx index 64853117fe48..3b5f3e51a2a9 100644 --- a/svtools/source/edit/editsyntaxhighlighter.cxx +++ b/svtools/source/edit/editsyntaxhighlighter.cxx @@ -89,6 +89,10 @@ void MultiLineEditSyntaxHighlight::DoBracketHilight(sal_uInt16 aKey) continue; String aLine( GetTextEngine()->GetText( aPara ) ); + + if (aLine.Len() == 0) + continue; + for (sal_uInt16 i = ((unsigned long)aPara==nStartPara) ? aStartPos-1 : (sal_uInt16)(aLine.Len()-1); i>0; --i) { if (aLine.GetChar(i)==aChar) |