From 41c7cde8ca5608970a1641e2ff4fd20a31593c6f Mon Sep 17 00:00:00 2001 From: Simon De Backer Date: Sun, 1 Nov 2020 18:11:55 +0100 Subject: [PATCH] Mod overlapping comparisons warning: overlapping comparisons always evaluate to true valid for a project made before 0.7 probably it will be better to delete the code completely. --- sources/qetgraphicsitem/element.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/sources/qetgraphicsitem/element.cpp b/sources/qetgraphicsitem/element.cpp index e12132489..401bf644d 100644 --- a/sources/qetgraphicsitem/element.cpp +++ b/sources/qetgraphicsitem/element.cpp @@ -1015,12 +1015,13 @@ bool Element::fromXml( if(deti->textFrom()== DynamicElementTextItem::ElementInfo && deti->infoName() == "label") { + qDebug() << "see 'Mod overlapping comparisons' in git"; qreal rotation = deti->rotation(); //Create the comment item DynamicElementTextItem *comment_text = nullptr; - if (m_link_type !=PreviousReport - || m_link_type !=NextReport) + if (m_link_type != PreviousReport + && m_link_type != NextReport) { m_state = QET::GIOK; return(true); @@ -1041,7 +1042,8 @@ bool Element::fromXml( } //create the location item DynamicElementTextItem *location_text = nullptr; - if (m_link_type !=PreviousReport || m_link_type !=NextReport) + if (m_link_type != PreviousReport + && m_link_type != NextReport) { m_state = QET::GIOK; return(true); @@ -1061,8 +1063,8 @@ bool Element::fromXml( } QPointF pos = deti->pos(); - if (m_link_type !=PreviousReport - || m_link_type !=NextReport) + if (m_link_type != PreviousReport + && m_link_type != NextReport) { m_state = QET::GIOK; return(true);