Menu

#180 Clipboard Copy Data Is Corrupt When Source Contains Delimiter (Tab)

C#_v2.9
open
None
1
2019-01-23
2019-01-23
Thracx
No

Copying to the clipboard (ObjectListView.CopySelectionToClipboard or Ctrl+C) unexpectingly truncates the output when the plaintext column delimiter (tab) is contained in the row data.

The source of the bug is inside OLVExporter.Convert, where there are HtmlEncode and CvsEncode convert methods exist, but a TabEncode is missing. Simply changing the 2 WriteOneRow lines to also use an identical copy of CvsEncode named TabEncode fixes the issue. (These methods are identical since they don't escape the delimiter character, but instead wrap each cell in quotes and escape other quotation marks).

This means that pasting into Word works by default (since it seems to use HTML or CVS), but telling word to 'Keep Text Only' (or using Notepad++/etc) shows the incorrectly copied text in that format/portion part of the ClipBoard's DataObject object.

Discussion


Log in to post a comment.