]> git.saurik.com Git - wxWidgets.git/commitdiff
Fix VC6 compilation after r73880.
authorVadim Zeitlin <vadim@wxwidgets.org>
Mon, 29 Apr 2013 23:53:15 +0000 (23:53 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Mon, 29 Apr 2013 23:53:15 +0000 (23:53 +0000)
Work around the broken scoping for the variables declared inside for loops in
this compiler by declaring the loop variable once for all loops.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@73881 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/msw/bmpcbox.cpp

index bdd42ed970804faf1e8323adea01b1feb9e217d4..e81db2d2ddd871d9708d1096cbf924d92de1205f 100644 (file)
@@ -135,6 +135,7 @@ void wxBitmapComboBox::RecreateControl()
     size.y = GetBestSize().y;
     const wxArrayString strings = GetStrings();
     const unsigned numItems = strings.size();
+    unsigned i;
 
     // Save the client data pointers before clearing the control, if any.
     const wxClientDataType clientDataType = GetClientDataType();
@@ -147,14 +148,14 @@ void wxBitmapComboBox::RecreateControl()
 
         case wxClientData_Object:
             objectClientData.reserve(numItems);
-            for ( unsigned n = 0; n < numItems; ++n )
-                objectClientData.push_back(GetClientObject(n));
+            for ( i = 0; i < numItems; ++i )
+                objectClientData.push_back(GetClientObject(i));
             break;
 
         case wxClientData_Void:
             voidClientData.reserve(numItems);
-            for ( unsigned n = 0; n < numItems; ++n )
-                voidClientData.push_back(GetClientData(n));
+            for ( i = 0; i < numItems; ++i )
+                voidClientData.push_back(GetClientData(i));
             break;
     }
 
@@ -168,7 +169,7 @@ void wxBitmapComboBox::RecreateControl()
         return;
 
     // initialize the controls contents
-    for ( unsigned int i = 0; i < numItems; i++ )
+    for ( i = 0; i < numItems; i++ )
     {
         wxComboBox::Append(strings[i]);