First Patch (setfocus in IP Address control, dlls/comctl32/ipaddress.c)--Please correct me on procedure/etiquette

Alex Zorach / Sustainable Computing info at suscomputing.com
Wed Jun 8 12:16:41 CDT 2005


Hello!

This patch corrects the behaviour of the IP Address control to conform 
to Windows behaviour--as tested with Microsoft's ControlSpy on Windows 
2000, and also reduces the code size.

Previously, the SetFocus method would reset the index to 0 due to a bug 
in the conditional statement causing it to always be true.  The first 
for loop was also unnecessary--windows does not check to see if there is 
any text in the fields.  As far as I have tested, this now behaves the 
way it should.

--Alex Zorach
info at suscomputing.com

diff -u -r1.41 ipaddress.c
--- dlls/comctl32/ipaddress.c   9 May 2005 09:24:05 -0000       1.41
+++ dlls/comctl32/ipaddress.c   8 Jun 2005 16:50:22 -0000
@@ -346,11 +346,7 @@
 {
     TRACE("(index=%d)\n", index);

-    if (index > 3) {
-       for (index = 0; index < 4; index++)
-           if (!GetWindowTextLengthW(infoPtr->Part[index].EditHwnd)) break;
-    }
-    if (index < 9 || index > 3) index = 0;
+    if (index > 3 || index < 0) index=0;

     SetFocus (infoPtr->Part[index].EditHwnd);
 }





More information about the wine-patches mailing list