X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/d9e12f1a3267a834a31bc516632655e1f016fb77..cc6eca35090e1735e2dde009185476dc80726b97:/wxPython/src/my_typemaps.i diff --git a/wxPython/src/my_typemaps.i b/wxPython/src/my_typemaps.i index c538e130ae..ff4994d928 100644 --- a/wxPython/src/my_typemaps.i +++ b/wxPython/src/my_typemaps.i @@ -49,18 +49,7 @@ delete $1; } - - -%typemap(out) wxString { -%#if wxUSE_UNICODE - $result = PyUnicode_FromWideChar($1.c_str(), $1.Len()); -%#else - $result = PyString_FromStringAndSize($1.c_str(), $1.Len()); -%#endif -} - - -%typemap(out) wxString* { +%typemap(out) wxString& { %#if wxUSE_UNICODE $result = PyUnicode_FromWideChar($1->c_str(), $1->Len()); %#else @@ -69,15 +58,18 @@ } -%typemap(out) wxString& { +%apply wxString& { wxString* } + + + +%typemap(out) wxString { %#if wxUSE_UNICODE - $result = PyUnicode_FromWideChar($1->c_str(), $1->Len()); + $result = PyUnicode_FromWideChar($1.c_str(), $1.Len()); %#else - $result = PyString_FromStringAndSize($1->c_str(), $1->Len()); + $result = PyString_FromStringAndSize($1.c_str(), $1.Len()); %#endif } - %typemap(varout) wxString { %#if wxUSE_UNICODE $result = PyUnicode_FromWideChar($1.c_str(), $1.Len());