forked from mia/Aegisub
Simplify clipboard_set slightly
This commit is contained in:
parent
b90a77c74b
commit
e99f4c4da1
1 changed files with 5 additions and 6 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue