From 3e9bfc4ac3dd4ff9efd01e9c492b1c0ad0c1a67f Mon Sep 17 00:00:00 2001 From: MikalaiR Date: Thu, 16 Jun 2016 08:37:02 +0000 Subject: MirLua: code optimization git-svn-id: http://svn.miranda-ng.org/main/trunk@16993 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/MirLua/src/m_options.cpp | 29 +++++++++++++---------------- 1 file changed, 13 insertions(+), 16 deletions(-) (limited to 'plugins/MirLua/src') diff --git a/plugins/MirLua/src/m_options.cpp b/plugins/MirLua/src/m_options.cpp index fb74776ca8..37f1d27b22 100644 --- a/plugins/MirLua/src/m_options.cpp +++ b/plugins/MirLua/src/m_options.cpp @@ -3,36 +3,33 @@ class CMLuaScriptOptionPage : public CDlgBase { private: + int m_onInitDialogRef; + int m_onApplyRef; lua_State *L; - int onInitDialogRef; - int onApplyRef; public: - CMLuaScriptOptionPage(lua_State *L, int onInitDialogRef, int onApplyRef) - : CDlgBase(g_hInstance, IDD_SCRIPTOPTIONSPAGE), L(L), - onInitDialogRef(onInitDialogRef), onApplyRef(onApplyRef) + CMLuaScriptOptionPage(lua_State *_L, int onInitDialogRef, int onApplyRef) + : CDlgBase(g_hInstance, IDD_SCRIPTOPTIONSPAGE), L(_L), + m_onInitDialogRef(onInitDialogRef), m_onApplyRef(onApplyRef) { } -protected: - void OnInitDialog() + void OnInitDialog() override { - if (onInitDialogRef) + if (m_onInitDialogRef) { - lua_rawgeti(L, LUA_REGISTRYINDEX, onInitDialogRef); - - lua_pushlightuserdata(L, (void*)this->GetHwnd()); + lua_rawgeti(L, LUA_REGISTRYINDEX, m_onInitDialogRef); + lua_pushlightuserdata(L, m_hwnd); luaM_pcall(L, 1, 0); } } - void OnApply() + void OnApply() override { - if (onApplyRef) + if (m_onApplyRef) { - lua_rawgeti(L, LUA_REGISTRYINDEX, onApplyRef); - - lua_pushlightuserdata(L, (void*)this->GetHwnd()); + lua_rawgeti(L, LUA_REGISTRYINDEX, m_onApplyRef); + lua_pushlightuserdata(L, m_hwnd); luaM_pcall(L, 1, 0); } } -- cgit v1.2.3