Clean-up of scroll.c (1/4)

Andrew Johnston johnstonam at logica.com
Tue Mar 4 02:41:08 CST 2003


On Saturday 01 March 2003 02:29, Alexandre Julliard wrote:
> Yes that's definitely what was intended. Though note that even with
> that fix the implementation is still not right, most of the GetScroll*
> functions should be sending messages to the window for the SB_CTL case
> instead of accessing the data structure directly.

I am not sure I understand correctly.  Sending a message to the window for
SB_CTL scroll bars seems to run the possibility of an infinite recursion.  The
message handling code simply uses the API functions.  Is the following what is desired?

Andrew

Index: controls/scroll.c
===================================================================
RCS file: /home/wine/wine/controls/scroll.c,v
retrieving revision 1.62
diff -u -r1.62 scroll.c
--- controls/scroll.c	14 Jan 2003 23:41:01 -0000	1.62
+++ controls/scroll.c	4 Mar 2003 07:50:54 -0000
@@ -1743,15 +1743,15 @@
 {
     SCROLLBAR_INFO *infoPtr;
 
-    if (!(infoPtr = SCROLL_GetScrollInfo( hwnd, nBar )))
+    /* Refer SB_CTL requests to the window */
+    if (!(infoPtr = SCROLL_GetScrollInfo(hwnd, nBar)) && nBar == SB_CTL)
+        return SendMessageA(hwnd, SBM_GETRANGE, (WPARAM)lpMin, (LPARAM)lpMax);
+    else
     {
-        if (lpMin) lpMin = 0;
-        if (lpMax) lpMax = 0;
-        return FALSE;
+        if (lpMin) *lpMin = infoPtr ? infoPtr->minVal : 0;
+        if (lpMax) *lpMax = infoPtr ? infoPtr->maxVal : 0;
     }
-    if (lpMin) *lpMin = infoPtr->minVal;
-    if (lpMax) *lpMax = infoPtr->maxVal;
-    return TRUE;
+    return infoPtr ? TRUE : FALSE;
 }


This e-mail and any attachment is for authorised use by the intended recipient(s) only.  It may contain proprietary material, confidential information and/or be subject to legal privilege.  It should not be copied, disclosed to, retained or used by, any other party.  If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender.  Thank you.



More information about the wine-devel mailing list