mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-30 00:11:51 +02:00
GTK2: Remove trailing NULL only when GTK_REMOVE_CLIPBOARD_NULL is defined. Issues #21453 and #31547.
git-svn-id: trunk@55180 -
This commit is contained in:
parent
7026faf61d
commit
abec998f34
@ -3578,9 +3578,11 @@ begin
|
||||
GetMem(Buffer,BufLength);
|
||||
Assert(Assigned(Buffer) and (BufLength>0), 'SetData: GTK2 clipboard Buffer=Nil or empty.');
|
||||
MemStream.Read(Buffer^,BufLength);
|
||||
{$IFDEF GTK_REMOVE_CLIPBOARD_NULL}
|
||||
// Issue #21453. gtk_selection_data_set adds the required null. Remove it here.
|
||||
if PChar(Buffer+BufLength-1)^ = #0 then
|
||||
dec(BufLength);
|
||||
{$ENDIF}
|
||||
gtk_selection_data_set(SelectionData,SelectionData^.Target,8,Buffer,BufLength);
|
||||
FreeMem(Buffer);
|
||||
end;
|
||||
|
Loading…
Reference in New Issue
Block a user