From e99f4c4da11b8043c7f5468822c5749901cf56b3 Mon Sep 17 00:00:00 2001 From: Thomas Goyne Date: Wed, 12 Jun 2013 15:48:35 -0700 Subject: [PATCH] Simplify clipboard_set slightly --- aegisub/src/auto4_lua.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/aegisub/src/auto4_lua.cpp b/aegisub/src/auto4_lua.cpp index d703a48f5..d1b901787 100644 --- a/aegisub/src/auto4_lua.cpp +++ b/aegisub/src/auto4_lua.cpp @@ -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);