diff --git a/src/app/valentina/xml/vpattern.cpp b/src/app/valentina/xml/vpattern.cpp index 0328f3da2..7311a8b72 100644 --- a/src/app/valentina/xml/vpattern.cpp +++ b/src/app/valentina/xml/vpattern.cpp @@ -2141,10 +2141,22 @@ void VPattern::ParseNodeSpline(const QDomElement &domElement, const Document &pa quint32 idTool = 0; SplinesCommonAttributes(domElement, id, idObject, idTool); - VSpline *spl = new VSpline(*data->GeometricObject(idObject)); - spl->setIdObject(idObject); - spl->setMode(Draw::Modeling); - data->UpdateGObject(id, spl); + const auto obj = data->GetGObject(idObject); + if (obj->getType() == GOType::Spline) + { + VSpline *spl = new VSpline(*data->GeometricObject(idObject)); + spl->setIdObject(idObject); + spl->setMode(Draw::Modeling); + data->UpdateGObject(id, spl); + } + else + { + VCubicBezier *spl = new VCubicBezier(*data->GeometricObject(idObject)); + spl->setIdObject(idObject); + spl->setMode(Draw::Modeling); + data->UpdateGObject(id, spl); + } + VNodeSpline::Create(this, data, id, idObject, parse, Source::FromFile, idTool); } catch (const VExceptionBadId &e) diff --git a/src/libs/vtools/tools/vtooldetail.cpp b/src/libs/vtools/tools/vtooldetail.cpp index e3fd18cea..525dc0176 100644 --- a/src/libs/vtools/tools/vtooldetail.cpp +++ b/src/libs/vtools/tools/vtooldetail.cpp @@ -29,6 +29,7 @@ #include "vtooldetail.h" #include "nodeDetails/nodedetails.h" #include "../vgeometry/varc.h" +#include "../vgeometry/vcubicbezier.h" #include "../vgeometry/vsplinepath.h" #include "../vwidgets/vmaingraphicsscene.h" #include "../vwidgets/vmaingraphicsview.h" @@ -178,7 +179,15 @@ void VToolDetail::Create(DialogTool *dialog, VMainGraphicsScene *scene, VAbstrac break; case (Tool::NodeSpline): { - id = CreateNode(data, nodeD.getId()); + const auto obj = data->GetGObject(nodeD.getId()); + if (obj->getType() == GOType::Spline) + { + id = CreateNode(data, nodeD.getId()); + } + else + { + id = CreateNode(data, nodeD.getId()); + } VNodeSpline::Create(doc, data, id, nodeD.getId(), Document::FullParse, Source::FromGui); } break;