bool ScintillaWX::CanPaste() {
- bool canPaste;
-
- wxTheClipboard->Open();
- wxTheClipboard->UsePrimarySelection();
- canPaste = wxTheClipboard->IsSupported(wxUSE_UNICODE ? wxDF_UNICODETEXT : wxDF_TEXT);
- wxTheClipboard->Close();
+ bool canPaste = FALSE;
+ if (! wxTheClipboard->IsOpened()) {
+ wxTheClipboard->Open();
+ wxTheClipboard->UsePrimarySelection();
+ canPaste = wxTheClipboard->IsSupported(wxUSE_UNICODE ? wxDF_UNICODETEXT : wxDF_TEXT);
+ wxTheClipboard->Close();
+ }
return canPaste;
}
bool ScintillaWX::CanPaste() {
- bool canPaste;
-
- wxTheClipboard->Open();
- wxTheClipboard->UsePrimarySelection();
- canPaste = wxTheClipboard->IsSupported(wxUSE_UNICODE ? wxDF_UNICODETEXT : wxDF_TEXT);
- wxTheClipboard->Close();
+ bool canPaste = FALSE;
+ if (! wxTheClipboard->IsOpened()) {
+ wxTheClipboard->Open();
+ wxTheClipboard->UsePrimarySelection();
+ canPaste = wxTheClipboard->IsSupported(wxUSE_UNICODE ? wxDF_UNICODETEXT : wxDF_TEXT);
+ wxTheClipboard->Close();
+ }
return canPaste;
}