From 437ee0c0385050f908731848b60941586c7067ca Mon Sep 17 00:00:00 2001 From: Manuel Nickschas Date: Wed, 12 Aug 2009 09:04:32 +0200 Subject: [PATCH] Make all color values work Note to self: shifting an uint without explicit typecast might well end up in a signed int. --- src/uisupport/qssparser.cpp | 4 ++-- src/uisupport/uistyle.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/uisupport/qssparser.cpp b/src/uisupport/qssparser.cpp index 1262be7e..48a1a064 100644 --- a/src/uisupport/qssparser.cpp +++ b/src/uisupport/qssparser.cpp @@ -289,9 +289,9 @@ quint64 QssParser::parseFormatType(const QString &decl) { return UiStyle::Invalid; } if(condName == "fg-color") - fmtType |= 0x00400000 | (col << 24); + fmtType |= 0x00400000 | (quint32)(col << 24); else - fmtType |= 0x00800000 | (col << 28); + fmtType |= 0x00800000 | (quint32)(col << 28); } else { qWarning() << Q_FUNC_INFO << tr("Unhandled condition: %1").arg(condName); return UiStyle::Invalid; diff --git a/src/uisupport/uistyle.cpp b/src/uisupport/uistyle.cpp index 0ebdf061..f0c7e9fa 100644 --- a/src/uisupport/uistyle.cpp +++ b/src/uisupport/uistyle.cpp @@ -457,10 +457,10 @@ UiStyle::StyledString UiStyle::styleString(const QString &s_, quint32 baseFormat color &= 0x0f; if(s[pos+3] == 'f') { curfmt &= 0xf0ffffff; - curfmt |= (color << 24) | 0x00400000; + curfmt |= (quint32)(color << 24) | 0x00400000; } else { curfmt &= 0x0fffffff; - curfmt |= (color << 28) | 0x00800000; + curfmt |= (quint32)(color << 28) | 0x00800000; } length = 6; } -- 2.20.1