Avoid -Wswitch gcc warning in wxQt wxNativeFontInfo::SetStyle()
Explicitly handle wxFONTSTYLE_MAX, even if it's just to assert that it's unexpected here.
This commit is contained in:
@@ -513,18 +513,28 @@ void wxNativeFontInfo::SetPixelSize(const wxSize& size)
|
|||||||
|
|
||||||
void wxNativeFontInfo::SetStyle(wxFontStyle style)
|
void wxNativeFontInfo::SetStyle(wxFontStyle style)
|
||||||
{
|
{
|
||||||
switch(style)
|
QFont::Style qtStyle;
|
||||||
|
|
||||||
|
switch ( style )
|
||||||
{
|
{
|
||||||
case wxFONTSTYLE_ITALIC:
|
case wxFONTSTYLE_ITALIC:
|
||||||
m_qtFont.setStyle(QFont::StyleItalic);
|
qtStyle = QFont::StyleItalic;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case wxFONTSTYLE_NORMAL:
|
case wxFONTSTYLE_NORMAL:
|
||||||
m_qtFont.setStyle(QFont::StyleNormal);
|
qtStyle = QFont::StyleNormal;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case wxFONTSTYLE_SLANT:
|
case wxFONTSTYLE_SLANT:
|
||||||
m_qtFont.setStyle(QFont::StyleOblique);
|
qtStyle = QFont::StyleOblique;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case wxFONTSTYLE_MAX:
|
||||||
|
wxFAIL_MSG("unknown font style");
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
m_qtFont.setStyle(qtStyle);
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxNativeFontInfo::SetNumericWeight(int weight)
|
void wxNativeFontInfo::SetNumericWeight(int weight)
|
||||||
|
Reference in New Issue
Block a user