X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/1641cb376d295763dcc8bddfc01c8cca0e585332..9914bfbb77f48baf869b63aff58feb2b145ff4d3:/src/msw/dc.cpp diff --git a/src/msw/dc.cpp b/src/msw/dc.cpp index 54b5e781fa..675447fe3a 100644 --- a/src/msw/dc.cpp +++ b/src/msw/dc.cpp @@ -1772,17 +1772,21 @@ void wxMSWDCImpl::DoGetTextExtent(const wxString& string, wxCoord *x, wxCoord *y } #endif // !defined(_WIN32_WCE) || (_WIN32_WCE >= 400) - TEXTMETRIC tm; - ::GetTextMetrics(GetHdc(), &tm); - if (x) *x = sizeRect.cx; if (y) *y = sizeRect.cy; - if (descent) - *descent = tm.tmDescent; - if (externalLeading) - *externalLeading = tm.tmExternalLeading; + + if ( descent || externalLeading ) + { + TEXTMETRIC tm; + ::GetTextMetrics(GetHdc(), &tm); + + if (descent) + *descent = tm.tmDescent; + if (externalLeading) + *externalLeading = tm.tmExternalLeading; + } if ( hfontOld ) {