[Lazarus] Setting clipboard on Linux adds ending #0

zeljko zeljko at holobit.net
Fri Mar 9 18:09:49 CET 2012

On Friday 09 of March 2012 15:36:09 cobines wrote:
> 2012/3/8 zeljko <zeljko at holobit.net>:
> > We cannot remove it just because you think so. If it's removed we need to
> > test consequences on gtk, gtk2 and qt.
> I know, I was counting on someone saying that it is needed and why.
> With copying to clipboard, I found this in LCLQT in
> TQtClipboard.GetOwnerShip:
>       if (QByteArray_length(Data) > 1) and QByteArray_endsWith(Data, #0)
> then QByteArray_chop(Data, 1);
> With pasting from clipboard, there is this in LCL:
> TClipboard.GetAsText:
>       if (ASize>0) and (pchar(MemStream.Memory)[ASize-1]=#0) then
>         Dec(ASize);
> If the #0 is specifically removed then maybe it doesn't need to be
> added as well. As I see it, the stream (or array) size determines the
> length, not the #0.
> I can only test by installing lots of applications and testing if
> copying/pasting still works after removing the #0.

Yeah, just try to copy something from openoffice under X11 and paste it into 
qt application (or to win32 app running under wine) and you'll see problem 
(and that comes from gtk2).
My wild guess is that #0 was added because of gtk2.
I'll fix qt in any case ... .whatever you put at the end, but who will fix 
gtk2 or carbon ?


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20120309/25dcebed/attachment-0003.html>

More information about the Lazarus mailing list