diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2013-10-28 08:47:22 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2013-10-28 10:47:19 +0100 |
commit | a699e7c70d312c96d0dbb8eb4c31b81129dcf7b2 (patch) | |
tree | 0ec459eb9dd628f5ae8dcd755ac0deb4c3a3c6e1 /comphelper/source | |
parent | a027fa423876a3c9a4f3edfcd3a35ae1e83b068f (diff) |
Revert "COMPHELPER: Allow empty comments in SyntaxHighlight"
This reverts commit a79cb836b951eb2492e43aadd2ee672b9b67b914, which broke
--with-help builds again, as
strLine.copy(i->nBegin, i->nEnd-i->nBegin)
in BasicCodeTagger::tagParagraph (helpcompiler/source/BasCodeTagger.cxx) depends
on the invariant that a HighlightPortion does not extend past the source string.
Also, I see no reason for that change, as empty comments are handled just fine
already as demonstrated by the following commit...
Change-Id: I384bae9c4cf6a38d0a0a2832fa15bde82126cace
Diffstat (limited to 'comphelper/source')
-rw-r--r-- | comphelper/source/misc/syntaxhighlight.cxx | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/comphelper/source/misc/syntaxhighlight.cxx b/comphelper/source/misc/syntaxhighlight.cxx index c6340ef68f54..83bcb59becc3 100644 --- a/comphelper/source/misc/syntaxhighlight.cxx +++ b/comphelper/source/misc/syntaxhighlight.cxx @@ -399,14 +399,16 @@ sal_Bool SimpleTokenizer_Impl::getNextToken( /*out*/TokenTypes& reType, // Comment? if ( c == '\'' ) { - c = peekChar(); + c = getChar(); // Remove all characters until end of line or EOF sal_Unicode cPeek = c; while( cPeek != 0 && testCharFlags( cPeek, CHAR_EOL ) == sal_False ) { - cPeek = getChar(); + getChar(); + cPeek = peekChar(); } + reType = TT_COMMENT; } @@ -672,7 +674,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( |