diff options
author | Arnaud Versini <arnaud.versini@libreoffice.org> | 2013-10-27 15:15:30 +0100 |
---|---|---|
committer | Arnaud Versini <arnaud.versini@libreoffice.org> | 2013-10-27 16:07:16 +0000 |
commit | a79cb836b951eb2492e43aadd2ee672b9b67b914 (patch) | |
tree | 7df76c41a61ed2a249a2626a2a5dc0ee195beab7 /comphelper/source | |
parent | 591827c9ad0bec8b608bec63942aa7daf87dc5a0 (diff) |
COMPHELPER: Allow empty comments in SyntaxHighlight
Change-Id: I0f3d5673e28e34ed3921c930aca48f3d7574b064
Reviewed-on: https://gerrit.libreoffice.org/6450
Reviewed-by: Arnaud Versini <arnaud.versini@libreoffice.org>
Tested-by: Arnaud Versini <arnaud.versini@libreoffice.org>
Diffstat (limited to 'comphelper/source')
-rw-r--r-- | comphelper/source/misc/syntaxhighlight.cxx | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/comphelper/source/misc/syntaxhighlight.cxx b/comphelper/source/misc/syntaxhighlight.cxx index 83bcb59becc3..c6340ef68f54 100644 --- a/comphelper/source/misc/syntaxhighlight.cxx +++ b/comphelper/source/misc/syntaxhighlight.cxx @@ -399,16 +399,14 @@ sal_Bool SimpleTokenizer_Impl::getNextToken( /*out*/TokenTypes& reType, // Comment? if ( c == '\'' ) { - c = getChar(); + c = peekChar(); // Remove all characters until end of line or EOF sal_Unicode cPeek = c; while( cPeek != 0 && testCharFlags( cPeek, CHAR_EOL ) == sal_False ) { - getChar(); - cPeek = peekChar(); + cPeek = getChar(); } - reType = TT_COMMENT; } @@ -674,7 +672,7 @@ void SimpleTokenizer_Impl::getHighlightPortions( sal_uInt32 nParseLine, const OU const sal_Unicode* pEndPos; // Loop over all the tokens - while( getNextToken( eType, pStartPos, pEndPos ) ) + while( getNextToken( eType, pStartPos, pEndPos ) ) { portions.push_back( HighlightPortion( |