Explicitly allow unicode text when pasting

This commit is contained in:
Thomas Goyne 2015-03-22 10:46:58 -08:00
parent 42429d4930
commit 97bf5c77c3
2 changed files with 3 additions and 3 deletions

View file

@ -855,7 +855,7 @@ struct edit_line_paste final : public Command {
bool Validate(const agi::Context *) override {
bool can_paste = false;
if (wxTheClipboard->Open()) {
can_paste = wxTheClipboard->IsSupported(wxDF_TEXT);
can_paste = wxTheClipboard->IsSupported(wxDF_TEXT) || wxTheClipboard->IsSupported(wxDF_UNICODETEXT);
wxTheClipboard->Close();
}
return can_paste;
@ -886,7 +886,7 @@ struct edit_line_paste_over final : public Command {
bool Validate(const agi::Context *c) override {
bool can_paste = !c->selectionController->GetSelectedSet().empty();
if (can_paste && wxTheClipboard->Open()) {
can_paste = wxTheClipboard->IsSupported(wxDF_TEXT);
can_paste = wxTheClipboard->IsSupported(wxDF_TEXT) || wxTheClipboard->IsSupported(wxDF_UNICODETEXT);
wxTheClipboard->Close();
}
return can_paste;

View file

@ -126,7 +126,7 @@ std::string GetClipboard() {
wxString data;
wxClipboard *cb = wxClipboard::Get();
if (cb->Open()) {
if (cb->IsSupported(wxDF_TEXT)) {
if (cb->IsSupported(wxDF_TEXT) || cb->IsSupported(wxDF_UNICODETEXT)) {
wxTextDataObject raw_data;
cb->GetData(raw_data);
data = raw_data.GetText();