]> git.saurik.com Git - wxWidgets.git/commitdiff
fixed SetColumnWidth() in wxLC_LIST mode (set column to 0, not -1)
authorVadim Zeitlin <vadim@wxwidgets.org>
Mon, 21 Mar 2005 10:36:59 +0000 (10:36 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Mon, 21 Mar 2005 10:36:59 +0000 (10:36 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@32949 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/msw/listctrl.cpp

index 65ed0d1182eb435c0673727e190aff0263b508ab..2486ceef1273351368cdb1bd13ec9b48d9669af1 100644 (file)
@@ -671,17 +671,15 @@ int wxListCtrl::GetColumnWidth(int col) const
 // Sets the column width
 bool wxListCtrl::SetColumnWidth(int col, int width)
 {
-    int col2 = col;
     if ( m_windowStyle & wxLC_LIST )
-        col2 = -1;
+        col = 0;
 
-    int width2 = width;
-    if ( width2 == wxLIST_AUTOSIZE)
-        width2 = LVSCW_AUTOSIZE;
-    else if ( width2 == wxLIST_AUTOSIZE_USEHEADER)
-        width2 = LVSCW_AUTOSIZE_USEHEADER;
+    if ( width == wxLIST_AUTOSIZE)
+        width = LVSCW_AUTOSIZE;
+    else if ( width == wxLIST_AUTOSIZE_USEHEADER)
+        width = LVSCW_AUTOSIZE_USEHEADER;
 
-    return ListView_SetColumnWidth(GetHwnd(), col2, width2) != 0;
+    return ListView_SetColumnWidth(GetHwnd(), col, width) != 0;
 }
 
 // Gets the number of items that can fit vertically in the