From e8e64015fc1d7bf7b37310858067a61b9b102a7c Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Wed, 22 Jan 2014 18:38:30 +0100 Subject: [PATCH] CLuaInstance: Fix bool parameter in CWindow/SignalBox => paint()/hide() Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/71e5f964ab7967d0d778fc6e9ce54e22c585ac35 Author: Michael Liebmann Date: 2014-01-22 (Wed, 22 Jan 2014) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/luainstance.cpp | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/src/gui/luainstance.cpp b/src/gui/luainstance.cpp index 39cdcd8ca..ae4ddda32 100644 --- a/src/gui/luainstance.cpp +++ b/src/gui/luainstance.cpp @@ -1335,28 +1335,30 @@ CLuaCWindow *CLuaInstance::CWindowCheck(lua_State *L, int n) int CLuaInstance::CWindowPaint(lua_State *L) { lua_assert(lua_istable(L,1)); - int do_save_bg = 1; - tableLookup(L, "do_save_bg", do_save_bg); + std::string tmp = "true"; + tableLookup(L, "do_save_bg", tmp); + bool do_save_bg = (tmp == "true" || tmp == "1" || tmp == "yes"); CLuaCWindow *m = CWindowCheck(L, 1); if (!m) return 0; - m->w->paint((do_save_bg!=0)?true:false); + m->w->paint(do_save_bg); return 0; } int CLuaInstance::CWindowHide(lua_State *L) { lua_assert(lua_istable(L,1)); - int no_restore = 0; - tableLookup(L, "no_restore", no_restore); + std::string tmp = "false"; + tableLookup(L, "no_restore", tmp); + bool no_restore = (tmp == "true" || tmp == "1" || tmp == "yes"); CLuaCWindow *m = CWindowCheck(L, 1); if (!m) return 0; - m->w->hide((no_restore!=0)?true:false); + m->w->hide(no_restore); return 0; } @@ -1418,14 +1420,15 @@ int CLuaInstance::SignalBoxNew(lua_State *L) int CLuaInstance::SignalBoxPaint(lua_State *L) { lua_assert(lua_istable(L,1)); - int do_save_bg = 1; - tableLookup(L, "do_save_bg", do_save_bg); + std::string tmp = "true"; + tableLookup(L, "do_save_bg", tmp); + bool do_save_bg = (tmp == "true" || tmp == "1" || tmp == "yes"); CLuaSignalBox *m = SignalBoxCheck(L, 1); if (!m) return 0; - m->s->paint((do_save_bg!=0)?true:false); + m->s->paint(do_save_bg); return 0; }