user32: Refactor of WINPOS_GetMinMaxInfo (Step 2)

Florian Köberle florian at fkoeberle.de
Sun Nov 16 09:29:37 CST 2008


The first two removed lines remove the styles
WS_DLGFRAME, WS_BORDER and WS_THICKFAME
This was a hack to prevent the other removed lines
from being executed.
---
 dlls/user32/winpos.c |   30 ++----------------------------
 1 files changed, 2 insertions(+), 28 deletions(-)

diff --git a/dlls/user32/winpos.c b/dlls/user32/winpos.c
index 79b66b0..4f0c99f 100644
--- a/dlls/user32/winpos.c
+++ b/dlls/user32/winpos.c
@@ -673,40 +673,14 @@ void WINPOS_GetMinMaxInfo( HWND hwnd, POINT *maxSize, POINT *maxPos,
         GetClientRect(GetAncestor(hwnd,GA_PARENT), &rc);
         AdjustWindowRectEx(&rc, style, ((style & WS_POPUP) && GetMenu(hwnd)), exstyle);
 
-        /* avoid calculating this twice */
-        style &= ~(WS_DLGFRAME | WS_BORDER | WS_THICKFRAME);
-
         MinMax.ptMaxSize.x = rc.right - rc.left;
         MinMax.ptMaxSize.y = rc.bottom - rc.top;
         MinMax.ptMinTrackSize.x = GetSystemMetrics(SM_CXMINTRACK);
         MinMax.ptMinTrackSize.y = GetSystemMetrics(SM_CYMINTRACK);
         MinMax.ptMaxTrackSize.x = GetSystemMetrics(SM_CXMAXTRACK);
         MinMax.ptMaxTrackSize.y = GetSystemMetrics(SM_CYMAXTRACK);
-
-        if (HAS_DLGFRAME( style, exstyle ))
-        {
-            xinc = GetSystemMetrics(SM_CXDLGFRAME);
-            yinc = GetSystemMetrics(SM_CYDLGFRAME);
-        }
-        else
-        {
-            xinc = yinc = 0;
-            if (HAS_THICKFRAME(style))
-            {
-                xinc += GetSystemMetrics(SM_CXFRAME);
-                yinc += GetSystemMetrics(SM_CYFRAME);
-            }
-            if (style & WS_BORDER)
-            {
-                xinc += GetSystemMetrics(SM_CXBORDER);
-                yinc += GetSystemMetrics(SM_CYBORDER);
-            }
-        }
-        MinMax.ptMaxSize.x += 2 * xinc;
-        MinMax.ptMaxSize.y += 2 * yinc;
-
-        MinMax.ptMaxPosition.x = -xinc;
-        MinMax.ptMaxPosition.y = -yinc;
+        MinMax.ptMaxPosition.x = 0;
+        MinMax.ptMaxPosition.y = 0;
     }
     else
     {
-- 
1.5.4.3


--------------070301060608080507000001--



More information about the wine-patches mailing list