From: Jan Alexander Steffens (heftig) Date: Thu, 19 Jul 2018 21:00:52 +0000 (+0200) Subject: QssParser: Don't interpret `font: normal` as weight 0 X-Git-Tag: 0.13-rc2~89 X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=commitdiff_plain;h=014e8f47c58a316b78cfa8960d0791546b3cd872 QssParser: Don't interpret `font: normal` as weight 0 It fell through to the unchecked int conversion. Also handle "strikethrough" and don't forget to reset the underline style. --- diff --git a/src/uisupport/qssparser.cpp b/src/uisupport/qssparser.cpp index 166648f1..ff47c05f 100644 --- a/src/uisupport/qssparser.cpp +++ b/src/uisupport/qssparser.cpp @@ -721,13 +721,19 @@ void QssParser::parseFont(const QString &value, QTextCharFormat *format) return; } format->setFontItalic(false); + format->setFontUnderline(false); + format->setFontStrikeOut(false); format->setFontWeight(QFont::Normal); QStringList proplist = rx.cap(1).split(' ', QString::SkipEmptyParts); foreach(QString prop, proplist) { - if (prop == "italic") + if (prop == "normal") + ; // pass + else if (prop == "italic") format->setFontItalic(true); else if (prop == "underline") format->setFontUnderline(true); + else if (prop == "strikethrough") + format->setFontStrikeOut(true); else if(prop == "oblique") // Oblique is not a property supported by QTextCharFormat format->setFontItalic(true);