Version of [ 1177956 ] fix for wxString::operator=(wxChar *) for STL builds

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@33427 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Ryan Norton
2005-04-08 14:06:25 +00:00
parent 5234c3f3ce
commit c57e3bd53e

View File

@@ -843,9 +843,16 @@ public:
// from a character
wxString& operator=(wxChar ch)
{ return (wxString&)wxStringBase::operator=(ch); }
// from a C string
// from a C string - STL probably will crash on NULL,
// so we need to compensate in that case
#if wxUSE_STL
wxString& operator=(const wxChar *psz)
{ if(psz) wxStringBase::operator=(psz); else Clear(); return *this; }
#else
wxString& operator=(const wxChar *psz)
{ return (wxString&)wxStringBase::operator=(psz); }
#endif
#if wxUSE_UNICODE
// from wxWCharBuffer
wxString& operator=(const wxWCharBuffer& psz)