From: John L. <jr...@us...> - 2007-06-26 22:16:41
|
Update of /cvsroot/wxlua/wxLua/bindings In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv3484/wxLua/bindings Modified Files: genwxbind.lua Log Message: "fix" for wxGetTranslation. Seems like passing an empty wxString for const wxChar* parameter fails if the function checks that the input == NULL. This should evaluate to true, str.c_str()[0] == 0, so what's really the problem? Index: genwxbind.lua =================================================================== RCS file: /cvsroot/wxlua/wxLua/bindings/genwxbind.lua,v retrieving revision 1.134 retrieving revision 1.135 diff -C2 -d -r1.134 -r1.135 *** genwxbind.lua 26 Jun 2007 03:22:04 -0000 1.134 --- genwxbind.lua 26 Jun 2007 22:16:38 -0000 1.135 *************** *** 3067,3070 **** --- 3067,3071 ---- local origIndirectionCount = indirectionCount local argCast = nil + local argListOverride = nil -- Does DataType need to be translated from typeDef *************** *** 3155,3159 **** end elseif (indirectionCount == 1) and (argPtr == "*") then ! if argType == "wxString" then overload_argList = overload_argList.."&s_wxluaarg_String, " argItem = "wxlState.GetwxStringType("..argNum..")" --- 3156,3160 ---- end elseif (indirectionCount == 1) and (argPtr == "*") then ! if (argType == "wxString") or (argType == "wxChar") then overload_argList = overload_argList.."&s_wxluaarg_String, " argItem = "wxlState.GetwxStringType("..argNum..")" *************** *** 3169,3172 **** --- 3170,3179 ---- end end + + if (argType == "wxChar") then + argTypeWithAttrib = "wxString " + argListOverride = argName..".IsEmpty() ? NULL : "..argName..".c_str()" + end + elseif argType == "char" then overload_argList = overload_argList.."&s_wxluaarg_String, " *************** *** 3278,3282 **** end ! argList = argList..argName -- except for string arrays, the declare is the argType --- 3285,3289 ---- end ! argList = argList..(argListOverride or argName) -- except for string arrays, the declare is the argType |