Missing call for SCI_ANNOTATIONGETTEXT in QsciScintilla::annotation?

Phil Thompson phil at riverbankcomputing.com
Thu Mar 26 11:48:59 GMT 2026


On 20/03/2026 10:12, Moritz Wenk wrote:
> Hello,
> 
> Is this a bug in QsciScintilla::annotation() (from qsciscintilla.cpp
> in version 2.14.1) ? The variable “buf” is never initialized with
> anything.
> 
> // Get the annotation for a line, if any.
> QString QsciScintilla::annotation(int line) const
> {
>     int size = SendScintilla(SCI_ANNOTATIONGETTEXT, line, (const char 
> *)0);
>     char *buf = new char[size + 1];
> 
>     QString qs = bytesAsText(buf, size);
>     delete[] buf;
> 
>     return qs;
> }
> 
> I think there is a call for SendScintilla() missing:
> 
> char *buf = new char[size + 1];
> SendScintilla(SCI_ANNOTATIONGETTEXT, line, (char *)buf);

You're right, the call is missing.

Thanks,
Phil


More information about the QScintilla mailing list