]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/dc.cpp
Swap client data pointers in wxRearrangeList too.
[wxWidgets.git] / src / msw / dc.cpp
index 54b5e781fa6614e1e4497225a042bb375101e528..675447fe3a235d07d1d32c3c551033503dbf97fc 100644 (file)
@@ -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 )
     {