diff --git a/src/libs/ifc/xml/vabstractpattern.cpp b/src/libs/ifc/xml/vabstractpattern.cpp index 9f4f61d99..5c6d07e17 100644 --- a/src/libs/ifc/xml/vabstractpattern.cpp +++ b/src/libs/ifc/xml/vabstractpattern.cpp @@ -768,11 +768,14 @@ VPieceNode VAbstractPattern::ParseSANode(const QDomElement &domElement) const QString t = VDomDocument::GetParametrString(domElement, AttrType, VAbstractPattern::NodePoint); Tool tool; - const QStringList types = QStringList() << VAbstractPattern::NodePoint - << VAbstractPattern::NodeArc - << VAbstractPattern::NodeSpline - << VAbstractPattern::NodeSplinePath - << VAbstractPattern::NodeElArc; + const QStringList types + { + VAbstractPattern::NodePoint, + VAbstractPattern::NodeArc, + VAbstractPattern::NodeSpline, + VAbstractPattern::NodeSplinePath, + VAbstractPattern::NodeElArc + }; switch (types.indexOf(t)) { diff --git a/src/libs/vformat/vmeasurements.cpp b/src/libs/vformat/vmeasurements.cpp index 9cc6bd792..03dff7a4d 100644 --- a/src/libs/vformat/vmeasurements.cpp +++ b/src/libs/vformat/vmeasurements.cpp @@ -462,14 +462,7 @@ bool VMeasurements::IsReadOnly() const //--------------------------------------------------------------------------------------------------------------------- void VMeasurements::SetReadOnly(bool ro) { - if (ro) - { - setTagText(TagReadOnly, trueStr); - } - else - { - setTagText(TagReadOnly, falseStr); - } + setTagText(TagReadOnly, ro ? trueStr : falseStr); } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/libs/vtools/tools/vtoolseamallowance.cpp b/src/libs/vtools/tools/vtoolseamallowance.cpp index dcf54302f..3bcdc8893 100644 --- a/src/libs/vtools/tools/vtoolseamallowance.cpp +++ b/src/libs/vtools/tools/vtoolseamallowance.cpp @@ -1428,7 +1428,7 @@ void VToolSeamAllowance::ShowOptions() //--------------------------------------------------------------------------------------------------------------------- void VToolSeamAllowance::ToggleInLayout(bool checked) { - TogglePieceInLayout *togglePrint = new TogglePieceInLayout(m_id, checked, &(VAbstractTool::data), doc); + auto togglePrint = new TogglePieceInLayout(m_id, checked, &(VAbstractTool::data), doc); connect(togglePrint, &TogglePieceInLayout::Toggled, doc, &VAbstractPattern::CheckInLayoutList); qApp->getUndoStack()->push(togglePrint); } diff --git a/src/libs/vtools/undocommands/saveplacelabeloptions.cpp b/src/libs/vtools/undocommands/saveplacelabeloptions.cpp index e2fab6a6e..1028b7412 100644 --- a/src/libs/vtools/undocommands/saveplacelabeloptions.cpp +++ b/src/libs/vtools/undocommands/saveplacelabeloptions.cpp @@ -115,19 +115,10 @@ bool SavePlaceLabelOptions::mergeWith(const QUndoCommand *command) const SavePlaceLabelOptions *saveCommand = static_cast(command); SCASSERT(saveCommand != nullptr); - if (saveCommand->LabelId() != nodeId) + if (saveCommand->LabelId() != nodeId || m_newLabel.GetCenterPoint() != saveCommand->NewLabel().GetCenterPoint()) { return false; } - else - { - const VPlaceLabelItem candidate = saveCommand->NewLabel(); - - if (m_newLabel.GetCenterPoint() != candidate.GetCenterPoint()) - { - return false; - } - } m_newLabel = saveCommand->NewLabel(); return true; diff --git a/src/libs/vtools/undocommands/vundocommand.h b/src/libs/vtools/undocommands/vundocommand.h index 1422415da..ce2d6db41 100644 --- a/src/libs/vtools/undocommands/vundocommand.h +++ b/src/libs/vtools/undocommands/vundocommand.h @@ -43,24 +43,26 @@ Q_DECLARE_LOGGING_CATEGORY(vUndo) -enum class UndoCommand: char { AddPatternPiece, - AddToCalc, - MoveSpline, - MoveSplinePath, - MoveSPoint, - SaveToolOptions, - SaveDetailOptions, - SavePieceOptions, - SavePiecePathOptions, - SavePlaceLabelOptions, - MovePiece, - DeleteTool, - DeletePatternPiece, - RenamePP, - MoveLabel, - MoveDoubleLabel, - RotationMoveLabel - }; +enum class UndoCommand: char +{ + AddPatternPiece, + AddToCalc, + MoveSpline, + MoveSplinePath, + MoveSPoint, + SaveToolOptions, + SaveDetailOptions, + SavePieceOptions, + SavePiecePathOptions, + SavePlaceLabelOptions, + MovePiece, + DeleteTool, + DeletePatternPiece, + RenamePP, + MoveLabel, + MoveDoubleLabel, + RotationMoveLabel + }; class VPattern;