Alexandre Julliard : user32: Reimplement MapWindowPoints16 and move it to wnd16.c.

Alexandre Julliard julliard at winehq.org
Tue Dec 22 09:58:57 CST 2009


Module: wine
Branch: master
Commit: df3e5a87627d74daf0a3bef7060d1e6e44016f47
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=df3e5a87627d74daf0a3bef7060d1e6e44016f47

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Tue Dec 22 12:45:54 2009 +0100

user32: Reimplement MapWindowPoints16 and move it to wnd16.c.

---

 dlls/user32/winpos.c |   18 ------------------
 dlls/user32/wnd16.c  |   24 ++++++++++++++++++++++++
 2 files changed, 24 insertions(+), 18 deletions(-)

diff --git a/dlls/user32/winpos.c b/dlls/user32/winpos.c
index 915cb59..65e9389 100644
--- a/dlls/user32/winpos.c
+++ b/dlls/user32/winpos.c
@@ -507,24 +507,6 @@ static void WINPOS_GetWinOffset( HWND hwndFrom, HWND hwndTo, POINT *offset )
 
 
 /*******************************************************************
- *		MapWindowPoints (USER.258)
- */
-void WINAPI MapWindowPoints16( HWND16 hwndFrom, HWND16 hwndTo,
-                               LPPOINT16 lppt, UINT16 count )
-{
-    POINT offset;
-
-    WINPOS_GetWinOffset( WIN_Handle32(hwndFrom), WIN_Handle32(hwndTo), &offset );
-    while (count--)
-    {
-	lppt->x += offset.x;
-	lppt->y += offset.y;
-        lppt++;
-    }
-}
-
-
-/*******************************************************************
  *		MapWindowPoints (USER32.@)
  */
 INT WINAPI MapWindowPoints( HWND hwndFrom, HWND hwndTo, LPPOINT lppt, UINT count )
diff --git a/dlls/user32/wnd16.c b/dlls/user32/wnd16.c
index 6968683..dfcd71f 100644
--- a/dlls/user32/wnd16.c
+++ b/dlls/user32/wnd16.c
@@ -1260,6 +1260,30 @@ HWND16 WINAPI GetOpenClipboardWindow16(void)
 }
 
 
+/*******************************************************************
+ *		MapWindowPoints (USER.258)
+ */
+void WINAPI MapWindowPoints16( HWND16 hwndFrom, HWND16 hwndTo, LPPOINT16 lppt, UINT16 count )
+{
+    POINT buffer[8], *ppt = buffer;
+    UINT i;
+
+    if (count > 8) ppt = HeapAlloc( GetProcessHeap(), 0, count * sizeof(*ppt) );
+    for (i = 0; i < count; i++)
+    {
+        ppt[i].x = lppt[i].x;
+        ppt[i].y = lppt[i].y;
+    }
+    MapWindowPoints( WIN_Handle32(hwndFrom), WIN_Handle32(hwndTo), ppt, count );
+    for (i = 0; i < count; i++)
+    {
+        lppt[i].x = ppt[i].x;
+        lppt[i].y = ppt[i].y;
+    }
+    if (ppt != buffer) HeapFree( GetProcessHeap(), 0, ppt );
+}
+
+
 /**************************************************************************
  *              BeginDeferWindowPos   (USER.259)
  */




More information about the wine-cvs mailing list