From: Vadim Zeitlin Date: Sun, 12 Jul 1998 23:23:11 +0000 (+0000) Subject: GetTextExtent checks that passed pointers are not NULL X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/7d7fb17e1dc979524077205a006cd8a63631cb35 GetTextExtent checks that passed pointers are not NULL git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@251 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/msw/dc.cpp b/src/msw/dc.cpp index bdecb6b626..4f68df800e 100644 --- a/src/msw/dc.cpp +++ b/src/msw/dc.cpp @@ -914,8 +914,8 @@ void wxDC::GetTextExtent(const wxString& string, long *x, long *y, GetTextExtentPoint((HDC) m_hDC, (char *)(const char *) string, strlen((char *)(const char *) string), &sizeRect); GetTextMetrics((HDC) m_hDC, &tm); - *x = XDEV2LOGREL(sizeRect.cx); - *y = YDEV2LOGREL(sizeRect.cy); + if (x) *x = XDEV2LOGREL(sizeRect.cx); + if (y) *y = YDEV2LOGREL(sizeRect.cy); if (descent) *descent = tm.tmDescent; if (externalLeading) *externalLeading = tm.tmExternalLeading; }