fix for potention crash when conversion fails
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@39885 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
8b6682b97c
commit
1ae82ba9f2
@ -1650,7 +1650,8 @@ void wxDC::DoDrawText(const wxString& strtext, wxCoord x, wxCoord y)
|
||||
#endif
|
||||
{
|
||||
wxCharBuffer text = linetext.mb_str(wxConvLocal) ;
|
||||
::DrawText( text , 0 , strlen(text) ) ;
|
||||
if ( text.data() != NULL )
|
||||
::DrawText( text , 0 , strlen(text) ) ;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1718,7 +1719,10 @@ void wxDC::DoGetTextExtent( const wxString &strtext, wxCoord *width, wxCoord *he
|
||||
else
|
||||
{
|
||||
wxCharBuffer text = linetext.mb_str(wxConvLocal) ;
|
||||
curwidth = ::TextWidth( text , 0 , strlen(text) ) ;
|
||||
if ( text.data() != NULL )
|
||||
curwidth = ::TextWidth( text , 0 , strlen(text) ) ;
|
||||
else
|
||||
curwidth = 0 ;
|
||||
}
|
||||
|
||||
if ( curwidth > *width )
|
||||
|
Loading…
Reference in New Issue
Block a user