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()?
// 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
-------------------------------------------------------------------------
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