From 332952a18cedaee19d737ebf607fd52bbfd9f8b7 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 22 Feb 2014 22:40:03 +0000 Subject: [PATCH] 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 --- src/common/dcgraph.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/common/dcgraph.cpp b/src/common/dcgraph.cpp index 32f4390402..1ec560c6b0 100644 --- a/src/common/dcgraph.cpp +++ b/src/common/dcgraph.cpp @@ -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;