Setting clipboard text adds a character at the end of the text
Original Reporter info from Mantis: circular
-
Reporter name:
Original Reporter info from Mantis: circular
- Reporter name:
Description:
Clipboard.SetAsText defines the buffer to be one byte longer than the string and that adds an extra char. This extra char is probably zero, but it is included as an "#" when pasting text in another application.
Steps to reproduce:
Set the clipboard, go into Libre Office Writer and paste.
Additional information:
The following function seems to work fine:
procedure SetClipboardAsText(Value: string);
var
strStream: TStringStream;
begin
strStream := TStringStream.Create(Value);
Clipboard.SetFormat(PredefinedClipboardFormat(pcfText), strStream);
strStream.Free;
end;
Mantis conversion info:
- Mantis ID: 34116
- Platform: Linux Mint
- Version: 2.3 (SVN)