Florian Köberle : user32: Refactor of WINPOS_GetMinMaxInfo.

Alexandre Julliard julliard at winehq.org
Fri Jan 23 10:06:59 CST 2009


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

Author: Florian Köberle <florian at fkoeberle.de>
Date:   Tue Jan 20 13:52:35 2009 +0100

user32: Refactor of WINPOS_GetMinMaxInfo.

Moved and duplicated the code below the "if child" statement into the
if and else block.

---

 dlls/user32/winpos.c |   59 +++++++++++++++++++++++++++++++------------------
 1 files changed, 37 insertions(+), 22 deletions(-)

diff --git a/dlls/user32/winpos.c b/dlls/user32/winpos.c
index d680cc1..54eb34b 100644
--- a/dlls/user32/winpos.c
+++ b/dlls/user32/winpos.c
@@ -681,39 +681,54 @@ void WINPOS_GetMinMaxInfo( HWND hwnd, POINT *maxSize, POINT *maxPos,
 
         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;
+        }
+        MinMax.ptMaxSize.x += 2 * xinc;
+        MinMax.ptMaxSize.y += 2 * yinc;
     }
     else
     {
         MinMax.ptMaxSize.x = GetSystemMetrics(SM_CXSCREEN);
         MinMax.ptMaxSize.y = GetSystemMetrics(SM_CYSCREEN);
-    }
-    MinMax.ptMinTrackSize.x = GetSystemMetrics(SM_CXMINTRACK);
-    MinMax.ptMinTrackSize.y = GetSystemMetrics(SM_CYMINTRACK);
-    MinMax.ptMaxTrackSize.x = GetSystemMetrics(SM_CXMAXTRACK);
-    MinMax.ptMaxTrackSize.y = GetSystemMetrics(SM_CYMAXTRACK);
+        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))
+        if (HAS_DLGFRAME( style, exstyle ))
         {
-            xinc += GetSystemMetrics(SM_CXFRAME);
-            yinc += GetSystemMetrics(SM_CYFRAME);
+            xinc = GetSystemMetrics(SM_CXDLGFRAME);
+            yinc = GetSystemMetrics(SM_CYDLGFRAME);
         }
-        if (style & WS_BORDER)
+        else
         {
-            xinc += GetSystemMetrics(SM_CXBORDER);
-            yinc += GetSystemMetrics(SM_CYBORDER);
+            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.ptMaxSize.x += 2 * xinc;
-    MinMax.ptMaxSize.y += 2 * yinc;
-
     MinMax.ptMaxPosition.x = -xinc;
     MinMax.ptMaxPosition.y = -yinc;
     if ((win = WIN_GetPtr( hwnd )) && win != WND_DESKTOP && win != WND_OTHER_PROCESS)




More information about the wine-cvs mailing list