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.
This commit is contained in:
Simon De Backer
2020-11-01 18:11:55 +01:00
parent 69adb10bcc
commit 41c7cde8ca

View File

@@ -1015,12 +1015,13 @@ bool Element::fromXml(
if(deti->textFrom()== DynamicElementTextItem::ElementInfo if(deti->textFrom()== DynamicElementTextItem::ElementInfo
&& deti->infoName() == "label") && deti->infoName() == "label")
{ {
qDebug() << "see 'Mod overlapping comparisons' in git";
qreal rotation = deti->rotation(); qreal rotation = deti->rotation();
//Create the comment item //Create the comment item
DynamicElementTextItem *comment_text = nullptr; DynamicElementTextItem *comment_text = nullptr;
if (m_link_type !=PreviousReport if (m_link_type != PreviousReport
|| m_link_type !=NextReport) && m_link_type != NextReport)
{ {
m_state = QET::GIOK; m_state = QET::GIOK;
return(true); return(true);
@@ -1041,7 +1042,8 @@ bool Element::fromXml(
} }
//create the location item //create the location item
DynamicElementTextItem *location_text = nullptr; 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; m_state = QET::GIOK;
return(true); return(true);
@@ -1061,8 +1063,8 @@ bool Element::fromXml(
} }
QPointF pos = deti->pos(); QPointF pos = deti->pos();
if (m_link_type !=PreviousReport if (m_link_type != PreviousReport
|| m_link_type !=NextReport) && m_link_type != NextReport)
{ {
m_state = QET::GIOK; m_state = QET::GIOK;
return(true); return(true);