Always initialize values returned from wxGDDC::GetChar{Width,Height}().
Don't return garbage in case of error. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@75990 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -1066,7 +1066,7 @@ bool wxGCDCImpl::DoGetPartialTextExtents(const wxString& text, wxArrayInt& width
|
||||
|
||||
wxCoord wxGCDCImpl::GetCharWidth(void) const
|
||||
{
|
||||
wxCoord width;
|
||||
wxCoord width = 0;
|
||||
DoGetTextExtent( wxT("g") , &width , NULL , NULL , NULL , NULL );
|
||||
|
||||
return width;
|
||||
@@ -1074,7 +1074,7 @@ wxCoord wxGCDCImpl::GetCharWidth(void) const
|
||||
|
||||
wxCoord wxGCDCImpl::GetCharHeight(void) const
|
||||
{
|
||||
wxCoord height;
|
||||
wxCoord height = 0;
|
||||
DoGetTextExtent( wxT("g") , NULL , &height , NULL , NULL , NULL );
|
||||
|
||||
return height;
|
||||
|
Reference in New Issue
Block a user