diff --git a/ChangeLog.txt b/ChangeLog.txt index 7e9f18f8e..7f390c610 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -34,6 +34,7 @@ - Fixed translation numbers in scientific notation. - Fix dialog for tool Point along perpendicular. No memory of line color settings. - Fix crash after uniting three pieces in sequence. +- Incorrect conversion to newer curve format. # Version 0.6.1 October 23, 2018 - [#885] Regression. Broken support for multi size measurements. diff --git a/src/app/valentina/xml/vpattern.cpp b/src/app/valentina/xml/vpattern.cpp index 32a4dae11..4ebdd893c 100644 --- a/src/app/valentina/xml/vpattern.cpp +++ b/src/app/valentina/xml/vpattern.cpp @@ -2452,7 +2452,7 @@ void VPattern::ParseToolTrueDarts(VMainGraphicsScene *scene, const QDomElement & //--------------------------------------------------------------------------------------------------------------------- // TODO. Delete if minimal supported version is 0.2.7 -void VPattern::ParseOldToolSpline(VMainGraphicsScene *scene, const QDomElement &domElement, const Document &parse) +void VPattern::ParseOldToolSpline(VMainGraphicsScene *scene, QDomElement &domElement, const Document &parse) { SCASSERT(scene != nullptr) Q_ASSERT_X(not domElement.isNull(), Q_FUNC_INFO, "domElement is null"); @@ -2488,6 +2488,9 @@ void VPattern::ParseOldToolSpline(VMainGraphicsScene *scene, const QDomElement & spline->SetColor(color); VToolSpline::Create(initData, spline); + + // Convert to newer format + SetAttribute(domElement, AttrType, VToolSpline::ToolType); } catch (const VExceptionBadId &e) { @@ -2620,7 +2623,7 @@ void VPattern::ParseToolCubicBezier(VMainGraphicsScene *scene, const QDomElement } //--------------------------------------------------------------------------------------------------------------------- -void VPattern::ParseOldToolSplinePath(VMainGraphicsScene *scene, const QDomElement &domElement, const Document &parse) +void VPattern::ParseOldToolSplinePath(VMainGraphicsScene *scene, QDomElement &domElement, const Document &parse) { SCASSERT(scene != nullptr) Q_ASSERT_X(not domElement.isNull(), Q_FUNC_INFO, "domElement is null"); @@ -2679,6 +2682,9 @@ void VPattern::ParseOldToolSplinePath(VMainGraphicsScene *scene, const QDomEleme path->SetApproximationScale(approximationScale); VToolSplinePath::Create(initData, path); + + // Convert to newer format + SetAttribute(domElement, AttrType, VToolSplinePath::ToolType); } catch (const VExceptionBadId &e) { diff --git a/src/app/valentina/xml/vpattern.h b/src/app/valentina/xml/vpattern.h index 8eef79597..fdc9718b2 100644 --- a/src/app/valentina/xml/vpattern.h +++ b/src/app/valentina/xml/vpattern.h @@ -202,7 +202,7 @@ private: // TODO. Delete if minimal supported version is 0.2.7 Q_STATIC_ASSERT_X(VPatternConverter::PatternMinVer < FORMAT_VERSION(0, 2, 7), "Time to refactor the code."); - void ParseOldToolSpline(VMainGraphicsScene *scene, const QDomElement &domElement, const Document &parse); + void ParseOldToolSpline(VMainGraphicsScene *scene, QDomElement &domElement, const Document &parse); void ParseToolSpline(VMainGraphicsScene *scene, QDomElement &domElement, const Document &parse); void ParseToolCubicBezier(VMainGraphicsScene *scene, const QDomElement &domElement, const Document &parse); @@ -210,7 +210,7 @@ private: // TODO. Delete if minimal supported version is 0.2.7 Q_STATIC_ASSERT_X(VPatternConverter::PatternMinVer < FORMAT_VERSION(0, 2, 7), "Time to refactor the code."); - void ParseOldToolSplinePath(VMainGraphicsScene *scene, const QDomElement &domElement, const Document &parse); + void ParseOldToolSplinePath(VMainGraphicsScene *scene, QDomElement &domElement, const Document &parse); void ParseToolSplinePath(VMainGraphicsScene *scene, const QDomElement &domElement, const Document &parse); void ParseToolCubicBezierPath(VMainGraphicsScene *scene, const QDomElement &domElement, const Document &parse);