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:
@@ -1650,7 +1650,8 @@ void wxDC::DoDrawText(const wxString& strtext, wxCoord x, wxCoord y)
|
|||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
wxCharBuffer text = linetext.mb_str(wxConvLocal) ;
|
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
|
else
|
||||||
{
|
{
|
||||||
wxCharBuffer text = linetext.mb_str(wxConvLocal) ;
|
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 )
|
if ( curwidth > *width )
|
||||||
|
Reference in New Issue
Block a user