Incorrect conversion to newer curve format.

(grafted from d43e0ad7a8b691e3403c96ec1ec17eceac5c235f)

--HG--
branch : develop
This commit is contained in:
Roman Telezhynskyi 2020-01-10 09:58:16 +02:00
parent a1ed06d659
commit ac38d662bf
3 changed files with 11 additions and 4 deletions

View File

@ -75,6 +75,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.

View File

@ -2469,7 +2469,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");
@ -2505,6 +2505,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)
{
@ -2637,7 +2640,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");
@ -2696,6 +2699,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)
{

View File

@ -220,7 +220,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);
@ -228,7 +228,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);