Optimize size, rely more on default values for attributes.
--HG-- branch : develop
This commit is contained in:
parent
72eeae24e6
commit
35a0fd74e1
|
@ -3984,7 +3984,19 @@ void VPattern::SetIncrementFormula(const QString &name, const QString &text)
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void VPattern::SetIncrementDescription(const QString &name, const QString &text)
|
void VPattern::SetIncrementDescription(const QString &name, const QString &text)
|
||||||
{
|
{
|
||||||
|
if (not text.isEmpty())
|
||||||
|
{
|
||||||
SetIncrementAttribute(name, AttrDescription, text);
|
SetIncrementAttribute(name, AttrDescription, text);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
QDomElement node = FindIncrement(name);
|
||||||
|
if (not node.isNull())
|
||||||
|
{
|
||||||
|
node.removeAttribute(AttrDescription);
|
||||||
|
emit patternChanged(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
|
@ -2285,7 +2285,7 @@ void VAbstractPattern::SetFMeasurements(QDomElement &element, const QVector<VFin
|
||||||
|
|
||||||
SetAttribute(tagFMeasurement, AttrName, m.name);
|
SetAttribute(tagFMeasurement, AttrName, m.name);
|
||||||
SetAttribute(tagFMeasurement, AttrFormula, m.formula);
|
SetAttribute(tagFMeasurement, AttrFormula, m.formula);
|
||||||
SetAttribute(tagFMeasurement, AttrDescription, m.description);
|
SetAttributeOrRemoveIf(tagFMeasurement, AttrDescription, m.description, m.description.isEmpty());
|
||||||
|
|
||||||
element.appendChild(tagFMeasurement);
|
element.appendChild(tagFMeasurement);
|
||||||
}
|
}
|
||||||
|
|
|
@ -271,15 +271,16 @@ void VToolSeamAllowance::AddAttributes(VAbstractPattern *doc, QDomElement &domEl
|
||||||
doc->SetAttribute(domElement, AttrVersion, QString().setNum(pieceVersion));
|
doc->SetAttribute(domElement, AttrVersion, QString().setNum(pieceVersion));
|
||||||
doc->SetAttribute(domElement, AttrMx, qApp->fromPixel(piece.GetMx()));
|
doc->SetAttribute(domElement, AttrMx, qApp->fromPixel(piece.GetMx()));
|
||||||
doc->SetAttribute(domElement, AttrMy, qApp->fromPixel(piece.GetMy()));
|
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, AttrForbidFlipping, piece.IsForbidFlipping());
|
||||||
doc->SetAttribute(domElement, AttrForceFlipping, piece.IsForceFlipping());
|
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->SetAttribute(domElement, AttrHideMainPath, piece.IsHideMainPath());
|
||||||
doc->SetAttributeOrRemoveIf(domElement, AttrSeamAllowanceBuiltIn, piece.IsSeamAllowanceBuiltIn(),
|
doc->SetAttributeOrRemoveIf(domElement, AttrSeamAllowanceBuiltIn, piece.IsSeamAllowanceBuiltIn(),
|
||||||
not piece.IsSeamAllowanceBuiltIn());
|
not piece.IsSeamAllowanceBuiltIn());
|
||||||
doc->SetAttribute(domElement, AttrWidth, piece.GetFormulaSAWidth());
|
doc->SetAttribute(domElement, AttrWidth, piece.GetFormulaSAWidth());
|
||||||
doc->SetAttribute(domElement, AttrUnited, piece.IsUnited());
|
doc->SetAttributeOrRemoveIf(domElement, AttrUnited, piece.IsUnited(), not piece.IsUnited());
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
Loading…
Reference in New Issue
Block a user