diff --git a/src/app/valentina/xml/vpattern.cpp b/src/app/valentina/xml/vpattern.cpp index c627a2400..1a5c2c93c 100644 --- a/src/app/valentina/xml/vpattern.cpp +++ b/src/app/valentina/xml/vpattern.cpp @@ -3984,7 +3984,19 @@ void VPattern::SetIncrementFormula(const QString &name, const QString &text) //--------------------------------------------------------------------------------------------------------------------- void VPattern::SetIncrementDescription(const QString &name, const QString &text) { - SetIncrementAttribute(name, AttrDescription, text); + if (not text.isEmpty()) + { + SetIncrementAttribute(name, AttrDescription, text); + } + else + { + QDomElement node = FindIncrement(name); + if (not node.isNull()) + { + node.removeAttribute(AttrDescription); + emit patternChanged(false); + } + } } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/libs/ifc/xml/vabstractpattern.cpp b/src/libs/ifc/xml/vabstractpattern.cpp index 5152e33d0..677b3d79a 100644 --- a/src/libs/ifc/xml/vabstractpattern.cpp +++ b/src/libs/ifc/xml/vabstractpattern.cpp @@ -2285,7 +2285,7 @@ void VAbstractPattern::SetFMeasurements(QDomElement &element, const QVectorSetAttribute(domElement, AttrVersion, QString().setNum(pieceVersion)); doc->SetAttribute(domElement, AttrMx, qApp->fromPixel(piece.GetMx())); doc->SetAttribute(domElement, AttrMy, qApp->fromPixel(piece.GetMy())); - doc->SetAttribute(domElement, AttrInLayout, piece.IsInLayout()); + doc->SetAttributeOrRemoveIf(domElement, AttrInLayout, piece.IsInLayout(), piece.IsInLayout()); doc->SetAttribute(domElement, AttrForbidFlipping, piece.IsForbidFlipping()); doc->SetAttribute(domElement, AttrForceFlipping, piece.IsForceFlipping()); - doc->SetAttribute(domElement, AttrSeamAllowance, piece.IsSeamAllowance()); + doc->SetAttributeOrRemoveIf(domElement, AttrSeamAllowance, piece.IsSeamAllowance(), + not piece.IsSeamAllowance()); doc->SetAttribute(domElement, AttrHideMainPath, piece.IsHideMainPath()); doc->SetAttributeOrRemoveIf(domElement, AttrSeamAllowanceBuiltIn, piece.IsSeamAllowanceBuiltIn(), not piece.IsSeamAllowanceBuiltIn()); doc->SetAttribute(domElement, AttrWidth, piece.GetFormulaSAWidth()); - doc->SetAttribute(domElement, AttrUnited, piece.IsUnited()); + doc->SetAttributeOrRemoveIf(domElement, AttrUnited, piece.IsUnited(), not piece.IsUnited()); } //---------------------------------------------------------------------------------------------------------------------