diff --git a/src/app/valentina/xml/vpattern.cpp b/src/app/valentina/xml/vpattern.cpp index 43c79c857..ffff375a5 100644 --- a/src/app/valentina/xml/vpattern.cpp +++ b/src/app/valentina/xml/vpattern.cpp @@ -4151,6 +4151,7 @@ void VPattern::PrepareForParse(const Document &parse) else if (parse == Document::LiteParse) { VContainer::ClearUniqueNames(); + Q_STATIC_ASSERT_X(static_cast(VarType::Unknown) == 8, "Check that you used all types"); data->ClearVariables(VarType::Increment); data->ClearVariables(VarType::LineAngle); data->ClearVariables(VarType::LineLength); diff --git a/src/libs/vpatterndb/variables/vincrement_p.h b/src/libs/vpatterndb/variables/vincrement_p.h index 77d78a71e..441a76460 100644 --- a/src/libs/vpatterndb/variables/vincrement_p.h +++ b/src/libs/vpatterndb/variables/vincrement_p.h @@ -57,7 +57,17 @@ public: formulaOk(ok), previewCalculation(false), data(*data) - {} + { + // When we create an increment in the dialog it will get neccesary data. Such data must be removed because will + // confuse a user. Increment should not know nothing about internal variables. + Q_STATIC_ASSERT_X(static_cast(VarType::Unknown) == 8, "Check that you used all types"); + this->data.ClearVariables(VarType::LineAngle); + this->data.ClearVariables(VarType::LineLength); + this->data.ClearVariables(VarType::CurveLength); + this->data.ClearVariables(VarType::CurveCLength); + this->data.ClearVariables(VarType::ArcRadius); + this->data.ClearVariables(VarType::CurveAngle); + } VIncrementData(const VIncrementData &incr) : QSharedData(incr), diff --git a/src/libs/vpatterndb/vcontainer.cpp b/src/libs/vpatterndb/vcontainer.cpp index 1e2820220..749e64e3e 100644 --- a/src/libs/vpatterndb/vcontainer.cpp +++ b/src/libs/vpatterndb/vcontainer.cpp @@ -280,6 +280,7 @@ void VContainer::ClearForFullParse() d->pieces->clear(); d->piecePaths->clear(); + Q_STATIC_ASSERT_X(static_cast(VarType::Unknown) == 8, "Check that you used all types"); ClearVariables(VarType::Increment); ClearVariables(VarType::LineAngle); ClearVariables(VarType::LineLength);