fix Coverity issues

This commit is contained in:
wmayer
2016-08-21 23:13:22 +02:00
parent c2dd2e2b99
commit 9a38507c76
6 changed files with 98 additions and 99 deletions

View File

@@ -272,7 +272,7 @@ QVariant SheetModel::data(const QModelIndex &index, int role) const
const App::PropertyString * stringProp = static_cast<const App::PropertyString*>(prop);
switch (role) {
case Qt::TextColorRole:
case Qt::TextColorRole: // dead code!
return QVariant::fromValue(QColor(Qt::black));
case Qt::DisplayRole:
return QVariant(QString::fromUtf8(stringProp->getValue()));
@@ -296,7 +296,7 @@ QVariant SheetModel::data(const QModelIndex &index, int role) const
const App::PropertyQuantity * floatProp = static_cast<const App::PropertyQuantity*>(prop);
switch (role) {
case Qt::TextColorRole:
case Qt::TextColorRole: // dead code!
if (floatProp->getValue() < 0)
return QVariant::fromValue(QColor(Qt::red));
else
@@ -341,7 +341,7 @@ QVariant SheetModel::data(const QModelIndex &index, int role) const
const App::PropertyFloat * floatProp = static_cast<const App::PropertyFloat*>(prop);
switch (role) {
case Qt::TextColorRole:
case Qt::TextColorRole: // dead code!
if (floatProp->getValue() < 0)
return QVariant::fromValue(QColor(Qt::red));
else