A continuation of this thread:
http://forums.codeblocks.org/index.php/topic,8309.0.html. (A new thread since I can now provide some code...
)
I believe I tracked the source of the bug down to some weird behaviour on the part of the wx's clipboard...
This particular code blurb illustrates the problem:
wxDataFormatId type = wxDF_PRIVATE;
//First, try putting something into the clipboard
wxTheClipboard->Open()
wxCustomDataObject* data = new wxCustomDataObject(type);
//now fill data with something
wxTheClipboard->SetData(data);
wxTheClipboard->Close()
//now lets see if we can get it back
wxTheClipboard->Open()
wxCustomDataObject test_data(type);
bool weHaveData = wxTheClipboard->GetData(test_data);
wxTheClipboard->Close()
This roughly follows the pathway between ScintillaWX::CopyToClipboard and ScintillaWX::Paste.
I have observed that the data is returned if and only if type is either wxDF_UNICODETEXT or wxDF_TEXT. The clipboard appears to discard anything else. Since the block pasting relies on the custom data block of the type wxDF_PRIVATE, it naturally gets discarded and fails to work. I tried replacing wxDF_PRIVATE with wxDF_UNICODETEXT, and voila, the block pasting worked. This is naturally a hack, and probably unsuitable to solve this.
So, anyone have any idea what is going on here? Some bug in the clipboard that only allows to put text onto it?