diff --git a/share/translations/seamly2d_cs_CZ.ts b/share/translations/seamly2d_cs_CZ.ts index 321cf83b0dda..eb698da1f66f 100644 --- a/share/translations/seamly2d_cs_CZ.ts +++ b/share/translations/seamly2d_cs_CZ.ts @@ -11862,10 +11862,6 @@ load in SeamlyME as usual. <html><head/><body><p>Do you really want to unite details?</p></body></html> - - Retain original pieces - - Select the first point diff --git a/share/translations/seamly2d_de_DE.ts b/share/translations/seamly2d_de_DE.ts index 6b7be41edd58..638d82c57fe5 100644 --- a/share/translations/seamly2d_de_DE.ts +++ b/share/translations/seamly2d_de_DE.ts @@ -11886,10 +11886,6 @@ wie gewohnt in SeamlyME laden können. <html><head/><body><p>Do you really want to unite details?</p></body></html> <html><head/><body><p>Sollen die Details wirklich vereinigt werden?</p></body></html> - - Retain original pieces - Die Original Schnittteile zurückbehalten - Select the first point Den ersten Punkt auswählen diff --git a/share/translations/seamly2d_el_GR.ts b/share/translations/seamly2d_el_GR.ts index ef5863fadf36..db7920d4f936 100644 --- a/share/translations/seamly2d_el_GR.ts +++ b/share/translations/seamly2d_el_GR.ts @@ -11863,10 +11863,6 @@ load in SeamlyME as usual. <html><head/><body><p>Do you really want to unite details?</p></body></html> - - Retain original pieces - Διατήρηση αρχικών κομματιών - Select the first point diff --git a/share/translations/seamly2d_en_CA.ts b/share/translations/seamly2d_en_CA.ts index ae5b9a759467..08ca42690f38 100644 --- a/share/translations/seamly2d_en_CA.ts +++ b/share/translations/seamly2d_en_CA.ts @@ -11866,10 +11866,6 @@ load in SeamlyME as usual. <html><head/><body><p>Do you really want to unite details?</p></body></html> <html><head/><body><p>Do you really want to unite details?</p></body></html> - - Retain original pieces - Retain original pieces - Select the first point diff --git a/share/translations/seamly2d_en_GB.ts b/share/translations/seamly2d_en_GB.ts index 2cb09e667709..c6648581cedc 100644 --- a/share/translations/seamly2d_en_GB.ts +++ b/share/translations/seamly2d_en_GB.ts @@ -11866,10 +11866,6 @@ load in SeamlyME as usual. <html><head/><body><p>Do you really want to unite details?</p></body></html> <html><head/><body><p>Do you really want to unite details?</p></body></html> - - Retain original pieces - Retain original pieces - Select the first point diff --git a/share/translations/seamly2d_en_IN.ts b/share/translations/seamly2d_en_IN.ts index 6cecd68ba1ac..5f228663b7a8 100644 --- a/share/translations/seamly2d_en_IN.ts +++ b/share/translations/seamly2d_en_IN.ts @@ -11866,10 +11866,6 @@ load in SeamlyME as usual. <html><head/><body><p>Do you really want to unite details?</p></body></html> <html><head/><body><p>Do you really want to unite details?</p></body></html> - - Retain original pieces - Retain original pieces - Select the first point diff --git a/share/translations/seamly2d_en_US.ts b/share/translations/seamly2d_en_US.ts index 2cb09e667709..c6648581cedc 100644 --- a/share/translations/seamly2d_en_US.ts +++ b/share/translations/seamly2d_en_US.ts @@ -11866,10 +11866,6 @@ load in SeamlyME as usual. <html><head/><body><p>Do you really want to unite details?</p></body></html> <html><head/><body><p>Do you really want to unite details?</p></body></html> - - Retain original pieces - Retain original pieces - Select the first point diff --git a/share/translations/seamly2d_es_ES.ts b/share/translations/seamly2d_es_ES.ts index 701a7ae815df..448b4c064db4 100644 --- a/share/translations/seamly2d_es_ES.ts +++ b/share/translations/seamly2d_es_ES.ts @@ -11946,10 +11946,6 @@ load in SeamlyME as usual. <html><head/><body><p>Do you really want to unite details?</p></body></html> <html><head/><body><p>¿Desea unir los detalles?</p></body></html> - - Retain original pieces - Conservar las piezas originales - Select the first point Seleccione primer punto diff --git a/share/translations/seamly2d_fi_FI.ts b/share/translations/seamly2d_fi_FI.ts index 948f43532ace..4cd819964162 100644 --- a/share/translations/seamly2d_fi_FI.ts +++ b/share/translations/seamly2d_fi_FI.ts @@ -11862,10 +11862,6 @@ load in SeamlyME as usual. <html><head/><body><p>Do you really want to unite details?</p></body></html> - - Retain original pieces - - Select the first point diff --git a/share/translations/seamly2d_fr_FR.ts b/share/translations/seamly2d_fr_FR.ts index 9df3d2f5e963..b4d34b9dbd55 100644 --- a/share/translations/seamly2d_fr_FR.ts +++ b/share/translations/seamly2d_fr_FR.ts @@ -11866,10 +11866,6 @@ load in SeamlyME as usual. <html><head/><body><p>Do you really want to unite details?</p></body></html> <html><head/><body><p>Voulez-vous vraiment rassembler les pièces de patron?</p></body></html> - - Retain original pieces - Mémoriser les pièces originales - Select the first point diff --git a/share/translations/seamly2d_he_IL.ts b/share/translations/seamly2d_he_IL.ts index e10dcdc5ff30..497ea1ac7916 100644 --- a/share/translations/seamly2d_he_IL.ts +++ b/share/translations/seamly2d_he_IL.ts @@ -11861,10 +11861,6 @@ load in SeamlyME as usual. <html><head/><body><p>Do you really want to unite details?</p></body></html> - - Retain original pieces - - Select the first point diff --git a/share/translations/seamly2d_id_ID.ts b/share/translations/seamly2d_id_ID.ts index 43832bfe917f..c9f8e3f6b788 100644 --- a/share/translations/seamly2d_id_ID.ts +++ b/share/translations/seamly2d_id_ID.ts @@ -11862,10 +11862,6 @@ load in SeamlyME as usual. <html><head/><body><p>Do you really want to unite details?</p></body></html> - - Retain original pieces - - Select the first point diff --git a/share/translations/seamly2d_it_IT.ts b/share/translations/seamly2d_it_IT.ts index 9eb204054bbb..4545f0cb74cc 100644 --- a/share/translations/seamly2d_it_IT.ts +++ b/share/translations/seamly2d_it_IT.ts @@ -11866,10 +11866,6 @@ load in SeamlyME as usual. <html><head/><body><p>Do you really want to unite details?</p></body></html> <html><head/><body><p>Vuoi veramente unire i dettagli?</p></body></html> - - Retain original pieces - Conserva pezzi originali - Select the first point diff --git a/share/translations/seamly2d_nl_NL.ts b/share/translations/seamly2d_nl_NL.ts index 984b0c18946c..2a15aa2ae6c3 100644 --- a/share/translations/seamly2d_nl_NL.ts +++ b/share/translations/seamly2d_nl_NL.ts @@ -11876,10 +11876,6 @@ load in SeamlyME as usual. <html><head/><body><p>Do you really want to unite details?</p></body></html> <html><head/><body><p>Wil je echt details verenigen?</p></body></html> - - Retain original pieces - Behoud originele stukken - Select the first point Kies het eerste punt diff --git a/share/translations/seamly2d_pt_BR.ts b/share/translations/seamly2d_pt_BR.ts index f451e756066d..d77feea0ed53 100644 --- a/share/translations/seamly2d_pt_BR.ts +++ b/share/translations/seamly2d_pt_BR.ts @@ -11861,10 +11861,6 @@ load in SeamlyME as usual. <html><head/><body><p>Do you really want to unite details?</p></body></html> - - Retain original pieces - - Select the first point diff --git a/share/translations/seamly2d_ro_RO.ts b/share/translations/seamly2d_ro_RO.ts index 5b3f5d4c75a3..95e03546f874 100644 --- a/share/translations/seamly2d_ro_RO.ts +++ b/share/translations/seamly2d_ro_RO.ts @@ -11861,10 +11861,6 @@ load in SeamlyME as usual. <html><head/><body><p>Do you really want to unite details?</p></body></html> - - Retain original pieces - - Select the first point diff --git a/share/translations/seamly2d_ru_RU.ts b/share/translations/seamly2d_ru_RU.ts index ac4cb6f3540f..632fc51648c6 100644 --- a/share/translations/seamly2d_ru_RU.ts +++ b/share/translations/seamly2d_ru_RU.ts @@ -11904,10 +11904,6 @@ load in SeamlyME as usual. <html><head/><body><p>Do you really want to unite details?</p></body></html> <html><head/><body><р>Вы действительно хотите объединить детали?</p></body></html> - - Retain original pieces - Сохранить оригинальную выкройку - Select the first point Выберите первую точку diff --git a/share/translations/seamly2d_uk_UA.ts b/share/translations/seamly2d_uk_UA.ts index b4861994c8c1..6baa3104e0e1 100644 --- a/share/translations/seamly2d_uk_UA.ts +++ b/share/translations/seamly2d_uk_UA.ts @@ -11865,10 +11865,6 @@ load in SeamlyME as usual. <html><head/><body><p>Do you really want to unite details?</p></body></html> <html><head/><body><p>Чи ви справді хочете об'єднати деталі?</p></body></html> - - Retain original pieces - Зберегти оригінальні деталі - Select the first point diff --git a/share/translations/seamly2d_zh_CN.ts b/share/translations/seamly2d_zh_CN.ts index f631868732e3..32505b82ce17 100644 --- a/share/translations/seamly2d_zh_CN.ts +++ b/share/translations/seamly2d_zh_CN.ts @@ -11861,10 +11861,6 @@ load in SeamlyME as usual. <html><head/><body><p>Do you really want to unite details?</p></body></html> - - Retain original pieces - - Select the first point diff --git a/src/libs/vtools/dialogs/tools/union_dialog.cpp b/src/libs/vtools/dialogs/tools/union_dialog.cpp index 9fb645b46186..c457fe1767c1 100644 --- a/src/libs/vtools/dialogs/tools/union_dialog.cpp +++ b/src/libs/vtools/dialogs/tools/union_dialog.cpp @@ -94,12 +94,6 @@ UnionDialog::~UnionDialog() delete ui; } -//--------------------------------------------------------------------------------------------------------------------- -bool UnionDialog::retainPieces() const -{ - return ui->checkBox->isChecked(); -} - //--------------------------------------------------------------------------------------------------------------------- /** * @brief ChosenObject gets id and type of selected object. Save correct data and ignore wrong. @@ -136,18 +130,13 @@ bool UnionDialog::CheckObject(const quint32 &id, const quint32 &pieceId) const } //--------------------------------------------------------------------------------------------------------------------- -bool UnionDialog::checkPiece(const quint32 &pieceId) const +bool UnionDialog::isPieceValid(const quint32 &pieceId) const { if (pieceId == NULL_ID) { return false; } const VPiece piece = data->GetPiece(pieceId); - if (piece.isLocked()) - { - ui->checkBox->setChecked(true); - ui->checkBox->setEnabled(false); - } if (piece.GetPath().CountNodes() >= 3 && piece.GetPath().ListNodePoint().size() >= 2) { return true; @@ -174,7 +163,7 @@ void UnionDialog::chosenPiece(const quint32 &id, const SceneObject &type, quint3 if (type == SceneObject::Piece) { m_beep->play(); - if (checkPiece(id)) + if (isPieceValid(id)) { pieceId = id; emit ToolTip(tr("Select the first point")); diff --git a/src/libs/vtools/dialogs/tools/union_dialog.h b/src/libs/vtools/dialogs/tools/union_dialog.h index 8056126cfee1..979bf8569c7d 100644 --- a/src/libs/vtools/dialogs/tools/union_dialog.h +++ b/src/libs/vtools/dialogs/tools/union_dialog.h @@ -84,8 +84,6 @@ class UnionDialog : public DialogTool int getPiece1Index() const; int getPiece2Index() const; - bool retainPieces() const; - public slots: virtual void ChosenObject(quint32 id, const SceneObject &type) Q_DECL_OVERRIDE; @@ -105,7 +103,7 @@ public slots: QSound *m_beep; bool CheckObject(const quint32 &id, const quint32 &pieceId) const; - bool checkPiece(const quint32 &pieceId) const; + bool isPieceValid(const quint32 &pieceId) const; void chosenPiece(const quint32 &id, const SceneObject &type, quint32 &pieceId, int &index); diff --git a/src/libs/vtools/dialogs/tools/union_dialog.ui b/src/libs/vtools/dialogs/tools/union_dialog.ui index bfbbac5e70c9..db2d03fcc553 100644 --- a/src/libs/vtools/dialogs/tools/union_dialog.ui +++ b/src/libs/vtools/dialogs/tools/union_dialog.ui @@ -29,12 +29,8 @@ <html><head/><body><p>Do you really want to unite details?</p></body></html> - - - - - - Retain original pieces + + Qt::AlignCenter diff --git a/src/libs/vtools/tools/union_tool.cpp b/src/libs/vtools/tools/union_tool.cpp index 9734cf6a05a6..3ab5d8f7b245 100644 --- a/src/libs/vtools/tools/union_tool.cpp +++ b/src/libs/vtools/tools/union_tool.cpp @@ -146,13 +146,13 @@ VPiecePath GetPiecePath(int piece, VAbstractPattern *doc, quint32 id) for (qint32 i = 0; i < nodesList.size(); ++i) { const QDomElement element = nodesList.at(i).toElement(); - if (not element.isNull() && element.tagName() == UnionTool::TagUnionPiece && i+1 == piece) + if (!element.isNull() && element.tagName() == UnionTool::TagUnionPiece && i+1 == piece) { const QDomNodeList pieceList = element.childNodes(); for (qint32 j = 0; j < pieceList.size(); ++j) { const QDomElement element = pieceList.at(j).toElement(); - if (not element.isNull() && element.tagName() == VAbstractPattern::TagNodes) + if (!element.isNull() && element.tagName() == VAbstractPattern::TagNodes) { return VAbstractPattern::ParsePieceNodes(element); } @@ -189,13 +189,13 @@ QVector GetPiece2CSAPaths(VAbstractPattern *doc, quint32 id) for (qint32 i = 0; i < nodesList.size(); ++i) { const QDomElement element = nodesList.at(i).toElement(); - if (not element.isNull() && element.tagName() == UnionTool::TagUnionPiece && i+1 == 2) + if (!element.isNull() && element.tagName() == UnionTool::TagUnionPiece && i+1 == 2) { const QDomNodeList pieceList = element.childNodes(); for (qint32 j = 0; j < pieceList.size(); ++j) { const QDomElement element = pieceList.at(j).toElement(); - if (not element.isNull() && element.tagName() == PatternPieceTool::TagCSA) + if (!element.isNull() && element.tagName() == PatternPieceTool::TagCSA) { return VAbstractPattern::ParsePieceCSARecords(element); } @@ -220,13 +220,13 @@ QVector GetPiece2InternalPaths(VAbstractPattern *doc, quint32 id) for (qint32 i = 0; i < nodesList.size(); ++i) { const QDomElement element = nodesList.at(i).toElement(); - if (not element.isNull() && element.tagName() == UnionTool::TagUnionPiece && i+1 == 2) + if (!element.isNull() && element.tagName() == UnionTool::TagUnionPiece && i+1 == 2) { const QDomNodeList pieceList = element.childNodes(); for (qint32 j = 0; j < pieceList.size(); ++j) { const QDomElement element = pieceList.at(j).toElement(); - if (not element.isNull() && element.tagName() == PatternPieceTool::TagIPaths) + if (!element.isNull() && element.tagName() == PatternPieceTool::TagIPaths) { return VAbstractPattern::ParsePieceInternalPaths(element); } @@ -251,13 +251,13 @@ QVector GetPiece2Anchors(VAbstractPattern *doc, quint32 id) for (qint32 i = 0; i < nodesList.size(); ++i) { const QDomElement element = nodesList.at(i).toElement(); - if (not element.isNull() && element.tagName() == UnionTool::TagUnionPiece && i+1 == 2) + if (!element.isNull() && element.tagName() == UnionTool::TagUnionPiece && i+1 == 2) { const QDomNodeList pieceList = element.childNodes(); for (qint32 j = 0; j < pieceList.size(); ++j) { const QDomElement element = pieceList.at(j).toElement(); - if (not element.isNull() && element.tagName() == PatternPieceTool::TagAnchors) + if (!element.isNull() && element.tagName() == PatternPieceTool::TagAnchors) { return VAbstractPattern::ParsePieceAnchors(element); } @@ -404,7 +404,7 @@ quint32 AddNodePoint(const VPieceNode &node, const UnionToolInitData &initData, QScopedPointer point(new VPointF(*initData.data->GeometricObject(node.GetId()))); point->setMode(Draw::Modeling); - if (not qFuzzyIsNull(dx) || not qFuzzyIsNull(dy) || pRotate != NULL_ID) + if (!qFuzzyIsNull(dx) || not qFuzzyIsNull(dy) || pRotate != NULL_ID) { BiasRotatePoint(point.data(), dx, dy, static_cast(*initData.data->GeometricObject(pRotate)), angle); @@ -428,7 +428,7 @@ quint32 AddAnchorPoint(quint32 id, const UnionToolInitData &initData, quint32 id QScopedPointer point(new VPointF(*initData.data->GeometricObject(id))); point->setMode(Draw::Modeling); - if (not qFuzzyIsNull(dx) || not qFuzzyIsNull(dy) || pRotate != NULL_ID) + if (!qFuzzyIsNull(dx) || not qFuzzyIsNull(dy) || pRotate != NULL_ID) { BiasRotatePoint(point.data(), dx, dy, static_cast(*initData.data->GeometricObject(pRotate)), angle); @@ -455,7 +455,7 @@ quint32 AddNodeArc(const VPieceNode &node, const UnionToolInitData &initData, qu VPointF p2 = VPointF(arc->GetP2(), "A", 0, 0); QScopedPointer center(new VPointF(arc->GetCenter())); - if (not qFuzzyIsNull(dx) || not qFuzzyIsNull(dy) || pRotate != NULL_ID) + if (!qFuzzyIsNull(dx) || not qFuzzyIsNull(dy) || pRotate != NULL_ID) { const QPointF p = static_cast(*initData.data->GeometricObject(pRotate)); @@ -497,7 +497,7 @@ quint32 AddNodeElArc(const VPieceNode &node, const UnionToolInitData &initData, VPointF p2 = VPointF(arc->GetP2(), "A", 0, 0); QScopedPointer center(new VPointF(arc->GetCenter())); - if (not qFuzzyIsNull(dx) || not qFuzzyIsNull(dy) || pRotate != NULL_ID) + if (!qFuzzyIsNull(dx) || not qFuzzyIsNull(dy) || pRotate != NULL_ID) { const QPointF p = static_cast(*initData.data->GeometricObject(pRotate)); @@ -544,7 +544,7 @@ quint32 AddNodeSpline(const VPieceNode &node, const UnionToolInitData &initData, VPointF p3 = VPointF(spline->GetP3()); QScopedPointer p4(new VPointF(spline->GetP4())); - if (not qFuzzyIsNull(dx) || not qFuzzyIsNull(dy) || pRotate != NULL_ID) + if (!qFuzzyIsNull(dx) || not qFuzzyIsNull(dy) || pRotate != NULL_ID) { const QPointF p = static_cast(*initData.data->GeometricObject(pRotate)); @@ -583,7 +583,7 @@ quint32 AddNodeSplinePath(const VPieceNode &node, const UnionToolInitData &initD VPointF p2 = VPointF(spline.GetP2()); VPointF p3 = VPointF(spline.GetP3()); QScopedPointer p4(new VPointF(spline.GetP4())); - if (not qFuzzyIsNull(dx) || not qFuzzyIsNull(dy) || pRotate != NULL_ID) + if (!qFuzzyIsNull(dx) || not qFuzzyIsNull(dy) || pRotate != NULL_ID) { const QPointF p = static_cast(*initData.data->GeometricObject(pRotate)); @@ -778,7 +778,7 @@ QVector GetChildren(VAbstractPattern *doc, quint32 id, const QString &t for (int i=0; i < listChildren.size(); ++i) { const QDomElement domElement = listChildren.at(i).toElement(); - if (not domElement.isNull()) + if (!domElement.isNull()) { childrenId.append(domElement.text().toUInt()); } @@ -814,7 +814,7 @@ QVector getAnchorChildren(VAbstractPattern *doc, quint32 id) quint32 TakeNextId(QVector &children) { quint32 idChild = NULL_ID; - if (not children.isEmpty()) + if (!children.isEmpty()) { idChild = children.takeFirst(); } @@ -831,7 +831,7 @@ void UpdateNodePoint(VContainer *data, const VPieceNode &node, QVector { QScopedPointer point(new VPointF(*data->GeometricObject(node.GetId()))); point->setMode(Draw::Modeling); - if (not qFuzzyIsNull(dx) || not qFuzzyIsNull(dy) || pRotate != NULL_ID) + if (!qFuzzyIsNull(dx) || not qFuzzyIsNull(dy) || pRotate != NULL_ID) { BiasRotatePoint(point.data(), dx, dy, static_cast(*data->GeometricObject(pRotate)), angle); } @@ -847,7 +847,7 @@ void UpdateNodeArc(VContainer *data, const VPieceNode &node, QVector &c VPointF p2 = VPointF(arc->GetP2()); QScopedPointer center(new VPointF(arc->GetCenter())); - if (not qFuzzyIsNull(dx) || not qFuzzyIsNull(dy) || pRotate != NULL_ID) + if (!qFuzzyIsNull(dx) || not qFuzzyIsNull(dy) || pRotate != NULL_ID) { const QPointF p = static_cast(*data->GeometricObject(pRotate)); @@ -874,7 +874,7 @@ void UpdateNodeElArc(VContainer *data, const VPieceNode &node, QVector VPointF p2 = VPointF(arc->GetP2()); QScopedPointer center(new VPointF(arc->GetCenter())); - if (not qFuzzyIsNull(dx) || not qFuzzyIsNull(dy) || pRotate != NULL_ID) + if (!qFuzzyIsNull(dx) || not qFuzzyIsNull(dy) || pRotate != NULL_ID) { const QPointF p = static_cast(*data->GeometricObject(pRotate)); @@ -906,7 +906,7 @@ void UpdateNodeSpline(VContainer *data, const VPieceNode &node, QVector VPointF p3 = VPointF(spline->GetP3()); QScopedPointer p4(new VPointF(spline->GetP4())); - if (not qFuzzyIsNull(dx) || not qFuzzyIsNull(dy) || pRotate != NULL_ID) + if (!qFuzzyIsNull(dx) || not qFuzzyIsNull(dy) || pRotate != NULL_ID) { const QPointF p = static_cast(*data->GeometricObject(pRotate)); @@ -939,7 +939,7 @@ void UpdateNodeSplinePath(VContainer *data, const VPieceNode &node, QVector p4(new VPointF(spline.GetP4())); - if (not qFuzzyIsNull(dx) || not qFuzzyIsNull(dy) || pRotate != NULL_ID) + if (!qFuzzyIsNull(dx) || not qFuzzyIsNull(dy) || pRotate != NULL_ID) { const QPointF p = static_cast(*data->GeometricObject(pRotate)); @@ -1054,7 +1054,7 @@ void CreateUnitedNodes(VPiece &newPiece, const VPiece &piece1, const VPiece &pie newPiece.SetPath(newPath); - SCASSERT(not children.isEmpty()) + SCASSERT(!children.isEmpty()) SaveNodesChildren(initData.doc, id, children); } @@ -1182,7 +1182,7 @@ void UpdateUnitedNodes(quint32 id, const UnionToolInitData &initData, qreal dx, const qint32 piece2NodeCount = piece2REPath.CountNodes(); QVector children = GetNodesChildren(initData.doc, id); - if (not children.isEmpty()) + if (!children.isEmpty()) { // This check need for backward compatibility // Remove check and "else" part if min version is 0.3.2 @@ -1297,7 +1297,7 @@ void updateUnionAnchors(quint32 id, const UnionToolInitData &initData, qreal dx, { QScopedPointer point(new VPointF(*initData.data->GeometricObject(records.at(i)))); point->setMode(Draw::Modeling); - if (not qFuzzyIsNull(dx) || not qFuzzyIsNull(dy) || pRotate != NULL_ID) + if (!qFuzzyIsNull(dx) || not qFuzzyIsNull(dy) || pRotate != NULL_ID) { BiasRotatePoint(point.data(), dx, dy, static_cast(*initData.data->GeometricObject(pRotate)), angle); @@ -1311,7 +1311,7 @@ void createUnion(quint32 id, const UnionToolInitData &initData, qreal dx, qreal qreal angle) { const QString blockName = getBlockName(initData.doc, initData.piece1_Id, initData.piece2_Id); - SCASSERT(not blockName.isEmpty()) + SCASSERT(!blockName.isEmpty()) const VPiece piece1 = initData.data->GetPiece(initData.piece1_Id); const VPiece piece2 = initData.data->GetPiece(initData.piece2_Id); @@ -1369,22 +1369,6 @@ void createUnion(quint32 id, const UnionToolInitData &initData, qreal dx, qreal PatternPieceTool::Create(0, newPiece, formulaSAWidth, initData.scene, initData.doc, initData.data, initData.parse, Source::FromTool, blockName); - auto removeUnionPiece = [initData](quint32 id) - { - PatternPieceTool *pieceTool = qobject_cast(VAbstractPattern::getTool(id)); - SCASSERT(pieceTool != nullptr); - bool ask = false; - pieceTool->Remove(ask); - // We do not call full parse, so will need more to do more cleaning than usually - initData.doc->RemoveTool(id); - initData.data->RemovePiece(id); - }; - - if (!initData.retainPieces && !piece1.isLocked() && !piece2.isLocked()) - { - removeUnionPiece(initData.piece1_Id); - removeUnionPiece(initData.piece2_Id); - } } //--------------------------------------------------------------------------------------------------------------------- @@ -1429,8 +1413,7 @@ void unitePieces(quint32 id, const UnionToolInitData &initData) * @param initData global init data. * @param parent parent object. */ -UnionTool::UnionTool(quint32 id, const UnionToolInitData &initData, - QObject *parent) +UnionTool::UnionTool(quint32 id, const UnionToolInitData &initData, QObject *parent) : VAbstractTool(initData.doc, initData.data, id, parent) , piece1_Id(initData.piece1_Id) , piece2_Id(initData.piece2_Id) @@ -1510,9 +1493,9 @@ void UnionTool::GroupVisibility(quint32 object, bool visible) UnionTool* UnionTool::Create(QSharedPointer dialog, VMainGraphicsScene *scene, VAbstractPattern *doc, VContainer *data) { - SCASSERT(not dialog.isNull()) + SCASSERT(!dialog.isNull()) QSharedPointer dialogTool = dialog.objectCast(); - SCASSERT(not dialogTool.isNull()) + SCASSERT(!dialogTool.isNull()) UnionToolInitData initData; initData.piece1_Id = dialogTool->getPiece1Id(); @@ -1524,7 +1507,6 @@ UnionTool* UnionTool::Create(QSharedPointer dialog, VMainGraphicsSce initData.data = data; initData.parse = Document::FullParse; initData.typeCreation = Source::FromGui; - initData.retainPieces = dialogTool->retainPieces(); qApp->getUndoStack()->beginMacro(tr("union pieces")); UnionTool* tool = Create(0, initData); @@ -1538,7 +1520,7 @@ UnionTool* UnionTool::Create(QSharedPointer dialog, VMainGraphicsSce * @param _id tool id, 0 if tool doesn't exist yet. * @param initData contains all init data. */ -UnionTool* UnionTool::Create(const quint32 _id, const UnionToolInitData &initData) +UnionTool *UnionTool::Create(const quint32 _id, const UnionToolInitData &initData) { UnionTool *tool = nullptr; quint32 id = _id; @@ -1615,10 +1597,10 @@ void UnionTool::addPiece(QDomElement &domElement, const VPiece &piece) const void UnionTool::AddToModeling(const QDomElement &domElement) { const QString blockName = getBlockName(doc, piece1_Id, piece2_Id); - SCASSERT(not blockName.isEmpty()) + SCASSERT(!blockName.isEmpty()) QDomElement modeling = doc->getDraftBlockElement(blockName).firstChildElement(VAbstractPattern::TagModeling); - if (not modeling.isNull()) + if (!modeling.isNull()) { modeling.appendChild(domElement); } @@ -1648,13 +1630,13 @@ QVector UnionTool::GetReferenceObjects() const for (qint32 i = 0; i < nodesList.size(); ++i) { const QDomElement element = nodesList.at(i).toElement(); - if (not element.isNull() && element.tagName() == UnionTool::TagUnionPiece) + if (!element.isNull() && element.tagName() == UnionTool::TagUnionPiece) { const QDomNodeList pieceList = element.childNodes(); for (qint32 j = 0; j < pieceList.size(); ++j) { const QDomElement element = pieceList.at(j).toElement(); - if (not element.isNull()) + if (!element.isNull()) { switch (parts.indexOf(element.tagName())) { @@ -1672,7 +1654,7 @@ QVector UnionTool::GetReferenceObjects() const for (qint32 i = 0; i < children.size(); ++i) { const QDomElement record = children.at(i).toElement(); - if (not record.isNull() && record.tagName() == PatternPieceTool::TagRecord) + if (!record.isNull() && record.tagName() == PatternPieceTool::TagRecord) { list.append(record.text().toUInt()); } @@ -1699,7 +1681,7 @@ QVector UnionTool::ReferenceObjects(const QDomElement &root, const QStr for (qint32 i = 0; i < list.size(); ++i) { const QDomElement element = list.at(i).toElement(); - if (not element.isNull() && element.tagName() == tag) + if (!element.isNull() && element.tagName() == tag) { const quint32 id = doc->GetParametrUInt(element, attribute, NULL_ID_STR); if (id > NULL_ID)