Simplify clipboard_set slightly

This commit is contained in:
Thomas Goyne 2013-06-12 15:48:35 -07:00
parent b90a77c74b
commit e99f4c4da1
1 changed files with 5 additions and 6 deletions

View File

@ -128,14 +128,13 @@ namespace {
// OLE needs to be initialized on each thread that wants to write to
// the clipboard, which wx does not handle automatically
wxClipboard cb;
wxClipboard *theCB = &cb;
#else
wxClipboard *theCB = wxTheClipboard;
wxClipboard &cb = *wxTheClipboard;
#endif
if (theCB->Open()) {
succeeded = theCB->SetData(new wxTextDataObject(to_wx(str)));
theCB->Close();
theCB->Flush();
if (cb.Open()) {
succeeded = cb.SetData(new wxTextDataObject(to_wx(str)));
cb.Close();
cb.Flush();
}
lua_pushboolean(L, succeeded);