diff --git a/src/msw/listctrl.cpp b/src/msw/listctrl.cpp index 91d0985bf4..7e2512a7ad 100644 --- a/src/msw/listctrl.cpp +++ b/src/msw/listctrl.cpp @@ -1223,16 +1223,23 @@ bool wxListCtrl::GetSubItemRect(long item, long subItem, wxRect& rect, int code) wxT("invalid item in GetSubItemRect") ); int codeWin; - if ( code == wxLIST_RECT_BOUNDS ) - codeWin = LVIR_BOUNDS; - else if ( code == wxLIST_RECT_ICON ) - codeWin = LVIR_ICON; - else if ( code == wxLIST_RECT_LABEL ) - codeWin = LVIR_LABEL; - else + switch ( code ) { - wxFAIL_MSG( wxT("incorrect code in GetItemRect() / GetSubItemRect()") ); - codeWin = LVIR_BOUNDS; + case wxLIST_RECT_BOUNDS: + codeWin = LVIR_BOUNDS; + break; + + case wxLIST_RECT_ICON: + codeWin = LVIR_ICON; + break; + + case wxLIST_RECT_LABEL: + codeWin = LVIR_LABEL; + break; + + default: + wxFAIL_MSG( wxT("incorrect code in GetItemRect() / GetSubItemRect()") ); + return false; } RECT rectWin;