Windows code: Add Q_FALLTHROUGH or break to unmarked fallthroughs seen by GCC 7

Rearrange code handling QtWindows::DisplayChangedEvent.

Change-Id: If9f32516108fb64c4a252c84392f2fd7f1872bf1
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
This commit is contained in:
Friedemann Kleint 2017-06-21 13:45:53 +02:00
parent 2087f120c3
commit 4f7be34a42
4 changed files with 7 additions and 6 deletions

View File

@ -925,9 +925,9 @@ bool QWindowsContext::windowsProc(HWND hwnd, UINT message,
return false; return false;
#endif #endif
case QtWindows::DisplayChangedEvent: case QtWindows::DisplayChangedEvent:
return d->m_screenManager.handleDisplayChange(wParam, lParam);
if (QWindowsTheme *t = QWindowsTheme::instance()) if (QWindowsTheme *t = QWindowsTheme::instance())
t->displayChanged(); t->displayChanged();
return d->m_screenManager.handleDisplayChange(wParam, lParam);
case QtWindows::SettingChangedEvent: case QtWindows::SettingChangedEvent:
return d->m_screenManager.handleScreenChanges(); return d->m_screenManager.handleScreenChanges();
default: default:

View File

@ -1008,6 +1008,7 @@ bool QWindowsKeyMapper::translateKeyEventInternal(QWindow *window, const MSG &ms
state |= ((msg.wParam >= '0' && msg.wParam <= '9') state |= ((msg.wParam >= '0' && msg.wParam <= '9')
|| (msg.wParam >= VK_OEM_PLUS && msg.wParam <= VK_OEM_3)) || (msg.wParam >= VK_OEM_PLUS && msg.wParam <= VK_OEM_3))
? 0 : int(Qt::KeypadModifier); ? 0 : int(Qt::KeypadModifier);
Q_FALLTHROUGH();
default: default:
if (uint(msg.lParam) == 0x004c0001 || uint(msg.lParam) == 0xc04c0001) if (uint(msg.lParam) == 0x004c0001 || uint(msg.lParam) == 0xc04c0001)
state |= Qt::KeypadModifier; state |= Qt::KeypadModifier;

View File

@ -2153,6 +2153,7 @@ QRect QWindowsVistaStyle::subControlRect(ComplexControl control, const QStyleOpt
rect = visualRect(cb->direction, cb->rect, rect); rect = visualRect(cb->direction, cb->rect, rect);
return rect; return rect;
} }
break;
#endif // QT_NO_COMBOBOX #endif // QT_NO_COMBOBOX
case CC_TitleBar: case CC_TitleBar:
if (const QStyleOptionTitleBar *tb = qstyleoption_cast<const QStyleOptionTitleBar *>(option)) { if (const QStyleOptionTitleBar *tb = qstyleoption_cast<const QStyleOptionTitleBar *>(option)) {

View File

@ -1509,11 +1509,10 @@ case PE_Frame:
return; return;
} else if (fillType == BT_NONE) { } else if (fillType == BT_NONE) {
return; return;
} else { }
}
break; break;
} }
}
}
case PE_FrameLineEdit: { case PE_FrameLineEdit: {
// we try to check if this lineedit is a delegate on a QAbstractItemView-derived class. // we try to check if this lineedit is a delegate on a QAbstractItemView-derived class.
if (QWindowsXPStylePrivate::isItemViewDelegateLineEdit(widget)) { if (QWindowsXPStylePrivate::isItemViewDelegateLineEdit(widget)) {
@ -2428,6 +2427,7 @@ void QWindowsXPStyle::drawControl(ControlElement element, const QStyleOption *op
p->restore(); p->restore();
return; return;
} }
break;
#endif // QT_NO_RUBBERBAND #endif // QT_NO_RUBBERBAND
case CE_HeaderEmptyArea: case CE_HeaderEmptyArea:
if (option->state & State_Horizontal) if (option->state & State_Horizontal)
@ -3754,10 +3754,9 @@ int QWindowsXPStyle::styleHint(StyleHint hint, const QStyleOption *option, const
break; break;
#ifndef QT_NO_RUBBERBAND #ifndef QT_NO_RUBBERBAND
case SH_RubberBand_Mask: case SH_RubberBand_Mask:
if (qstyleoption_cast<const QStyleOptionRubberBand *>(option)) { if (qstyleoption_cast<const QStyleOptionRubberBand *>(option))
res = 0; res = 0;
break; break;
}
#endif // QT_NO_RUBBERBAND #endif // QT_NO_RUBBERBAND
case SH_ItemView_DrawDelegateFrame: case SH_ItemView_DrawDelegateFrame: