Hi,

John Labenski wrote:
> On 6/26/07, Hakki Dogusan <[EMAIL PROTECTED]> wrote:
>>> I think I found the reason of requiring szDomain parameter to translate..
>>>
>>> [intl.h]
>>> virtual const wxChar *
>>> GetString(const wxChar *szOrigString,
>>>            const wxChar *szDomain = NULL) const;
>>>
>>> szDomain is declared as wxChar here, and:
>>>
>>> [intl.cpp ~2608]
>>> it is checked against NULL
> ...
>>> but in [wxLua - datetime.cpp ~5733] it is declared and used as wxString:
>>> //virtual wxString
>>> //GetString(const wxString& szOrigString,
>>> //          const wxString& szDomain = "") const;
>>> static int LUACALL wxLua_wxLocale_GetString(lua_State *L)
>>> ...
>>> const wxString szDomain = (argCount >= 3 ?
>>>                             wxlState.GetwxStringType(3) :
>>>                             wxString(wxEmptyString));
>>> ...
>>>
>>> If we omit szDomain parameter, it gets an emty string instead of NULL!
> 
> But wxString(wxEmptyString).GetData(0) == 0 so it should look like a
> NULL? Note that we use wxString(wxEmptyString) here for some compilers
> to not complain about different data types.
> 
>> I hacked datetime.cpp and wx_bind.cpp to test my thinking; now GetString
>> and wxGetTranslation works as expected..
>>
>> [datetime.cpp]
>>
>> static int LUACALL wxLua_wxLocale_GetString1(lua_State *L)
>> ...
> 
> What about just this? Remove the IsEmpty and NULL. Does it work just
> using c_str()?
> 

No, it didn't work. ( "" != NULL Isn't it?)


> // returns = (self->GetString(szOrigString, szOrigString2, n, szDomain));
> returns = (self->GetString(szOrigString, szOrigString2, n,
> szDomain.c_str()));
> 
> If so, I have a workable fix for it.
>     John Labenski
> 


BTW, I'm testing for gcc-3.4.5 now. Compiler dies at static struct 
definitions while compiling wx_bind.cpp.


To see, I commented following, and it compiles:

static wxLuaBindEvent eventList[] = {
        /* ... */
         { 0, 0, 0 },
     };


static wxLuaBindString stringList[] = {
        /* ... */
         { 0, 0 },
     };


I'm googling now...


--
Regards,
Hakki Dogusan

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
wxlua-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wxlua-users

Reply via email to