[QScintilla] Bug in QsciScintilla::clearAnnotations()?

Phil Thompson phil at riverbankcomputing.com
Thu Jul 22 13:38:49 BST 2010


On Tue, 20 Jul 2010 10:55:23 +0200, Moritz Wenk
<Moritz.Wenk at br-automation.com> wrote:
> Hello,
> 
> my QScintilla Application (using version 2.4.4) crashes when calling 
> QsciScintilla::clearAnnotations(-1) to remove all the annotations.
> From version 2.4 to 2.4.4 the greather than / less than in the if 
> condition in qscintilla.cpp was changed. 
> Looks like it is wrong in 2.4.4?
> 
> Code from 2.4.0:
> 
> // Clear annotations.
> void QsciScintilla::clearAnnotations(int line)
> {
>     if (line > 0)
>         SendScintilla(SCI_ANNOTATIONSETTEXT, line, (const char *)0);
>     else
>         SendScintilla(SCI_ANNOTATIONCLEARALL);
> }
> 
> 
> Code from 2.4.4:
> 
> // Clear annotations.
> void QsciScintilla::clearAnnotations(int line)
> {
>     if (line < 0)
>         SendScintilla(SCI_ANNOTATIONSETTEXT, line, (const char *)0);
>     else
>         SendScintilla(SCI_ANNOTATIONCLEARALL);
> }

Wrong in both versions, I think. It should be...

    if (line >= 0)

Thanks,
Phil


More information about the QScintilla mailing list