]> git.saurik.com Git - wxWidgets.git/commitdiff
wxDC::GetTextExtent() checks that passed in x and y pointers are !NULL
authorVadim Zeitlin <vadim@wxwidgets.org>
Wed, 8 Jul 1998 22:27:17 +0000 (22:27 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Wed, 8 Jul 1998 22:27:17 +0000 (22:27 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@200 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/msw/dc.cpp

index ccafc052025a73b4bb22198a2d20ce8a227499fd..a9536f2fcc2f97bb0a7f607f1456888af29a5b65 100644 (file)
@@ -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;
 }
@@ -1365,4 +1365,3 @@ void wxDC::GetTextExtent(const wxString& string, float *x, float *y,
         *externalLeading = externalLeading1;
 }
 #endif
-