From: Robin Dunn <robin@alldunn.com> Date: Wed, 3 Dec 2003 00:43:44 +0000 (+0000) Subject: Out typemap for wxString& X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/87c2245b34abf6898c8e558bc7674c485c709a68 Out typemap for wxString& git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@24695 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/wxPython/src/_cmndlgs.i b/wxPython/src/_cmndlgs.i index f6dad4310b..a4d736f1f6 100644 --- a/wxPython/src/_cmndlgs.i +++ b/wxPython/src/_cmndlgs.i @@ -345,7 +345,7 @@ class wxFindDialogEvent : public wxCommandEvent public: wxFindDialogEvent(wxEventType commandType = wxEVT_NULL, int id = 0); int GetFlags(); - wxString GetFindString(); + const wxString& GetFindString(); const wxString& GetReplaceString(); wxFindReplaceDialog *GetDialog(); void SetFlags(int flags); diff --git a/wxPython/src/my_typemaps.i b/wxPython/src/my_typemaps.i index 7b73b7a73e..8e5898332d 100644 --- a/wxPython/src/my_typemaps.i +++ b/wxPython/src/my_typemaps.i @@ -61,6 +61,7 @@ %#endif } + %typemap(out) wxString* { %#if wxUSE_UNICODE $result = PyUnicode_FromWideChar($1->c_str(), $1->Len()); @@ -69,6 +70,16 @@ %#endif } + +%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(varout) wxString { %#if wxUSE_UNICODE $result = PyUnicode_FromWideChar($1.c_str(), $1.Len());