Index: trunk/src/gdi32/gdi32.cpp
===================================================================
--- trunk/src/gdi32/gdi32.cpp	(revision 135)
+++ trunk/src/gdi32/gdi32.cpp	(revision 136)
@@ -1,3 +1,3 @@
-/* $Id: gdi32.cpp,v 1.5 1999-06-17 23:13:47 phaller Exp $ */
+/* $Id: gdi32.cpp,v 1.6 1999-06-20 18:17:31 buerkle Exp $ */
 
 /*
@@ -126,4 +126,5 @@
  BOOL rc;
 
+  lpSize->cx = lpSize->cy = 0;
   rc = O32_GetTextExtentPoint(hdc, lpsz, cbString, lpSize);
   dprintf(("GDI32: GetTextExtentPointA of %s returned %d\n", lpsz, rc));
@@ -1422,12 +1423,13 @@
 //******************************************************************************
 //******************************************************************************
-BOOL WIN32API GetTextExtentPoint32A( HDC arg1, LPCSTR arg2, int arg3, PSIZE  arg4)
+BOOL WIN32API GetTextExtentPoint32A( HDC arg1, LPCSTR arg2, int arg3, PSIZE  lpSize)
 {
     dprintf(("GDI32: OS2GetTextExtentPoint32A"));
-    return O32_GetTextExtentPoint32(arg1, arg2, arg3, arg4);
-}
-//******************************************************************************
-//******************************************************************************
-BOOL WIN32API GetTextExtentPoint32W(HDC arg1, LPCWSTR arg2, int arg3, PSIZE  arg4)
+    lpSize->cx = lpSize->cy = 0;
+    return O32_GetTextExtentPoint32(arg1, arg2, arg3, lpSize);
+}
+//******************************************************************************
+//******************************************************************************
+BOOL WIN32API GetTextExtentPoint32W(HDC arg1, LPCWSTR arg2, int arg3, PSIZE lpSize)
 {
  char *astring = UnicodeToAsciiString((LPWSTR)arg2);
@@ -1435,5 +1437,6 @@
 
     dprintf(("GDI32: OS2GetTextExtentPoint32W %s\n", astring));
-    rc = O32_GetTextExtentPoint32(arg1, astring, arg3, arg4);
+    lpSize->cx = lpSize->cy = 0;
+    rc = O32_GetTextExtentPoint32(arg1, astring, arg3, lpSize);
     FreeAsciiString(astring);
     return(rc);
@@ -1446,7 +1449,8 @@
                                   PSIZE  lpSize)
 {
- char *astring = UnicodeToAsciiString((LPWSTR)lpString);
- BOOL  rc;
-
+  char *astring = UnicodeToAsciiString((LPWSTR)lpString);
+  BOOL  rc;
+
+  lpSize->cx = lpSize->cy = 0;
   rc = O32_GetTextExtentPoint(hdc,
                          astring,
@@ -2388,15 +2392,38 @@
 //******************************************************************************
 BOOL WIN32API GetTextExtentExPointA(/*KSO Thu 21.05.1998*/
-        HDC     arg1,
-        LPCSTR  arg2,
-        int             arg3,
-        int             arg4,
-        LPINT   arg5,
-        LPINT   arg6,
-        LPSIZE  arg7
-        )
-{
-        dprintf(("GDI32: GetTextExtendExPointA - stub\n"));
-        return FALSE;
+        HDC     hdc,
+        LPCSTR  str,
+        int     count,
+        int     maxExt,
+        LPINT   lpnFit,
+        LPINT   alpDx,
+        LPSIZE  size)
+{
+    int index, nFit, extent;
+    SIZE tSize;
+
+    dprintf(("GDI32: GetTextExtendExPointA\n"));
+
+    size->cx = size->cy = nFit = extent = 0;
+    for(index = 0; index < count; index++)
+    {
+      if(!O32_GetTextExtentPoint( hdc, str, 1, &tSize )) return FALSE;
+      if( extent+tSize.cx < maxExt )
+      {
+        extent+=tSize.cx;
+        nFit++;
+        str++;
+        if( alpDx )
+          alpDx[index] = extent;
+        if( tSize.cy > size->cy ) size->cy = tSize.cy;
+      }
+      else break;
+    }
+    size->cx = extent;
+    *lpnFit = nFit;
+
+    dprintf(("GDI32: GetTextExtendExPointA(%08x '%.*s' %d) returning %d %d %d\n",
+             hdc,count,str,maxExt,nFit, size->cx,size->cy));
+    return TRUE;
 }
 //******************************************************************************
@@ -2412,6 +2439,11 @@
         )
 {
-        dprintf(("GDI32: GetTextExtendExPointW - stub\n"));
-        return FALSE;
+  char *astring = UnicodeToAsciiString((LPWSTR)arg2);
+  BOOL  rc;
+
+  dprintf(("GDI32: GetTextExtendExPointW\n"));
+  rc = GetTextExtentExPointA(arg1, astring, arg3, arg4, arg5, arg6, arg7);
+  FreeAsciiString(astring);
+  return rc;
 }
 //******************************************************************************
