Fix last commit

Sorry - too tired ;)
This commit is contained in:
Martin Kleusberg
2019-11-06 21:27:28 +01:00
parent dd6de9479a
commit 15051ed0ee
2 changed files with 4 additions and 4 deletions

View File

@@ -99,11 +99,11 @@ std::string CondFormat::filterToSqlCondition(const QString& value, const QString
op = value.left(2);
val = value.mid(2);
}
} else if(value.at(0) == ">" || value.at(0) == "<") {
} else if(value.left(1) == ">" || value.left(1) == "<") {
value.midRef(1).toFloat(&numeric);
op = value.at(0);
val = value.mid(1);
} else if(value.at(0) == "=") {
} else if(value.left(1) == "=") {
val = value.mid(1);
// Check if value to compare with is 'NULL'
@@ -117,7 +117,7 @@ std::string CondFormat::filterToSqlCondition(const QString& value, const QString
op = "IS";
numeric = true;
}
} else if(value.at(0) == "/" && value.back() == "/" && value.size() > 2) {
} else if(value.left(1) == "/" && value.right(1) == "/" && value.size() > 2) {
val = value.mid(1, value.length() - 2);
op = "REGEXP";
numeric = false;

View File

@@ -339,7 +339,7 @@ void PreferencesDialog::saveSettings()
void PreferencesDialog::showColourDialog(QTreeWidgetItem* item, int column)
{
if(item->text(column).at(0) != "#")
if(item->text(column).left(1) != "#")
return;
QColor colour = QColorDialog::getColor(QColor(item->text(column)), this);