From: Vadim Zeitlin Date: Mon, 21 Mar 2005 10:36:59 +0000 (+0000) Subject: fixed SetColumnWidth() in wxLC_LIST mode (set column to 0, not -1) X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/514ee25088a3d769ebfc9609797798fc99b3f07e fixed SetColumnWidth() in wxLC_LIST mode (set column to 0, not -1) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@32949 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/msw/listctrl.cpp b/src/msw/listctrl.cpp index 65ed0d1182..2486ceef12 100644 --- a/src/msw/listctrl.cpp +++ b/src/msw/listctrl.cpp @@ -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