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
|
// OLE needs to be initialized on each thread that wants to write to
|
||||||
// the clipboard, which wx does not handle automatically
|
// the clipboard, which wx does not handle automatically
|
||||||
wxClipboard cb;
|
wxClipboard cb;
|
||||||
wxClipboard *theCB = &cb;
|
|
||||||
#else
|
#else
|
||||||
wxClipboard *theCB = wxTheClipboard;
|
wxClipboard &cb = *wxTheClipboard;
|
||||||
#endif
|
#endif
|
||||||
if (theCB->Open()) {
|
if (cb.Open()) {
|
||||||
succeeded = theCB->SetData(new wxTextDataObject(to_wx(str)));
|
succeeded = cb.SetData(new wxTextDataObject(to_wx(str)));
|
||||||
theCB->Close();
|
cb.Close();
|
||||||
theCB->Flush();
|
cb.Flush();
|
||||||
}
|
}
|
||||||
|
|
||||||
lua_pushboolean(L, succeeded);
|
lua_pushboolean(L, succeeded);
|
||||||
|
|
Loading…
Reference in a new issue