From 814c2307ee8d5c12655edaab2359c4d71a38bb58 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Sat, 18 Mar 2017 14:06:40 +0200 Subject: [PATCH] Refactoring. Minor changes. --HG-- branch : develop --- src/libs/ifc/xml/vabstractpattern.cpp | 7 +++---- src/libs/ifc/xml/vpatternconverter.cpp | 1 + src/libs/ifc/xml/vtoolrecord.cpp | 5 +++++ src/libs/ifc/xml/vvitconverter.cpp | 1 + src/libs/ifc/xml/vvstconverter.cpp | 1 + .../vtools/dialogs/tools/piece/dialogseamallowance.cpp | 2 +- 6 files changed, 12 insertions(+), 5 deletions(-) diff --git a/src/libs/ifc/xml/vabstractpattern.cpp b/src/libs/ifc/xml/vabstractpattern.cpp index 89f2345ce..4d6535325 100644 --- a/src/libs/ifc/xml/vabstractpattern.cpp +++ b/src/libs/ifc/xml/vabstractpattern.cpp @@ -1558,12 +1558,11 @@ void VAbstractPattern::InsertTag(const QStringList &tags, const QDomElement &ele for (int i = tags.indexOf(element.tagName())-1; i >= 0; --i) { const QDomNodeList list = elementsByTagName(tags.at(i)); - if (list.isEmpty()) + if (not list.isEmpty()) { - continue; + pattern.insertAfter(element, list.at(0)); + break; } - pattern.insertAfter(element, list.at(0)); - break; } SetVersion(); } diff --git a/src/libs/ifc/xml/vpatternconverter.cpp b/src/libs/ifc/xml/vpatternconverter.cpp index 6906379fb..aafd32345 100644 --- a/src/libs/ifc/xml/vpatternconverter.cpp +++ b/src/libs/ifc/xml/vpatternconverter.cpp @@ -212,6 +212,7 @@ QString VPatternConverter::XSDSchema(int ver) const InvalidVersion(ver); break; } + return QString();//unreachable code } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/libs/ifc/xml/vtoolrecord.cpp b/src/libs/ifc/xml/vtoolrecord.cpp index 4202c1f6e..29613afc4 100644 --- a/src/libs/ifc/xml/vtoolrecord.cpp +++ b/src/libs/ifc/xml/vtoolrecord.cpp @@ -62,6 +62,11 @@ bool VToolRecord::operator==(const VToolRecord &record) const //--------------------------------------------------------------------------------------------------------------------- VToolRecord &VToolRecord::operator=(const VToolRecord &record) { + if ( &record == this ) + { + return *this; + } + this->id = record.getId(); this->typeTool = record.getTypeTool(); this->nameDraw = record.getNameDraw(); diff --git a/src/libs/ifc/xml/vvitconverter.cpp b/src/libs/ifc/xml/vvitconverter.cpp index abf2f66ab..f33157411 100644 --- a/src/libs/ifc/xml/vvitconverter.cpp +++ b/src/libs/ifc/xml/vvitconverter.cpp @@ -92,6 +92,7 @@ QString VVITConverter::XSDSchema(int ver) const InvalidVersion(ver); break; } + return QString();//unreachable code } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/libs/ifc/xml/vvstconverter.cpp b/src/libs/ifc/xml/vvstconverter.cpp index a23a21280..5cc95dc4f 100644 --- a/src/libs/ifc/xml/vvstconverter.cpp +++ b/src/libs/ifc/xml/vvstconverter.cpp @@ -94,6 +94,7 @@ QString VVSTConverter::XSDSchema(int ver) const InvalidVersion(ver); break; } + return QString();//unreachable code } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/libs/vtools/dialogs/tools/piece/dialogseamallowance.cpp b/src/libs/vtools/dialogs/tools/piece/dialogseamallowance.cpp index b5af43c71..7fb12683a 100644 --- a/src/libs/vtools/dialogs/tools/piece/dialogseamallowance.cpp +++ b/src/libs/vtools/dialogs/tools/piece/dialogseamallowance.cpp @@ -46,7 +46,7 @@ #include #include -enum TabOrder {Paths=0, Labels=1, Grainline=2, Pins=3, Count}; +enum TabOrder {Paths=0, Labels=1, Grainline=2, Pins=3, Count=4}; namespace {