Compiler warnings.

This commit is contained in:
Roman Telezhynskyi 2021-09-24 16:53:47 +03:00
parent 50c0c97c2e
commit d83039c4ee
51 changed files with 151 additions and 116 deletions

View file

@ -38,6 +38,7 @@
#include <QIcon>
#include <QLoggingCategory>
#include <QPainter>
#include <QPainterPath>
Q_LOGGING_CATEGORY(pPiece, "p.piece")

View file

@ -56,7 +56,12 @@ Q_LOGGING_CATEGORY(pMainGraphicsView, "p.mainGraphicsView")
namespace
{
QT_WARNING_PUSH
QT_WARNING_DISABLE_CLANG("-Wenum-enum-conversion")
const QKeySequence restoreOriginShortcut = QKeySequence(Qt::ControlModifier + Qt::Key_Asterisk);
QT_WARNING_POP
}

View file

@ -1596,6 +1596,9 @@ void VPMainWindow::InitZoomToolBar()
delete m_mouseCoordinate;
QT_WARNING_PUSH
QT_WARNING_DISABLE_CLANG("-Wenum-enum-conversion")
// connect the zoom buttons and shortcuts to the slots
QList<QKeySequence> zoomInShortcuts;
zoomInShortcuts.append(QKeySequence(QKeySequence::ZoomIn));
@ -1619,6 +1622,8 @@ void VPMainWindow::InitZoomToolBar()
zoomFitBestShortcuts.append(QKeySequence(Qt::ControlModifier + Qt::Key_Equal));
ui->actionZoomFitBest->setShortcuts(zoomFitBestShortcuts);
connect(ui->actionZoomFitBest, &QAction::triggered, m_graphicsView, &VPMainGraphicsView::ZoomFitBest);
QT_WARNING_POP
}
//---------------------------------------------------------------------------------------------------------------------

View file

@ -2419,6 +2419,9 @@ void MainWindow::ToolBarTools()
QKeySequence::ZoomOut). For examle "+" is Qt::Key_Plus + Qt::KeypadModifier for keypad.
Also for me don't work Qt:CTRL and work Qt::ControlModifier.*/
QT_WARNING_PUSH
QT_WARNING_DISABLE_CLANG("-Wenum-enum-conversion")
QList<QKeySequence> zoomInShortcuts;
zoomInShortcuts.append(QKeySequence(QKeySequence::ZoomIn));
zoomInShortcuts.append(QKeySequence(Qt::ControlModifier + Qt::Key_Plus + Qt::KeypadModifier));
@ -2512,6 +2515,8 @@ void MainWindow::ToolBarTools()
sceneDetails->update();
}
});
QT_WARNING_POP
}
//---------------------------------------------------------------------------------------------------------------------

View file

@ -4313,7 +4313,7 @@ void VPattern::SetReadOnly(bool rOnly)
if (not pattern.isNull())
{
SetAttributeOrRemoveIf<bool>(pattern, AttrReadOnly, rOnly, [](bool rOnly){return not rOnly;});
SetAttributeOrRemoveIf<bool>(pattern, AttrReadOnly, rOnly, [](bool rOnly) noexcept {return not rOnly;});
modified = true;
}
}

View file

@ -1952,7 +1952,7 @@ void VAbstractPattern::SetFMeasurements(QDomElement &element, const QVector<VFin
SetAttribute(tagFMeasurement, AttrName, m.name);
SetAttribute(tagFMeasurement, AttrFormula, m.formula);
SetAttributeOrRemoveIf<QString>(tagFMeasurement, AttrDescription, m.description,
[](const QString &description){return description.isEmpty();});
[](const QString &description) noexcept {return description.isEmpty();});
element.appendChild(tagFMeasurement);
}
@ -2029,9 +2029,9 @@ QDomElement VAbstractPattern::CreateGroup(quint32 id, const QString &name, const
SetAttribute(group, AttrId, id);
SetAttribute(group, AttrName, name);
SetAttribute(group, AttrVisible, true);
SetAttributeOrRemoveIf<vidtype>(group, AttrTool, tool, [](vidtype tool){ return tool == null_id;});
SetAttributeOrRemoveIf<vidtype>(group, AttrTool, tool, [](vidtype tool) noexcept { return tool == null_id;});
SetAttributeOrRemoveIf<QString>(group, AttrTags, preparedTags,
[](const QString &preparedTags){return preparedTags.isEmpty();});
[](const QString &preparedTags) noexcept {return preparedTags.isEmpty();});
auto i = groupData.constBegin();
while (i != groupData.constEnd())
@ -2112,7 +2112,7 @@ void VAbstractPattern::SetGroupTags(quint32 id, const QStringList &tags)
if (group.isElement())
{
SetAttributeOrRemoveIf<QString>(group, AttrTags, tags.join(','),
[](const QString &rawTags){return rawTags.isEmpty();});
[](const QString &rawTags) noexcept {return rawTags.isEmpty();});
modified = true;
emit patternChanged(false);
}

View file

@ -649,7 +649,7 @@ void VMeasurements::SetFullCircumference(bool fc)
QDomElement dimenstionsTag = documentElement().firstChildElement(TagDimensions);
if (not dimenstionsTag.isNull())
{
SetAttributeOrRemoveIf<bool>(dimenstionsTag, AttrFullCircumference, fc, [](bool fc){return not fc;});
SetAttributeOrRemoveIf<bool>(dimenstionsTag, AttrFullCircumference, fc, [](bool fc) noexcept {return not fc;});
}
else
{
@ -747,7 +747,7 @@ void VMeasurements::SetMSpecialUnits(const QString &name, bool special)
QDomElement node = FindM(name);
if (not node.isNull())
{
SetAttributeOrRemoveIf<bool>(node, AttrSpecialUnits, special, [](bool special){return not special;});
SetAttributeOrRemoveIf<bool>(node, AttrSpecialUnits, special, [](bool special) noexcept {return not special;});
}
else
{
@ -820,7 +820,8 @@ void VMeasurements::SetMDimension(const QString &name, IMD type)
if (not node.isNull())
{
SetAttributeOrRemoveIf<QString>(node, AttrDimension, VMeasurements::IMDToStr(type),
[](const QString &type){return type == VMeasurements::IMDToStr(IMD::N);});
[](const QString &type) noexcept
{return type == VMeasurements::IMDToStr(IMD::N);});
}
else
{
@ -895,11 +896,11 @@ void VMeasurements::SetRestrictions(const QMap<QString, VDimensionRestriction> &
SetAttribute(restrictionTag, AttrCoordinates, i.key());
SetAttributeOrRemoveIf<qreal>(restrictionTag, AttrMin, i.value().GetMin(),
[](qreal min){return qFuzzyIsNull(min);});
[](qreal min) noexcept {return qFuzzyIsNull(min);});
SetAttributeOrRemoveIf<qreal>(restrictionTag, AttrMax, i.value().GetMax(),
[](qreal max){return qFuzzyIsNull(max);});
[](qreal max) noexcept {return qFuzzyIsNull(max);});
SetAttributeOrRemoveIf<QString>(restrictionTag, AttrExclude, i.value().GetExcludeString(),
[](const QString &exlcuded){return exlcuded.isEmpty();});
[](const QString &exlcuded) noexcept {return exlcuded.isEmpty();});
restrictionsTag.appendChild(restrictionTag);
++i;

View file

@ -1118,7 +1118,7 @@ void VPatternRecipe::CurveAttributes(QDomElement &step, T *tool)
SetAttribute(step, AttrAScale, tool->GetApproximationScale());
SetAttribute(step, AttrDuplicate, tool->GetDuplicate());
SetAttributeOrRemoveIf<QString>(step, AttrAlias, tool->GetAliasSuffix(),
[](const QString &suffix){return suffix.isEmpty();});
[](const QString &suffix) noexcept {return suffix.isEmpty();});
}
@ -1127,9 +1127,9 @@ template<typename T>
void VPatternRecipe::CutCurveAttributes(QDomElement &step, T *tool)
{
SetAttributeOrRemoveIf<QString>(step, AttrAlias1, tool->GetAliasSuffix1(),
[](const QString &suffix){return suffix.isEmpty();});
[](const QString &suffix) noexcept {return suffix.isEmpty();});
SetAttributeOrRemoveIf<QString>(step, AttrAlias2, tool->GetAliasSuffix2(),
[](const QString &suffix){return suffix.isEmpty();});
[](const QString &suffix) noexcept {return suffix.isEmpty();});
}
//---------------------------------------------------------------------------------------------------------------------
@ -1171,7 +1171,8 @@ QDomElement VPatternRecipe::GroupOperationSource(VAbstractOperation *tool, quint
}
SetAttribute(node, AttrItem, obj->ObjectName());
SetAttributeOrRemoveIf<QString>(node, AttrAlias, item.alias, [](const QString &alias){return alias.isEmpty();});
SetAttributeOrRemoveIf<QString>(node, AttrAlias, item.alias,
[](const QString &alias) noexcept {return alias.isEmpty();});
if (obj->getType() != GOType::Point)
{

View file

@ -138,11 +138,11 @@ void VWatermark::SetWatermark(const VWatermarkData &data)
{
SetAttribute(text, AttrShow, data.showText);
SetAttributeOrRemoveIf<QString>(text, AttrText, data.text,
[](const QString &text){return text.isEmpty();});
[](const QString &text) noexcept {return text.isEmpty();});
SetAttributeOrRemoveIf<int>(text, AttrRotation, data.textRotation,
[](int textRotation){return textRotation == 0;});
[](int textRotation) noexcept {return textRotation == 0;});
SetAttributeOrRemoveIf<QString>(text, AttrFont, data.font.toString(),
[](const QString &fontString){return fontString.isEmpty();});
[](const QString &fontString) noexcept {return fontString.isEmpty();});
SetAttribute(text, AttrColor, data.textColor.name());
}
@ -151,11 +151,11 @@ void VWatermark::SetWatermark(const VWatermarkData &data)
{
SetAttribute(image, AttrShow, data.showImage);
SetAttributeOrRemoveIf<QString>(image, AttrPath, data.path,
[](const QString &path){return path.isEmpty();});
[](const QString &path) noexcept {return path.isEmpty();});
SetAttributeOrRemoveIf<int>(image, AttrRotation, data.imageRotation,
[](int imageRotation){return imageRotation == 0;});
[](int imageRotation) noexcept {return imageRotation == 0;});
SetAttributeOrRemoveIf<bool>(image, AttrGrayscale, data.grayscale,
[](bool grayscale){return not grayscale;});
[](bool grayscale) noexcept {return not grayscale;});
}
}
}

View file

@ -37,6 +37,9 @@ unix {
# want them in global list. Compromise decision delete them from local list.
QMAKE_CXXFLAGS -= \
-Wswitch-default
QMAKE_CXXFLAGS += \
-Wno-stringop-overflow
}
*clang*{

View file

@ -229,7 +229,7 @@ void VToolFlippingByAxis::SaveDialog(QDomElement &domElement, QList<quint32> &ol
doc->SetAttribute(domElement, AttrAxisType, QString().setNum(static_cast<int>(dialogTool->GetAxisType())));
doc->SetAttribute(domElement, AttrSuffix, dialogTool->GetSuffix());
doc->SetAttributeOrRemoveIf<QString>(domElement, AttrNotes, dialogTool->GetNotes(),
[](const QString &notes){return notes.isEmpty();});
[](const QString &notes) noexcept {return notes.isEmpty();});
source = dialogTool->GetSourceObjects();
SaveSourceDestination(domElement);

View file

@ -216,7 +216,7 @@ void VToolFlippingByLine::SaveDialog(QDomElement &domElement, QList<quint32> &ol
doc->SetAttribute(domElement, AttrP2Line, QString().setNum(dialogTool->GetSecondLinePointId()));
doc->SetAttribute(domElement, AttrSuffix, dialogTool->GetSuffix());
doc->SetAttributeOrRemoveIf<QString>(domElement, AttrNotes, dialogTool->GetNotes(),
[](const QString &notes){return notes.isEmpty();});
[](const QString &notes) noexcept {return notes.isEmpty();});
source = dialogTool->GetSourceObjects();
SaveSourceDestination(domElement);

View file

@ -741,19 +741,20 @@ void VAbstractOperation::UpdateNamePosition(quint32 id, const QPointF &pos)
//---------------------------------------------------------------------------------------------------------------------
void VAbstractOperation::SaveSourceDestination(QDomElement &tag)
{
doc->RemoveAllChildren(tag);
VAbstractPattern::RemoveAllChildren(tag);
QDomElement tagObjects = doc->createElement(TagSource);
for (auto sItem : qAsConst(source))
for (const auto& sItem : qAsConst(source))
{
QDomElement item = doc->createElement(TagItem);
doc->SetAttribute(item, AttrIdObject, sItem.id);
doc->SetAttributeOrRemoveIf<QString>(item, AttrAlias, sItem.alias,
[](const QString &alias){return alias.isEmpty();});
[](const QString &alias) noexcept {return alias.isEmpty();});
doc->SetAttributeOrRemoveIf<QString>(item, AttrPenStyle, sItem.penStyle,
[](const QString &penStyle){return penStyle == TypeLineDefault;});
[](const QString &penStyle) noexcept
{return penStyle == TypeLineDefault;});
doc->SetAttributeOrRemoveIf<QString>(item, AttrColor, sItem.color,
[](const QString &color){return color == ColorDefault;});
[](const QString &color) noexcept {return color == ColorDefault;});
tagObjects.appendChild(item);
}
tag.appendChild(tagObjects);
@ -767,10 +768,21 @@ void VAbstractOperation::SaveSourceDestination(QDomElement &tag)
VAbstractSimple *obj = operatedObjects.value(dItem.id, nullptr);
doc->SetAttributeOrRemoveIf<double>(item, AttrMx, VAbstractValApplication::VApp()->fromPixel(dItem.mx),
[obj](double){return obj && obj->GetType() != GOType::Point;});
[obj](double value) noexcept
{
Q_UNUSED(value)
return obj && obj->GetType() != GOType::Point;
});
doc->SetAttributeOrRemoveIf<double>(item, AttrMy, VAbstractValApplication::VApp()->fromPixel(dItem.my),
[obj](double){return obj && obj->GetType() != GOType::Point;});
doc->SetAttributeOrRemoveIf<bool>(item, AttrShowLabel, dItem.showLabel, [](bool showLabel){return showLabel;});
[obj](double value ) noexcept
{
Q_UNUSED(value)
return obj && obj->GetType() != GOType::Point;
});
doc->SetAttributeOrRemoveIf<bool>(item, AttrShowLabel, dItem.showLabel,
[](bool showLabel) noexcept {return showLabel;});
tagObjects.appendChild(item);
}

View file

@ -489,7 +489,7 @@ void VToolMove::SaveDialog(QDomElement &domElement, QList<quint32> &oldDependenc
doc->SetAttribute(domElement, AttrCenter, QString().setNum(dialogTool->GetRotationOrigPointId()));
doc->SetAttribute(domElement, AttrRotationAngle, dialogTool->GetRotationAngle());
doc->SetAttributeOrRemoveIf<QString>(domElement, AttrNotes, dialogTool->GetNotes(),
[](const QString &notes){return notes.isEmpty();});
[](const QString &notes) noexcept {return notes.isEmpty();});
source = dialogTool->GetSourceObjects();
SaveSourceDestination(domElement);

View file

@ -365,7 +365,7 @@ void VToolRotation::SaveDialog(QDomElement &domElement, QList<quint32> &oldDepen
doc->SetAttribute(domElement, AttrAngle, dialogTool->GetAngle());
doc->SetAttribute(domElement, AttrSuffix, dialogTool->GetSuffix());
doc->SetAttributeOrRemoveIf<QString>(domElement, AttrNotes, dialogTool->GetNotes(),
[](const QString &notes){return notes.isEmpty();});
[](const QString &notes) noexcept {return notes.isEmpty();});
source = dialogTool->GetSourceObjects();
SaveSourceDestination(domElement);

View file

@ -323,7 +323,7 @@ void VAbstractSpline::SaveOptions(QDomElement &tag, QSharedPointer<VGObject> &ob
doc->SetAttribute(tag, AttrPenStyle, curve->GetPenStyle());
doc->SetAttribute(tag, AttrAScale, curve->GetApproximationScale());
doc->SetAttributeOrRemoveIf<QString>(tag, AttrAlias, curve->GetAliasSuffix(),
[](const QString &suffix){return suffix.isEmpty();});
[](const QString &suffix) noexcept {return suffix.isEmpty();});
}
//---------------------------------------------------------------------------------------------------------------------

View file

@ -342,9 +342,9 @@ void VToolArc::SaveDialog(QDomElement &domElement, QList<quint32> &oldDependenci
doc->SetAttribute(domElement, AttrPenStyle, dialogTool->GetPenStyle());
doc->SetAttribute(domElement, AttrAScale, dialogTool->GetApproximationScale());
doc->SetAttributeOrRemoveIf<QString>(domElement, AttrAlias, dialogTool->GetAliasSuffix(),
[](const QString &suffix){return suffix.isEmpty();});
[](const QString &suffix) noexcept {return suffix.isEmpty();});
doc->SetAttributeOrRemoveIf<QString>(domElement, AttrNotes, dialogTool->GetNotes(),
[](const QString &notes){return notes.isEmpty();});
[](const QString &notes) noexcept {return notes.isEmpty();});
}
//---------------------------------------------------------------------------------------------------------------------

View file

@ -321,9 +321,9 @@ void VToolArcWithLength::SaveDialog(QDomElement &domElement, QList<quint32> &old
doc->SetAttribute(domElement, AttrPenStyle, dialogTool->GetPenStyle());
doc->SetAttribute(domElement, AttrAScale, dialogTool->GetApproximationScale());
doc->SetAttributeOrRemoveIf<QString>(domElement, AttrAlias, dialogTool->GetAliasSuffix(),
[](const QString &suffix){return suffix.isEmpty();});
[](const QString &suffix) noexcept {return suffix.isEmpty();});
doc->SetAttributeOrRemoveIf<QString>(domElement, AttrNotes, dialogTool->GetNotes(),
[](const QString &notes){return notes.isEmpty();});
[](const QString &notes) noexcept {return notes.isEmpty();});
}
//---------------------------------------------------------------------------------------------------------------------

View file

@ -233,7 +233,7 @@ void VToolCubicBezier::SaveDialog(QDomElement &domElement, QList<quint32> &oldDe
AddDependence(newDependencies, spl.GetP3().id());
AddDependence(newDependencies, spl.GetP4().id());
doc->SetAttributeOrRemoveIf<QString>(domElement, AttrNotes, dialogTool->GetNotes(),
[](const QString &notes){return notes.isEmpty();});
[](const QString &notes) noexcept {return notes.isEmpty();});
SetSplineAttributes(domElement, spl);
}
@ -291,7 +291,7 @@ void VToolCubicBezier::SetSplineAttributes(QDomElement &domElement, const VCubic
doc->SetAttribute(domElement, AttrPenStyle, spl.GetPenStyle());
doc->SetAttribute(domElement, AttrAScale, spl.GetApproximationScale());
doc->SetAttributeOrRemoveIf<quint32>(domElement, AttrDuplicate, spl.GetDuplicate(),
[](quint32 duplicate){return duplicate == 0;});
[](quint32 duplicate) noexcept {return duplicate == 0;});
doc->SetAttributeOrRemoveIf<QString>(domElement, AttrAlias, spl.GetAliasSuffix(),
[](const QString &suffix){return suffix.isEmpty();});
[](const QString &suffix) noexcept {return suffix.isEmpty();});
}

View file

@ -220,7 +220,7 @@ void VToolCubicBezierPath::SaveDialog(QDomElement &domElement, QList<quint32> &o
}
doc->SetAttributeOrRemoveIf<QString>(domElement, AttrNotes, dialogTool->GetNotes(),
[](const QString &notes){return notes.isEmpty();});
[](const QString &notes) noexcept {return notes.isEmpty();});
SetSplinePathAttributes(domElement, splPath);
}
@ -275,7 +275,7 @@ void VToolCubicBezierPath::SetSplinePathAttributes(QDomElement &domElement, cons
{
doc->SetAttribute(domElement, AttrType, ToolType);
doc->SetAttributeOrRemoveIf<quint32>(domElement, AttrDuplicate, path.GetDuplicate(),
[](quint32 duplicate){return duplicate <= 0;});
[](quint32 duplicate) noexcept {return duplicate <= 0;});
doc->SetAttribute(domElement, AttrColor, path.GetColor());
doc->SetAttribute(domElement, AttrPenStyle, path.GetPenStyle());
doc->SetAttribute(domElement, AttrAScale, path.GetApproximationScale());

View file

@ -389,9 +389,9 @@ void VToolEllipticalArc::SaveDialog(QDomElement &domElement, QList<quint32> &old
doc->SetAttribute(domElement, AttrColor, dialogTool->GetColor());
doc->SetAttribute(domElement, AttrPenStyle, dialogTool->GetPenStyle());
doc->SetAttributeOrRemoveIf<QString>(domElement, AttrAlias, dialogTool->GetAliasSuffix(),
[](const QString &suffix){return suffix.isEmpty();});
[](const QString &suffix) noexcept {return suffix.isEmpty();});
doc->SetAttributeOrRemoveIf<QString>(domElement, AttrNotes, dialogTool->GetNotes(),
[](const QString &notes){return notes.isEmpty();});
[](const QString &notes) noexcept {return notes.isEmpty();});
}
//---------------------------------------------------------------------------------------------------------------------

View file

@ -346,7 +346,7 @@ void VToolSpline::SaveDialog(QDomElement &domElement, QList<quint32> &oldDepende
controlPoints[1]->blockSignals(false);
doc->SetAttributeOrRemoveIf<QString>(domElement, AttrNotes, dialogTool->GetNotes(),
[](const QString &notes){return notes.isEmpty();});
[](const QString &notes) noexcept {return notes.isEmpty();});
SetSplineAttributes(domElement, spl);
}
@ -656,9 +656,9 @@ void VToolSpline::SetSplineAttributes(QDomElement &domElement, const VSpline &sp
doc->SetAttribute(domElement, AttrPenStyle, spl.GetPenStyle());
doc->SetAttribute(domElement, AttrAScale, spl.GetApproximationScale());
doc->SetAttributeOrRemoveIf<quint32>(domElement, AttrDuplicate, spl.GetDuplicate(),
[](quint32 duplicate){return duplicate == 0;});
[](quint32 duplicate) noexcept {return duplicate == 0;});
doc->SetAttributeOrRemoveIf<QString>(domElement, AttrAlias, spl.GetAliasSuffix(),
[](const QString &suffix){return suffix.isEmpty();});
[](const QString &suffix) noexcept {return suffix.isEmpty();});
if (domElement.hasAttribute(AttrKCurve))
{

View file

@ -398,7 +398,7 @@ void VToolSplinePath::SetSplinePathAttributes(QDomElement &domElement, const VSp
{
doc->SetAttribute(domElement, AttrType, ToolType);
doc->SetAttributeOrRemoveIf<quint32>(domElement, AttrDuplicate, path.GetDuplicate(),
[](quint32 duplicate){return duplicate == 0;});
[](quint32 duplicate) noexcept {return duplicate == 0;});
if (domElement.hasAttribute(AttrKCurve))
{
@ -409,7 +409,7 @@ void VToolSplinePath::SetSplinePathAttributes(QDomElement &domElement, const VSp
doc->SetAttribute(domElement, AttrPenStyle, path.GetPenStyle());
doc->SetAttribute(domElement, AttrAScale, path.GetApproximationScale());
doc->SetAttributeOrRemoveIf<QString>(domElement, AttrAlias, path.GetAliasSuffix(),
[](const QString &suffix){return suffix.isEmpty();});
[](const QString &suffix) noexcept {return suffix.isEmpty();});
UpdatePathPoints(doc, domElement, path);
}
@ -547,7 +547,7 @@ void VToolSplinePath::SaveDialog(QDomElement &domElement, QList<quint32> &oldDep
}
doc->SetAttributeOrRemoveIf<QString>(domElement, AttrNotes, dialogTool->GetNotes(),
[](const QString &notes){return notes.isEmpty();});
[](const QString &notes) noexcept {return notes.isEmpty();});
SetSplinePathAttributes(domElement, splPath);
}

View file

@ -291,7 +291,7 @@ void VToolTrueDarts::SaveDialog(QDomElement &domElement, QList<quint32> &oldDepe
doc->SetAttribute(domElement, AttrDartP2, QString().setNum(dialogTool->GetSecondDartPointId()));
doc->SetAttribute(domElement, AttrDartP3, QString().setNum(dialogTool->GetThirdDartPointId()));
doc->SetAttributeOrRemoveIf<QString>(domElement, AttrNotes, dialogTool->GetNotes(),
[](const QString &notes){return notes.isEmpty();});
[](const QString &notes) noexcept {return notes.isEmpty();});
}
//---------------------------------------------------------------------------------------------------------------------

View file

@ -192,9 +192,9 @@ void VToolCut::SaveOptions(QDomElement &tag, QSharedPointer<VGObject> &obj)
VToolSinglePoint::SaveOptions(tag, obj);
doc->SetAttributeOrRemoveIf<QString>(tag, AttrAlias1, m_aliasSuffix1,
[](const QString &suffix){return suffix.isEmpty();});
[](const QString &suffix) noexcept {return suffix.isEmpty();});
doc->SetAttributeOrRemoveIf<QString>(tag, AttrAlias2, m_aliasSuffix2,
[](const QString &suffix){return suffix.isEmpty();});
[](const QString &suffix) noexcept {return suffix.isEmpty();});
}
//---------------------------------------------------------------------------------------------------------------------

View file

@ -234,13 +234,13 @@ void VToolCutArc::SaveDialog(QDomElement &domElement, QList<quint32> &oldDepende
doc->SetAttribute(domElement, AttrLength, dialogTool->GetFormula());
doc->SetAttribute(domElement, AttrArc, QString().setNum(dialogTool->getArcId()));
doc->SetAttributeOrRemoveIf<QString>(domElement, AttrAlias1, dialogTool->GetAliasSuffix1(),
[](const QString &suffix){return suffix.isEmpty();});
[](const QString &suffix) noexcept {return suffix.isEmpty();});
doc->SetAttributeOrRemoveIf<QString>(domElement, AttrAlias2, dialogTool->GetAliasSuffix2(),
[](const QString &suffix){return suffix.isEmpty();});
[](const QString &suffix) noexcept {return suffix.isEmpty();});
const QString notes = dialogTool->GetNotes();
doc->SetAttributeOrRemoveIf<QString>(domElement, AttrNotes, notes,
[](const QString &notes){return notes.isEmpty();});
[](const QString &notes) noexcept {return notes.isEmpty();});
}
//---------------------------------------------------------------------------------------------------------------------

View file

@ -231,11 +231,11 @@ void VToolCutSpline::SaveDialog(QDomElement &domElement, QList<quint32> &oldDepe
doc->SetAttribute(domElement, AttrLength, dialogTool->GetFormula());
doc->SetAttribute(domElement, AttrSpline, QString().setNum(dialogTool->getSplineId()));
doc->SetAttributeOrRemoveIf<QString>(domElement, AttrAlias1, dialogTool->GetAliasSuffix1(),
[](const QString &suffix){return suffix.isEmpty();});
[](const QString &suffix) noexcept {return suffix.isEmpty();});
doc->SetAttributeOrRemoveIf<QString>(domElement, AttrAlias2, dialogTool->GetAliasSuffix2(),
[](const QString &suffix){return suffix.isEmpty();});
[](const QString &suffix) noexcept {return suffix.isEmpty();});
doc->SetAttributeOrRemoveIf<QString>(domElement, AttrNotes, dialogTool->GetNotes(),
[](const QString &notes){return notes.isEmpty();});
[](const QString &notes) noexcept {return notes.isEmpty();});
}
//---------------------------------------------------------------------------------------------------------------------

View file

@ -327,13 +327,13 @@ void VToolCutSplinePath::SaveDialog(QDomElement &domElement, QList<quint32> &old
doc->SetAttribute(domElement, AttrLength, dialogTool->GetFormula());
doc->SetAttribute(domElement, AttrSplinePath, QString().setNum(dialogTool->getSplinePathId()));
doc->SetAttributeOrRemoveIf<QString>(domElement, AttrAlias1, dialogTool->GetAliasSuffix1(),
[](const QString &suffix){return suffix.isEmpty();});
[](const QString &suffix) noexcept {return suffix.isEmpty();});
doc->SetAttributeOrRemoveIf<QString>(domElement, AttrAlias2, dialogTool->GetAliasSuffix2(),
[](const QString &suffix){return suffix.isEmpty();});
[](const QString &suffix) noexcept {return suffix.isEmpty();});
const QString notes = dialogTool->GetNotes();
doc->SetAttributeOrRemoveIf<QString>(domElement, AttrNotes, notes,
[](const QString &notes){return notes.isEmpty();});
[](const QString &notes) noexcept {return notes.isEmpty();});
}
//---------------------------------------------------------------------------------------------------------------------

View file

@ -108,7 +108,7 @@ void VToolAlongLine::SaveDialog(QDomElement &domElement, QList<quint32> &oldDepe
const QString notes = dialogTool->GetNotes();
doc->SetAttributeOrRemoveIf<QString>(domElement, AttrNotes, notes,
[](const QString &notes){return notes.isEmpty();});
[](const QString &notes) noexcept {return notes.isEmpty();});
}
//---------------------------------------------------------------------------------------------------------------------

View file

@ -265,7 +265,7 @@ void VToolBisector::SaveDialog(QDomElement &domElement, QList<quint32> &oldDepen
doc->SetAttribute(domElement, AttrSecondPoint, QString().setNum(dialogTool->GetSecondPointId()));
doc->SetAttribute(domElement, AttrThirdPoint, QString().setNum(dialogTool->GetThirdPointId()));
doc->SetAttributeOrRemoveIf<QString>(domElement, AttrNotes, dialogTool->GetNotes(),
[](const QString &notes){return notes.isEmpty();});
[](const QString &notes) noexcept {return notes.isEmpty();});
}
//---------------------------------------------------------------------------------------------------------------------

View file

@ -278,11 +278,11 @@ void VToolCurveIntersectAxis::SaveDialog(QDomElement &domElement, QList<quint32>
doc->SetAttribute(domElement, AttrBasePoint, QString().setNum(dialogTool->GetBasePointId()));
doc->SetAttribute(domElement, AttrCurve, QString().setNum(dialogTool->getCurveId()));
doc->SetAttributeOrRemoveIf<QString>(domElement, AttrAlias1, dialogTool->GetAliasSuffix1(),
[](const QString &suffix){return suffix.isEmpty();});
[](const QString &suffix) noexcept {return suffix.isEmpty();});
doc->SetAttributeOrRemoveIf<QString>(domElement, AttrAlias2, dialogTool->GetAliasSuffix2(),
[](const QString &suffix){return suffix.isEmpty();});
[](const QString &suffix) noexcept {return suffix.isEmpty();});
doc->SetAttributeOrRemoveIf<QString>(domElement, AttrNotes, dialogTool->GetNotes(),
[](const QString &notes){return notes.isEmpty();});
[](const QString &notes) noexcept {return notes.isEmpty();});
}
//---------------------------------------------------------------------------------------------------------------------
@ -295,9 +295,9 @@ void VToolCurveIntersectAxis::SaveOptions(QDomElement &tag, QSharedPointer<VGObj
doc->SetAttribute(tag, AttrBasePoint, basePointId);
doc->SetAttribute(tag, AttrCurve, curveId);
doc->SetAttributeOrRemoveIf<QString>(tag, AttrAlias1, m_aliasSuffix1,
[](const QString &suffix){return suffix.isEmpty();});
[](const QString &suffix) noexcept {return suffix.isEmpty();});
doc->SetAttributeOrRemoveIf<QString>(tag, AttrAlias2, m_aliasSuffix2,
[](const QString &suffix){return suffix.isEmpty();});
[](const QString &suffix) noexcept {return suffix.isEmpty();});
}
//---------------------------------------------------------------------------------------------------------------------

View file

@ -194,7 +194,7 @@ void VToolEndLine::SaveDialog(QDomElement &domElement, QList<quint32> &oldDepend
doc->SetAttribute(domElement, AttrAngle, dialogTool->GetAngle());
doc->SetAttribute(domElement, AttrBasePoint, QString().setNum(dialogTool->GetBasePointId()));
doc->SetAttributeOrRemoveIf<QString>(domElement, AttrNotes, dialogTool->GetNotes(),
[](const QString &notes){return notes.isEmpty();});
[](const QString &notes) noexcept {return notes.isEmpty();});
}
//---------------------------------------------------------------------------------------------------------------------

View file

@ -226,7 +226,7 @@ void VToolHeight::SaveDialog(QDomElement &domElement, QList<quint32> &oldDepende
const QString notes = dialogTool->GetNotes();
doc->SetAttributeOrRemoveIf<QString>(domElement, AttrNotes, notes,
[](const QString &notes){return notes.isEmpty();});
[](const QString &notes) noexcept {return notes.isEmpty();});
}
//---------------------------------------------------------------------------------------------------------------------

View file

@ -282,7 +282,7 @@ void VToolLineIntersectAxis::SaveDialog(QDomElement &domElement, QList<quint32>
doc->SetAttribute(domElement, AttrP1Line, QString().setNum(dialogTool->GetFirstPointId()));
doc->SetAttribute(domElement, AttrP2Line, QString().setNum(dialogTool->GetSecondPointId()));
doc->SetAttributeOrRemoveIf<QString>(domElement, AttrNotes, dialogTool->GetNotes(),
[](const QString &notes){return notes.isEmpty();});
[](const QString &notes) noexcept {return notes.isEmpty();});
}
//---------------------------------------------------------------------------------------------------------------------

View file

@ -235,7 +235,7 @@ void VToolNormal::SaveDialog(QDomElement &domElement, QList<quint32> &oldDepende
doc->SetAttribute(domElement, AttrFirstPoint, QString().setNum(dialogTool->GetFirstPointId()));
doc->SetAttribute(domElement, AttrSecondPoint, QString().setNum(dialogTool->GetSecondPointId()));
doc->SetAttributeOrRemoveIf<QString>(domElement, AttrNotes, dialogTool->GetNotes(),
[](const QString &notes){return notes.isEmpty();});
[](const QString &notes) noexcept {return notes.isEmpty();});
}
//---------------------------------------------------------------------------------------------------------------------

View file

@ -285,7 +285,7 @@ void VToolShoulderPoint::SaveDialog(QDomElement &domElement, QList<quint32> &old
const QString notes = dialogTool->GetNotes();
doc->SetAttributeOrRemoveIf<QString>(domElement, AttrNotes, notes,
[](const QString &notes){return notes.isEmpty();});
[](const QString &notes) noexcept {return notes.isEmpty();});
}
//---------------------------------------------------------------------------------------------------------------------

View file

@ -275,7 +275,7 @@ void VToolBasePoint::SaveDialog(QDomElement &domElement, QList<quint32> &oldDepe
doc->SetAttribute(domElement, AttrX, QString().setNum(VAbstractValApplication::VApp()->fromPixel(p.x())));
doc->SetAttribute(domElement, AttrY, QString().setNum(VAbstractValApplication::VApp()->fromPixel(p.y())));
doc->SetAttributeOrRemoveIf<QString>(domElement, AttrNotes, dialogTool->GetNotes(),
[](const QString &notes){return notes.isEmpty();});
[](const QString &notes) noexcept {return notes.isEmpty();});
}
//---------------------------------------------------------------------------------------------------------------------

View file

@ -262,7 +262,7 @@ void VToolLineIntersect::SaveDialog(QDomElement &domElement, QList<quint32> &old
doc->SetAttribute(domElement, AttrP1Line2, QString().setNum(dialogTool->GetP1Line2()));
doc->SetAttribute(domElement, AttrP2Line2, QString().setNum(dialogTool->GetP2Line2()));
doc->SetAttributeOrRemoveIf<QString>(domElement, AttrNotes, dialogTool->GetNotes(),
[](const QString &notes){return notes.isEmpty();});
[](const QString &notes) noexcept {return notes.isEmpty();});
}
//---------------------------------------------------------------------------------------------------------------------

View file

@ -302,7 +302,7 @@ void VToolPointFromArcAndTangent::SaveDialog(QDomElement &domElement, QList<quin
QString().setNum(static_cast<int>(dialogTool->GetCrossCirclesPoint())));
doc->SetAttributeOrRemoveIf<QString>(domElement, AttrNotes, dialogTool->GetNotes(),
[](const QString &notes){return notes.isEmpty();});
[](const QString &notes) noexcept {return notes.isEmpty();});
}
//---------------------------------------------------------------------------------------------------------------------

View file

@ -294,7 +294,7 @@ void VToolPointFromCircleAndTangent::SaveDialog(QDomElement &domElement, QList<q
doc->SetAttribute(domElement, AttrCrossPoint,
QString().setNum(static_cast<int>(dialogTool->GetCrossCirclesPoint())));
doc->SetAttributeOrRemoveIf<QString>(domElement, AttrNotes, dialogTool->GetNotes(),
[](const QString &notes){return notes.isEmpty();});
[](const QString &notes) noexcept {return notes.isEmpty();});
}
//---------------------------------------------------------------------------------------------------------------------

View file

@ -317,7 +317,7 @@ void VToolPointOfContact::SaveDialog(QDomElement &domElement, QList<quint32> &ol
doc->SetAttribute(domElement, AttrFirstPoint, QString().setNum(dialogTool->GetFirstPoint()));
doc->SetAttribute(domElement, AttrSecondPoint, QString().setNum(dialogTool->GetSecondPoint()));
doc->SetAttributeOrRemoveIf<QString>(domElement, AttrNotes, dialogTool->GetNotes(),
[](const QString &notes){return notes.isEmpty();});
[](const QString &notes) noexcept {return notes.isEmpty();});
}
//---------------------------------------------------------------------------------------------------------------------

View file

@ -210,7 +210,7 @@ void VToolPointOfIntersection::SaveDialog(QDomElement &domElement, QList<quint32
const QString notes = dialogTool->GetNotes();
doc->SetAttributeOrRemoveIf<QString>(domElement, AttrNotes, notes,
[](const QString &notes){return notes.isEmpty();});
[](const QString &notes) noexcept {return notes.isEmpty();});
}
//---------------------------------------------------------------------------------------------------------------------

View file

@ -322,7 +322,7 @@ void VToolPointOfIntersectionArcs::SaveDialog(QDomElement &domElement, QList<qui
doc->SetAttribute(domElement, AttrSecondArc, QString().setNum(dialogTool->GetSecondArcId()));
doc->SetAttribute(domElement, AttrCrossPoint, QString().setNum(static_cast<int>(dialogTool->GetCrossArcPoint())));
doc->SetAttributeOrRemoveIf<QString>(domElement, AttrNotes, dialogTool->GetNotes(),
[](const QString &notes){return notes.isEmpty();});
[](const QString &notes) noexcept {return notes.isEmpty();});
}
//---------------------------------------------------------------------------------------------------------------------

View file

@ -334,7 +334,7 @@ void VToolPointOfIntersectionCircles::SaveDialog(QDomElement &domElement, QList<
doc->SetAttribute(domElement, AttrCrossPoint,
QString().setNum(static_cast<int>(dialogTool->GetCrossCirclesPoint())));
doc->SetAttributeOrRemoveIf<QString>(domElement, AttrNotes, dialogTool->GetNotes(),
[](const QString &notes){return notes.isEmpty();});
[](const QString &notes) noexcept {return notes.isEmpty();});
}
//---------------------------------------------------------------------------------------------------------------------

View file

@ -413,15 +413,15 @@ void VToolPointOfIntersectionCurves::SaveDialog(QDomElement &domElement, QList<q
doc->SetAttribute(domElement, AttrVCrossPoint, QString().setNum(static_cast<int>(dialogTool->GetVCrossPoint())));
doc->SetAttribute(domElement, AttrHCrossPoint, QString().setNum(static_cast<int>(dialogTool->GetHCrossPoint())));
doc->SetAttributeOrRemoveIf<QString>(domElement, AttrCurve1Alias1, dialogTool->GetCurve1AliasSuffix1(),
[](const QString &suffix){return suffix.isEmpty();});
[](const QString &suffix) noexcept {return suffix.isEmpty();});
doc->SetAttributeOrRemoveIf<QString>(domElement, AttrCurve1Alias2, dialogTool->GetCurve1AliasSuffix2(),
[](const QString &suffix){return suffix.isEmpty();});
[](const QString &suffix) noexcept {return suffix.isEmpty();});
doc->SetAttributeOrRemoveIf<QString>(domElement, AttrCurve2Alias1, dialogTool->GetCurve2AliasSuffix1(),
[](const QString &suffix){return suffix.isEmpty();});
[](const QString &suffix) noexcept {return suffix.isEmpty();});
doc->SetAttributeOrRemoveIf<QString>(domElement, AttrCurve2Alias2, dialogTool->GetCurve2AliasSuffix2(),
[](const QString &suffix){return suffix.isEmpty();});
[](const QString &suffix) noexcept {return suffix.isEmpty();});
doc->SetAttributeOrRemoveIf<QString>(domElement, AttrNotes, dialogTool->GetNotes(),
[](const QString &notes){return notes.isEmpty();});
[](const QString &notes) noexcept {return notes.isEmpty();});
}
//---------------------------------------------------------------------------------------------------------------------
@ -435,13 +435,13 @@ void VToolPointOfIntersectionCurves::SaveOptions(QDomElement &tag, QSharedPointe
doc->SetAttribute(tag, AttrVCrossPoint, static_cast<int>(vCrossPoint));
doc->SetAttribute(tag, AttrHCrossPoint, static_cast<int>(hCrossPoint));
doc->SetAttributeOrRemoveIf<QString>(tag, AttrCurve1Alias1, m_curve1AliasSuffix1,
[](const QString &suffix){return suffix.isEmpty();});
[](const QString &suffix) noexcept {return suffix.isEmpty();});
doc->SetAttributeOrRemoveIf<QString>(tag, AttrCurve1Alias2, m_curve1AliasSuffix2,
[](const QString &suffix){return suffix.isEmpty();});
[](const QString &suffix) noexcept {return suffix.isEmpty();});
doc->SetAttributeOrRemoveIf<QString>(tag, AttrCurve2Alias1, m_curve2AliasSuffix1,
[](const QString &suffix){return suffix.isEmpty();});
[](const QString &suffix) noexcept {return suffix.isEmpty();});
doc->SetAttributeOrRemoveIf<QString>(tag, AttrCurve2Alias2, m_curve2AliasSuffix2,
[](const QString &suffix){return suffix.isEmpty();});
[](const QString &suffix) noexcept {return suffix.isEmpty();});
}
//---------------------------------------------------------------------------------------------------------------------

View file

@ -307,7 +307,7 @@ void VToolTriangle::SaveDialog(QDomElement &domElement, QList<quint32> &oldDepen
const QString notes = dialogTool->GetNotes();
doc->SetAttributeOrRemoveIf<QString>(domElement, AttrNotes, notes,
[](const QString &notes){return notes.isEmpty();});
[](const QString &notes) noexcept {return notes.isEmpty();});
}
//---------------------------------------------------------------------------------------------------------------------

View file

@ -176,7 +176,8 @@ void VDrawTool::SaveOptions(QDomElement &tag, QSharedPointer<VGObject> &obj)
Q_UNUSED(obj)
doc->SetAttribute(tag, VDomDocument::AttrId, m_id);
doc->SetAttributeOrRemoveIf<QString>(tag, AttrNotes, m_notes, [](const QString &notes){return notes.isEmpty();});
doc->SetAttributeOrRemoveIf<QString>(tag, AttrNotes, m_notes,
[](const QString &notes) noexcept {return notes.isEmpty();});
}
//---------------------------------------------------------------------------------------------------------------------

View file

@ -394,7 +394,7 @@ void VToolLine::SaveDialog(QDomElement &domElement, QList<quint32> &oldDependenc
doc->SetAttribute(domElement, AttrTypeLine, dialogTool->GetTypeLine());
doc->SetAttribute(domElement, AttrLineColor, dialogTool->GetLineColor());
doc->SetAttributeOrRemoveIf<QString>(domElement, AttrNotes, dialogTool->GetNotes(),
[](const QString &notes){return notes.isEmpty();});
[](const QString &notes) noexcept {return notes.isEmpty();});
}
//---------------------------------------------------------------------------------------------------------------------

View file

@ -542,9 +542,9 @@ QDomElement VAbstractTool::AddSANode(VAbstractPattern *doc, const QString &tagNa
}
doc->SetAttributeOrRemoveIf<bool>(nod, VAbstractPattern::AttrNodeExcluded, node.IsExcluded(),
[](bool exclude){return not exclude;});
[](bool exclude) noexcept {return not exclude;});
doc->SetAttributeOrRemoveIf<bool>(nod, VAbstractPattern::AttrCheckUniqueness, node.IsCheckUniqueness(),
[](bool uniqueness){return uniqueness;});
[](bool uniqueness) noexcept {return uniqueness;});
switch (type)
{
@ -602,12 +602,12 @@ QDomElement VAbstractTool::AddSANode(VAbstractPattern *doc, const QString &tagNa
}
doc->SetAttributeOrRemoveIf<bool>(nod, VAbstractPattern::AttrNodeShowSecondPassmark, node.IsShowSecondPassmark(),
[](bool show){return show;});
[](bool show) noexcept {return show;});
doc->SetAttributeOrRemoveIf<bool>(nod, VAbstractPattern::AttrManualPassmarkLength, node.IsManualPassmarkLength(),
[](bool manualPassmarkLength){return not manualPassmarkLength;});
[](bool manualPassmarkLength) noexcept {return not manualPassmarkLength;});
doc->SetAttributeOrRemoveIf<QString>(nod, VAbstractPattern::AttrPassmarkLength, node.GetFormulaPassmarkLength(),
[node](const QString &){return not node.IsManualPassmarkLength();});
[node](const QString &) noexcept {return not node.IsManualPassmarkLength();});
return nod;
}

View file

@ -333,23 +333,24 @@ void VToolSeamAllowance::AddAttributes(VAbstractPattern *doc, QDomElement &domEl
doc->SetAttribute(domElement, AttrName, piece.GetName());
doc->SetAttribute(domElement, AttrUUID, piece.GetUUID().toString());
doc->SetAttributeOrRemoveIf<QString>(domElement, AttrGradationLabel, piece.GetGradationLabel(),
[](const QString &label){return label.isEmpty();});
[](const QString &label) noexcept {return label.isEmpty();});
doc->SetAttribute(domElement, AttrVersion, QString().setNum(pieceVersion));
doc->SetAttribute(domElement, AttrMx, VAbstractValApplication::VApp()->fromPixel(piece.GetMx()));
doc->SetAttribute(domElement, AttrMy, VAbstractValApplication::VApp()->fromPixel(piece.GetMy()));
doc->SetAttributeOrRemoveIf<bool>(domElement, AttrInLayout, piece.IsInLayout(),
[](bool inLayout){return inLayout;});
[](bool inLayout) noexcept {return inLayout;});
doc->SetAttribute(domElement, AttrForbidFlipping, piece.IsForbidFlipping());
doc->SetAttribute(domElement, AttrForceFlipping, piece.IsForceFlipping());
doc->SetAttributeOrRemoveIf<bool>(domElement, AttrSeamAllowance, piece.IsSeamAllowance(),
[](bool seamAllowance){return not seamAllowance;});
[](bool seamAllowance) noexcept {return not seamAllowance;});
doc->SetAttribute(domElement, AttrHideMainPath, piece.IsHideMainPath());
doc->SetAttributeOrRemoveIf<bool>(domElement, AttrSeamAllowanceBuiltIn, piece.IsSeamAllowanceBuiltIn(),
[](bool builtin){return not builtin;});
[](bool builtin) noexcept {return not builtin;});
doc->SetAttribute(domElement, AttrWidth, piece.GetFormulaSAWidth());
doc->SetAttributeOrRemoveIf<bool>(domElement, AttrUnited, piece.IsUnited(), [](bool united){return not united;});
doc->SetAttributeOrRemoveIf<bool>(domElement, AttrUnited, piece.IsUnited(),
[](bool united) noexcept {return not united;});
doc->SetAttributeOrRemoveIf<uint>(domElement, AttrPiecePriority, piece.GetPriority(),
[](uint priority){return priority == 0;});
[](uint priority) noexcept {return priority == 0;});
}
//---------------------------------------------------------------------------------------------------------------------
@ -431,11 +432,11 @@ void VToolSeamAllowance::AddPatternPieceData(VAbstractPattern *doc, QDomElement
doc->SetAttribute(domData, AttrFont, data.GetFontSize());
doc->SetAttribute(domData, VAbstractPattern::AttrRotation, data.GetRotation());
doc->SetAttributeOrRemoveIf<quint32>(domData, AttrCenterPin, data.CenterPin(),
[](quint32 pin){return pin == NULL_ID;});
[](quint32 pin) noexcept {return pin == NULL_ID;});
doc->SetAttributeOrRemoveIf<quint32>(domData, AttrTopLeftPin, data.TopLeftPin(),
[](quint32 leftPin){return leftPin == NULL_ID;});
[](quint32 leftPin) noexcept {return leftPin == NULL_ID;});
doc->SetAttributeOrRemoveIf<quint32>(domData, AttrBottomRightPin, data.BottomRightPin(),
[](quint32 rightPin){return rightPin == NULL_ID;});
[](quint32 rightPin) noexcept {return rightPin == NULL_ID;});
doc->SetLabelTemplate(domData, data.GetLabelTemplate());
domElement.appendChild(domData);
@ -454,11 +455,11 @@ void VToolSeamAllowance::AddPatternInfo(VAbstractPattern *doc, QDomElement &domE
doc->SetAttribute(domData, AttrFont, geom.GetFontSize());
doc->SetAttribute(domData, VAbstractPattern::AttrRotation, geom.GetRotation());
doc->SetAttributeOrRemoveIf<quint32>(domData, AttrCenterPin, geom.CenterPin(),
[](quint32 pin){return pin <= NULL_ID;});
[](quint32 pin) noexcept {return pin <= NULL_ID;});
doc->SetAttributeOrRemoveIf<quint32>(domData, AttrTopLeftPin, geom.TopLeftPin(),
[](quint32 pin){return pin <= NULL_ID;});
[](quint32 pin) noexcept {return pin <= NULL_ID;});
doc->SetAttributeOrRemoveIf<quint32>(domData, AttrBottomRightPin, geom.BottomRightPin(),
[](quint32 pin){return pin <= NULL_ID;});
[](quint32 pin) noexcept {return pin <= NULL_ID;});
domElement.appendChild(domData);
}
@ -476,11 +477,11 @@ void VToolSeamAllowance::AddGrainline(VAbstractPattern *doc, QDomElement &domEle
doc->SetAttribute(domData, VAbstractPattern::AttrRotation, glGeom.GetRotation());
doc->SetAttribute(domData, VAbstractPattern::AttrArrows, int(glGeom.GetArrowType()));
doc->SetAttributeOrRemoveIf<quint32>(domData, AttrCenterPin, glGeom.CenterPin(),
[](quint32 pin){return pin <= NULL_ID;});
[](quint32 pin) noexcept {return pin <= NULL_ID;});
doc->SetAttributeOrRemoveIf<quint32>(domData, AttrTopPin, glGeom.TopPin(),
[](quint32 pin){return pin <= NULL_ID;});
[](quint32 pin) noexcept {return pin <= NULL_ID;});
doc->SetAttributeOrRemoveIf<quint32>(domData, AttrBottomPin, glGeom.BottomPin(),
[](quint32 pin){return pin <= NULL_ID;});
[](quint32 pin) noexcept {return pin <= NULL_ID;});
domElement.appendChild(domData);
}

View file

@ -74,7 +74,7 @@ void TogglePieceInLayout::Do(bool state)
QDomElement detail = doc->elementById(m_id, VAbstractPattern::TagDetail);
if (detail.isElement())
{
doc->SetAttributeOrRemoveIf<bool>(detail, AttrInLayout, state, [](bool state){return state;});
doc->SetAttributeOrRemoveIf<bool>(detail, AttrInLayout, state, [](bool state) noexcept {return state;});
VPiece det = m_data->DataPieces()->value(m_id);
det.SetInLayout(state);