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:
@@ -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;
|
||||||
|
@@ -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;
|
||||||
|
Reference in New Issue
Block a user