Remove the attribute if not used.

This commit is contained in:
Roman Telezhynskyi 2023-10-02 18:04:34 +03:00
parent 2fc5492f57
commit 54a713f545

View File

@ -1331,7 +1331,8 @@ void VAbstractPattern::SetPassmarkLengthVariable(const QString &name)
if (not pattern.isNull())
{
SetAttribute(pattern, AttrPassmarkLength, name);
SetAttributeOrRemoveIf<QString>(pattern, AttrPassmarkLength, name,
[](const QString &name) noexcept { return name.isEmpty(); });
modified = true;
}
}
@ -1356,7 +1357,8 @@ void VAbstractPattern::SetPassmarkWidthVariable(const QString &name)
if (not pattern.isNull())
{
SetAttribute(pattern, AttrPassmarkWidth, name);
SetAttributeOrRemoveIf<QString>(pattern, AttrPassmarkWidth, name,
[](const QString &name) noexcept { return name.isEmpty(); });
modified = true;
}
}