Changed CanPaste to just check IsSupported.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@12158 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
2001-10-24 17:46:31 +00:00
parent 91cddacfe0
commit e26c0634d0
2 changed files with 8 additions and 10 deletions

View File

@@ -246,12 +246,12 @@ void ScintillaWX::Paste() {
ClearSelection(); ClearSelection();
wxTextDataObject data; wxTextDataObject data;
bool canPaste; bool gotData;
wxTheClipboard->Open(); wxTheClipboard->Open();
canPaste = wxTheClipboard->GetData(data); gotData = wxTheClipboard->GetData(data);
wxTheClipboard->Close(); wxTheClipboard->Close();
if (canPaste) { if (gotData) {
wxString str = data.GetText(); wxString str = data.GetText();
int len = str.Length(); int len = str.Length();
pdoc->InsertString(currentPos, str.c_str(), len); pdoc->InsertString(currentPos, str.c_str(), len);
@@ -265,11 +265,10 @@ void ScintillaWX::Paste() {
bool ScintillaWX::CanPaste() { bool ScintillaWX::CanPaste() {
wxTextDataObject data;
bool canPaste; bool canPaste;
wxTheClipboard->Open(); wxTheClipboard->Open();
canPaste = wxTheClipboard->GetData(data); canPaste = wxTheClipboard->IsSupported( wxDF_TEXT );
wxTheClipboard->Close(); wxTheClipboard->Close();
return canPaste; return canPaste;

View File

@@ -246,12 +246,12 @@ void ScintillaWX::Paste() {
ClearSelection(); ClearSelection();
wxTextDataObject data; wxTextDataObject data;
bool canPaste; bool gotData;
wxTheClipboard->Open(); wxTheClipboard->Open();
canPaste = wxTheClipboard->GetData(data); gotData = wxTheClipboard->GetData(data);
wxTheClipboard->Close(); wxTheClipboard->Close();
if (canPaste) { if (gotData) {
wxString str = data.GetText(); wxString str = data.GetText();
int len = str.Length(); int len = str.Length();
pdoc->InsertString(currentPos, str.c_str(), len); pdoc->InsertString(currentPos, str.c_str(), len);
@@ -265,11 +265,10 @@ void ScintillaWX::Paste() {
bool ScintillaWX::CanPaste() { bool ScintillaWX::CanPaste() {
wxTextDataObject data;
bool canPaste; bool canPaste;
wxTheClipboard->Open(); wxTheClipboard->Open();
canPaste = wxTheClipboard->GetData(data); canPaste = wxTheClipboard->IsSupported( wxDF_TEXT );
wxTheClipboard->Close(); wxTheClipboard->Close();
return canPaste; return canPaste;