X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/e6777e6575eaf7bf47b72c5910e5a4b31efd97a1..b2a1c6f51bcc780387d6af5a789af43c3c52a4bb:/src/msw/dc.cpp diff --git a/src/msw/dc.cpp b/src/msw/dc.cpp index b5f8cd1298..c630843c67 100644 --- a/src/msw/dc.cpp +++ b/src/msw/dc.cpp @@ -1048,11 +1048,11 @@ void wxMSWDCImpl::DoDrawSpline(const wxPointList *points) lppt[ bezier_pos ] = lppt[ bezier_pos-1 ]; bezier_pos++; -#if !wxUSE_STL +#if !wxUSE_STD_CONTAINERS while ((node = node->GetNext()) != NULL) #else while ((node = node->GetNext())) -#endif // !wxUSE_STL +#endif // !wxUSE_STD_CONTAINERS { p = (wxPoint *)node->GetData(); x1 = x2; @@ -1722,6 +1722,31 @@ wxCoord wxMSWDCImpl::GetCharWidth() const return lpTextMetric.tmAveCharWidth; } +void wxMSWDCImpl::DoGetFontMetrics(int *height, + int *ascent, + int *descent, + int *internalLeading, + int *externalLeading, + int *averageWidth) const +{ + TEXTMETRIC tm; + + GetTextMetrics(GetHdc(), &tm); + + if ( height ) + *height = tm.tmHeight; + if ( ascent ) + *ascent = tm.tmAscent; + if ( descent ) + *descent = tm.tmDescent; + if ( internalLeading ) + *internalLeading = tm.tmInternalLeading; + if ( externalLeading ) + *externalLeading = tm.tmExternalLeading; + if ( averageWidth ) + *averageWidth = tm.tmAveCharWidth; +} + void wxMSWDCImpl::DoGetTextExtent(const wxString& string, wxCoord *x, wxCoord *y, wxCoord *descent, wxCoord *externalLeading, const wxFont *font) const @@ -1791,13 +1816,7 @@ void wxMSWDCImpl::DoGetTextExtent(const wxString& string, wxCoord *x, wxCoord *y if ( descent || externalLeading ) { - TEXTMETRIC tm; - ::GetTextMetrics(GetHdc(), &tm); - - if (descent) - *descent = tm.tmDescent; - if (externalLeading) - *externalLeading = tm.tmExternalLeading; + DoGetFontMetrics(NULL, NULL, descent, NULL, externalLeading, NULL); } if ( hfontOld )