More use of wxFALLTHROUGH in MSW code and samples

This commit is contained in:
Maarten Bent
2017-11-25 17:48:37 +01:00
parent 6315ae04fb
commit afc02a34ee
11 changed files with 27 additions and 2 deletions

View File

@@ -1344,8 +1344,9 @@ void MyListCtrl::OnListKeyDown(wxListEvent& event)
{
InsertItemInReportView(event.GetIndex());
}
break;
}
//else: fall through
wxFALLTHROUGH;
default:
LogEvent(event, wxT("OnListKeyDown"));

View File

@@ -3932,6 +3932,7 @@ void wxDataViewMainWindow::OnChar( wxKeyEvent &event )
break;
}
// else: fall through to WXK_F2 handling
wxFALLTHROUGH;
}
case WXK_F2:

View File

@@ -664,6 +664,7 @@ void wxVListBox::OnKeyDown(wxKeyEvent& event)
// events for the tabs on MSW
HandleAsNavigationKey(event);
// fall through to default
wxFALLTHROUGH;
#endif
default:
event.Skip();

View File

@@ -329,6 +329,7 @@ bool wxComboBox::MSWCommand(WXUINT param, WXWORD id)
// fall through: for compatibility with wxGTK, also send the text
// update event when the selection changes (this also seems more
// logical as the text does change)
wxFALLTHROUGH;
case CBN_EDITCHANGE:
if ( m_allowTextEvents )

View File

@@ -182,6 +182,7 @@ wxFontEncoding wxGetFontEncFromCharSet(int cs)
default:
wxFAIL_MSG( wxT("unexpected Win32 charset") );
// fall through and assume the system charset
wxFALLTHROUGH;
case DEFAULT_CHARSET:
fontEncoding = wxFONTENCODING_SYSTEM;

View File

@@ -95,6 +95,7 @@ wxBuddyTextWndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
if ( (WXHWND)wParam == spin->GetHWND() )
break;
//else: fall through
wxFALLTHROUGH;
case WM_KILLFOCUS:
case WM_CHAR:

View File

@@ -460,6 +460,7 @@ public:
if ( image != -1 )
break;
//else: fall through
wxFALLTHROUGH;
case wxTreeItemIcon_Selected:
case wxTreeItemIcon_Expanded:

View File

@@ -1090,6 +1090,7 @@ wxString wxGetOsDescription()
break;
}
//else: must be XP, fall through
wxFALLTHROUGH;
case 1:
str = "Windows XP";

View File

@@ -988,10 +988,11 @@ long wxExecute(const wxString& cmd, int flags, wxProcess *handler,
{
default:
wxFAIL_MSG( wxT("unexpected WaitForInputIdle() return code") );
// fall through
wxFALLTHROUGH;
case WAIT_FAILED:
wxLogLastError(wxT("WaitForInputIdle() in wxExecute"));
wxFALLTHROUGH;
case WAIT_TIMEOUT:
wxLogDebug(wxT("Timeout too small in WaitForInputIdle"));

View File

@@ -5075,8 +5075,10 @@ bool wxWindowMSW::HandleSize(int WXUNUSED(w), int WXUNUSED(h), WXUINT wParam)
default:
wxFAIL_MSG( wxT("unexpected WM_SIZE parameter") );
// fall through nevertheless
wxFALLTHROUGH;
case SIZE_MAXHIDE:
wxFALLTHROUGH;
case SIZE_MAXSHOW:
// we're not interested in these messages at all
break;
@@ -5088,6 +5090,7 @@ bool wxWindowMSW::HandleSize(int WXUNUSED(w), int WXUNUSED(h), WXUINT wParam)
case SIZE_MAXIMIZED:
/* processed = */ HandleMaximize();
// fall through to send a normal size event as well
wxFALLTHROUGH;
case SIZE_RESTORED:
// don't use w and h parameters as they specify the client size
@@ -5097,6 +5100,7 @@ bool wxWindowMSW::HandleSize(int WXUNUSED(w), int WXUNUSED(h), WXUINT wParam)
event.SetEventObject(this);
processed = HandleWindowEvent(event);
break;
}
return processed;
@@ -6195,60 +6199,70 @@ WXWORD WXToVK(int wxk, bool *isExtended)
{
case WXK_PAGEUP:
extended = true;
wxFALLTHROUGH;
case WXK_NUMPAD_PAGEUP:
vk = VK_PRIOR;
break;
case WXK_PAGEDOWN:
extended = true;
wxFALLTHROUGH;
case WXK_NUMPAD_PAGEDOWN:
vk = VK_NEXT;
break;
case WXK_END:
extended = true;
wxFALLTHROUGH;
case WXK_NUMPAD_END:
vk = VK_END;
break;
case WXK_HOME:
extended = true;
wxFALLTHROUGH;
case WXK_NUMPAD_HOME:
vk = VK_HOME;
break;
case WXK_LEFT:
extended = true;
wxFALLTHROUGH;
case WXK_NUMPAD_LEFT:
vk = VK_LEFT;
break;
case WXK_UP:
extended = true;
wxFALLTHROUGH;
case WXK_NUMPAD_UP:
vk = VK_UP;
break;
case WXK_RIGHT:
extended = true;
wxFALLTHROUGH;
case WXK_NUMPAD_RIGHT:
vk = VK_RIGHT;
break;
case WXK_DOWN:
extended = true;
wxFALLTHROUGH;
case WXK_NUMPAD_DOWN:
vk = VK_DOWN;
break;
case WXK_INSERT:
extended = true;
wxFALLTHROUGH;
case WXK_NUMPAD_INSERT:
vk = VK_INSERT;
break;
case WXK_DELETE:
extended = true;
wxFALLTHROUGH;
case WXK_NUMPAD_DELETE:
vk = VK_DELETE;
break;
@@ -6264,6 +6278,7 @@ WXWORD WXToVK(int wxk, bool *isExtended)
{
vk = (WXWORD)wxk;
}
break;
}
if ( isExtended )

View File

@@ -1628,6 +1628,7 @@ void wxRibbonMSWArtProvider::DrawScrollButton(
{
case wxRIBBON_SCROLL_BTN_LEFT:
rect.x++;
wxFALLTHROUGH;
case wxRIBBON_SCROLL_BTN_RIGHT:
rect.y--;
rect.width--;