Fix build issues.

This commit is contained in:
Roman Telezhynskyi 2023-05-09 19:27:56 +03:00
parent dd1dccea7d
commit fbbcf5320f
3 changed files with 33 additions and 31 deletions

View File

@ -654,32 +654,32 @@ auto DialogIncrements::IncrementUsed(const QString &name) const -> bool
{
const QVector<VFormulaField> expressions = m_doc->ListExpressions();
return std::ranges::any_of(expressions,
[name](const auto &field)
return std::any_of(expressions.constBegin(), expressions.constEnd(),
[name](const auto &field)
{
if (field.expression.indexOf(name) == -1)
{
return false;
}
// Eval formula
try
{
QScopedPointer<qmu::QmuTokenParser> cal(
new qmu::QmuTokenParser(field.expression, false, false));
// Tokens (variables, measurements)
if (cal->GetTokens().values().contains(name))
{
if (field.expression.indexOf(name) == -1)
{
return false;
}
// Eval formula
try
{
QScopedPointer<qmu::QmuTokenParser> cal(
new qmu::QmuTokenParser(field.expression, false, false));
// Tokens (variables, measurements)
if (cal->GetTokens().values().contains(name))
{
return true;
}
}
catch (const qmu::QmuParserError &)
{
// Do nothing. Because we not sure if used. A formula is broken.
}
return false;
});
return true;
}
}
catch (const qmu::QmuParserError &)
{
// Do nothing. Because we not sure if used. A formula is broken.
}
return false;
});
}
//---------------------------------------------------------------------------------------------------------------------

View File

@ -27,18 +27,19 @@
*************************************************************************/
#include "vlayoutexporter.h"
#include <QCursor>
#include <QFileInfo>
#include <QGraphicsItem>
#include <QGraphicsScene>
#include <QGuiApplication>
#include <QImageWriter>
#include <QPainter>
#include <QPrinter>
#include <QProcess>
#include <QSvgGenerator>
#include <QTemporaryFile>
#include <QtDebug>
#include <QCursor>
#include <QGraphicsItem>
#include <QImageWriter>
#include <QtMath>
#include "../ifc/exception/vexception.h"
#include "../vdxf/vdxfpaintdevice.h"

View File

@ -28,12 +28,13 @@
#include <cmath>
#include <QPainter>
#include <QGraphicsSceneMouseEvent>
#include <QStyleOptionGraphicsItem>
#include <QDebug>
#include <QGraphicsScene>
#include <QGraphicsSceneMouseEvent>
#include <QGraphicsView>
#include <QPainter>
#include <QStyleOptionGraphicsItem>
#include <QtMath>
#include "../vmisc/def.h"
#include "../vmisc/vabstractapplication.h"