From 8ab0ebeb122402aea4128429c5b9a701597f026e Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Mon, 6 Jan 2020 18:33:37 +0200 Subject: [PATCH] Cppcheck warning. --HG-- branch : release --- .../vtools/dialogs/tools/dialoglineintersect.cpp | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/src/libs/vtools/dialogs/tools/dialoglineintersect.cpp b/src/libs/vtools/dialogs/tools/dialoglineintersect.cpp index 06c1330e9..a28588457 100644 --- a/src/libs/vtools/dialogs/tools/dialoglineintersect.cpp +++ b/src/libs/vtools/dialogs/tools/dialoglineintersect.cpp @@ -229,17 +229,8 @@ void DialogLineIntersect::PointNameChanged() QPointF fPoint; QLineF::IntersectType intersect = line1.intersect(line2, &fPoint); - QColor color = okColor; - if (set.size() < 3 || intersect == QLineF::NoIntersection) - { - flagError = false; - color = errorColor; - } - else - { - flagError = true; - color = okColor; - } + flagError = not (set.size() < 3 || intersect == QLineF::NoIntersection); + QColor color = flagError ? okColor : errorColor; ChangeColor(ui->labelP1Line1, color); ChangeColor(ui->labelP2Line1, color); ChangeColor(ui->labelP1Line2, color);