[Win32SS|RTL]
authorJames Tabor <james.tabor@reactos.org>
Tue, 17 Nov 2015 16:51:59 +0000 (16:51 +0000)
committerJames Tabor <james.tabor@reactos.org>
Tue, 17 Nov 2015 16:51:59 +0000 (16:51 +0000)
- Patch by Andrew Eikum : Use font default height if GetTextExtentPoint returns empty rectangle.
- Wine port sync.

svn path=/trunk/; revision=69926

reactos/win32ss/user/rtl/text.c

index e531170..b8cdfc7 100644 (file)
@@ -85,10 +85,17 @@ LONG TEXT_TabbedTextOut( HDC hdc,
     SIZE extent;
     int i, j;
     int start = x;
     SIZE extent;
     int i, j;
     int start = x;
+    TEXTMETRICW tm;
 
     if (!lpTabPos)
         cTabStops=0;
 
 
     if (!lpTabPos)
         cTabStops=0;
 
+#ifdef _WIN32K_
+    GreGetTextMetricsW( hdc, &tm );
+#else
+    GetTextMetricsW( hdc, &tm );
+#endif
+
     if (cTabStops == 1)
     {
         defWidth = *lpTabPos;
     if (cTabStops == 1)
     {
         defWidth = *lpTabPos;
@@ -96,13 +103,6 @@ LONG TEXT_TabbedTextOut( HDC hdc,
     }
     else
     {
     }
     else
     {
-#ifdef _WIN32K_
-        TEXTMETRICW tm;
-        GreGetTextMetricsW( hdc, &tm );
-#else
-        TEXTMETRICA tm;
-        GetTextMetricsA( hdc, &tm );
-#endif
         defWidth = 8 * tm.tmAveCharWidth;
     }
 
         defWidth = 8 * tm.tmAveCharWidth;
     }
 
@@ -178,6 +178,10 @@ LONG TEXT_TabbedTextOut( HDC hdc,
         count -= j;
         lpstr += j;
     }
         count -= j;
         lpstr += j;
     }
+
+    if(!extent.cy)
+        extent.cy = tm.tmHeight;
+
     return MAKELONG(x - start, extent.cy);
 }
 
     return MAKELONG(x - start, extent.cy);
 }