Fix crash when a notch is empty.

This commit is contained in:
Roman Telezhynskyi 2020-09-22 14:43:39 +03:00
parent c8a624f632
commit 0828f25788
21 changed files with 372 additions and 6 deletions

View File

@ -9780,6 +9780,22 @@ This option will take an affect after restart.</source>
<source>Error calculating segment for curve &apos;%1&apos;. %2</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Cannot prepare builtin passmark &apos;%1&apos; for piece &apos;%2&apos;. Passmark is empty.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Cannot prepare builtin passmark &apos;%1&apos; for piece &apos;%2&apos;. Passmark base line is empty.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Cannot prepare passmark &apos;%1&apos; for piece &apos;%2&apos;. Passmark base line is empty.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Cannot prepare passmark &apos;%1&apos; for piece &apos;%2&apos;. Passmark is empty.</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>QSaveFile</name>

View File

@ -9565,6 +9565,22 @@ Tato volba se projeví po opětovném spuštění.</translation>
<source>Error calculating segment for curve &apos;%1&apos;. %2</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Cannot prepare builtin passmark &apos;%1&apos; for piece &apos;%2&apos;. Passmark is empty.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Cannot prepare builtin passmark &apos;%1&apos; for piece &apos;%2&apos;. Passmark base line is empty.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Cannot prepare passmark &apos;%1&apos; for piece &apos;%2&apos;. Passmark base line is empty.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Cannot prepare passmark &apos;%1&apos; for piece &apos;%2&apos;. Passmark is empty.</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>QSaveFile</name>

View File

@ -9562,6 +9562,22 @@ Diese Option wird nach einem Neustart aktiv.</translation>
<source>Error calculating segment for curve &apos;%1&apos;. %2</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Cannot prepare builtin passmark &apos;%1&apos; for piece &apos;%2&apos;. Passmark is empty.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Cannot prepare builtin passmark &apos;%1&apos; for piece &apos;%2&apos;. Passmark base line is empty.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Cannot prepare passmark &apos;%1&apos; for piece &apos;%2&apos;. Passmark base line is empty.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Cannot prepare passmark &apos;%1&apos; for piece &apos;%2&apos;. Passmark is empty.</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>QSaveFile</name>

View File

@ -9374,6 +9374,22 @@ This option will take an affect after restart.</source>
<source>Error calculating segment for curve &apos;%1&apos;. %2</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Cannot prepare builtin passmark &apos;%1&apos; for piece &apos;%2&apos;. Passmark is empty.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Cannot prepare builtin passmark &apos;%1&apos; for piece &apos;%2&apos;. Passmark base line is empty.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Cannot prepare passmark &apos;%1&apos; for piece &apos;%2&apos;. Passmark base line is empty.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Cannot prepare passmark &apos;%1&apos; for piece &apos;%2&apos;. Passmark is empty.</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>QmuParser</name>

View File

@ -9556,6 +9556,22 @@ This option will take an affect after restart.</source>
<source>Error calculating segment for curve &apos;%1&apos;. %2</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Cannot prepare builtin passmark &apos;%1&apos; for piece &apos;%2&apos;. Passmark is empty.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Cannot prepare builtin passmark &apos;%1&apos; for piece &apos;%2&apos;. Passmark base line is empty.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Cannot prepare passmark &apos;%1&apos; for piece &apos;%2&apos;. Passmark base line is empty.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Cannot prepare passmark &apos;%1&apos; for piece &apos;%2&apos;. Passmark is empty.</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>QSaveFile</name>

View File

@ -9556,6 +9556,22 @@ This option will take an affect after restart.</source>
<source>Error calculating segment for curve &apos;%1&apos;. %2</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Cannot prepare builtin passmark &apos;%1&apos; for piece &apos;%2&apos;. Passmark is empty.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Cannot prepare builtin passmark &apos;%1&apos; for piece &apos;%2&apos;. Passmark base line is empty.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Cannot prepare passmark &apos;%1&apos; for piece &apos;%2&apos;. Passmark base line is empty.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Cannot prepare passmark &apos;%1&apos; for piece &apos;%2&apos;. Passmark is empty.</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>QSaveFile</name>

View File

@ -9556,6 +9556,22 @@ This option will take an affect after restart.</source>
<source>Error calculating segment for curve &apos;%1&apos;. %2</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Cannot prepare builtin passmark &apos;%1&apos; for piece &apos;%2&apos;. Passmark is empty.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Cannot prepare builtin passmark &apos;%1&apos; for piece &apos;%2&apos;. Passmark base line is empty.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Cannot prepare passmark &apos;%1&apos; for piece &apos;%2&apos;. Passmark base line is empty.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Cannot prepare passmark &apos;%1&apos; for piece &apos;%2&apos;. Passmark is empty.</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>QSaveFile</name>

View File

@ -9563,6 +9563,22 @@ Esta opción surtirá efecto después de reiniciar.</translation>
<source>Error calculating segment for curve &apos;%1&apos;. %2</source>
<translation>Error calculando el segmento para la curva &apos;%1&apos;. %2</translation>
</message>
<message>
<source>Cannot prepare builtin passmark &apos;%1&apos; for piece &apos;%2&apos;. Passmark is empty.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Cannot prepare builtin passmark &apos;%1&apos; for piece &apos;%2&apos;. Passmark base line is empty.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Cannot prepare passmark &apos;%1&apos; for piece &apos;%2&apos;. Passmark base line is empty.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Cannot prepare passmark &apos;%1&apos; for piece &apos;%2&apos;. Passmark is empty.</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>QSaveFile</name>

View File

@ -8526,6 +8526,22 @@ This option will take an affect after restart.</source>
<source>Error calculating segment for curve &apos;%1&apos;. %2</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Cannot prepare builtin passmark &apos;%1&apos; for piece &apos;%2&apos;. Passmark is empty.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Cannot prepare builtin passmark &apos;%1&apos; for piece &apos;%2&apos;. Passmark base line is empty.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Cannot prepare passmark &apos;%1&apos; for piece &apos;%2&apos;. Passmark base line is empty.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Cannot prepare passmark &apos;%1&apos; for piece &apos;%2&apos;. Passmark is empty.</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>QmuParser</name>

View File

@ -9541,6 +9541,22 @@ This option will take an affect after restart.</source>
<source>Error calculating segment for curve &apos;%1&apos;. %2</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Cannot prepare builtin passmark &apos;%1&apos; for piece &apos;%2&apos;. Passmark is empty.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Cannot prepare builtin passmark &apos;%1&apos; for piece &apos;%2&apos;. Passmark base line is empty.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Cannot prepare passmark &apos;%1&apos; for piece &apos;%2&apos;. Passmark base line is empty.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Cannot prepare passmark &apos;%1&apos; for piece &apos;%2&apos;. Passmark is empty.</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>QSaveFile</name>

View File

@ -7489,6 +7489,22 @@ This option will take an affect after restart.</source>
<source>Error calculating segment for curve &apos;%1&apos;. %2</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Cannot prepare builtin passmark &apos;%1&apos; for piece &apos;%2&apos;. Passmark is empty.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Cannot prepare builtin passmark &apos;%1&apos; for piece &apos;%2&apos;. Passmark base line is empty.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Cannot prepare passmark &apos;%1&apos; for piece &apos;%2&apos;. Passmark base line is empty.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Cannot prepare passmark &apos;%1&apos; for piece &apos;%2&apos;. Passmark is empty.</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>QmuParser</name>

View File

@ -7827,6 +7827,22 @@ This option will take an affect after restart.</source>
<source>Error calculating segment for curve &apos;%1&apos;. %2</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Cannot prepare builtin passmark &apos;%1&apos; for piece &apos;%2&apos;. Passmark is empty.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Cannot prepare builtin passmark &apos;%1&apos; for piece &apos;%2&apos;. Passmark base line is empty.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Cannot prepare passmark &apos;%1&apos; for piece &apos;%2&apos;. Passmark base line is empty.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Cannot prepare passmark &apos;%1&apos; for piece &apos;%2&apos;. Passmark is empty.</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>QmuParser</name>

View File

@ -9551,6 +9551,22 @@ Questa opzione sarà effettiva dopo il riavvio del programma.</translation>
<source>Error calculating segment for curve &apos;%1&apos;. %2</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Cannot prepare builtin passmark &apos;%1&apos; for piece &apos;%2&apos;. Passmark is empty.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Cannot prepare builtin passmark &apos;%1&apos; for piece &apos;%2&apos;. Passmark base line is empty.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Cannot prepare passmark &apos;%1&apos; for piece &apos;%2&apos;. Passmark base line is empty.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Cannot prepare passmark &apos;%1&apos; for piece &apos;%2&apos;. Passmark is empty.</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>QSaveFile</name>

View File

@ -9562,6 +9562,22 @@ Deze optie wordt actief na een herstart..</translation>
<source>Error calculating segment for curve &apos;%1&apos;. %2</source>
<translation>Fout bij berekenen segment voor boog &apos;%1&apos;. %2 </translation>
</message>
<message>
<source>Cannot prepare builtin passmark &apos;%1&apos; for piece &apos;%2&apos;. Passmark is empty.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Cannot prepare builtin passmark &apos;%1&apos; for piece &apos;%2&apos;. Passmark base line is empty.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Cannot prepare passmark &apos;%1&apos; for piece &apos;%2&apos;. Passmark base line is empty.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Cannot prepare passmark &apos;%1&apos; for piece &apos;%2&apos;. Passmark is empty.</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>QSaveFile</name>

View File

@ -8609,6 +8609,22 @@ This option will take an affect after restart.</source>
<source>Error calculating segment for curve &apos;%1&apos;. %2</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Cannot prepare builtin passmark &apos;%1&apos; for piece &apos;%2&apos;. Passmark is empty.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Cannot prepare builtin passmark &apos;%1&apos; for piece &apos;%2&apos;. Passmark base line is empty.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Cannot prepare passmark &apos;%1&apos; for piece &apos;%2&apos;. Passmark base line is empty.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Cannot prepare passmark &apos;%1&apos; for piece &apos;%2&apos;. Passmark is empty.</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>QmuParser</name>

View File

@ -9539,6 +9539,22 @@ Esta opção terá um efeito após o reinício.</translation>
<source>Error calculating segment for curve &apos;%1&apos;. %2</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Cannot prepare builtin passmark &apos;%1&apos; for piece &apos;%2&apos;. Passmark is empty.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Cannot prepare builtin passmark &apos;%1&apos; for piece &apos;%2&apos;. Passmark base line is empty.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Cannot prepare passmark &apos;%1&apos; for piece &apos;%2&apos;. Passmark base line is empty.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Cannot prepare passmark &apos;%1&apos; for piece &apos;%2&apos;. Passmark is empty.</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>QSaveFile</name>

View File

@ -8493,6 +8493,22 @@ This option will take an affect after restart.</source>
<source>Error calculating segment for curve &apos;%1&apos;. %2</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Cannot prepare builtin passmark &apos;%1&apos; for piece &apos;%2&apos;. Passmark is empty.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Cannot prepare builtin passmark &apos;%1&apos; for piece &apos;%2&apos;. Passmark base line is empty.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Cannot prepare passmark &apos;%1&apos; for piece &apos;%2&apos;. Passmark base line is empty.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Cannot prepare passmark &apos;%1&apos; for piece &apos;%2&apos;. Passmark is empty.</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>QmuParser</name>

View File

@ -9564,6 +9564,22 @@ This option will take an affect after restart.</source>
<source>Error calculating segment for curve &apos;%1&apos;. %2</source>
<translation>Ошибка расчёта сегмента для кривой &apos;%1&apos;. %2</translation>
</message>
<message>
<source>Cannot prepare builtin passmark &apos;%1&apos; for piece &apos;%2&apos;. Passmark is empty.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Cannot prepare builtin passmark &apos;%1&apos; for piece &apos;%2&apos;. Passmark base line is empty.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Cannot prepare passmark &apos;%1&apos; for piece &apos;%2&apos;. Passmark base line is empty.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Cannot prepare passmark &apos;%1&apos; for piece &apos;%2&apos;. Passmark is empty.</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>QSaveFile</name>

View File

@ -9557,6 +9557,22 @@ This option will take an affect after restart.</source>
<source>Error calculating segment for curve &apos;%1&apos;. %2</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Cannot prepare builtin passmark &apos;%1&apos; for piece &apos;%2&apos;. Passmark is empty.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Cannot prepare builtin passmark &apos;%1&apos; for piece &apos;%2&apos;. Passmark base line is empty.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Cannot prepare passmark &apos;%1&apos; for piece &apos;%2&apos;. Passmark base line is empty.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Cannot prepare passmark &apos;%1&apos; for piece &apos;%2&apos;. Passmark is empty.</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>QSaveFile</name>

View File

@ -7613,6 +7613,22 @@ This option will take an affect after restart.</source>
<source>Error calculating segment for curve &apos;%1&apos;. %2</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Cannot prepare builtin passmark &apos;%1&apos; for piece &apos;%2&apos;. Passmark is empty.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Cannot prepare builtin passmark &apos;%1&apos; for piece &apos;%2&apos;. Passmark base line is empty.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Cannot prepare passmark &apos;%1&apos; for piece &apos;%2&apos;. Passmark base line is empty.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Cannot prepare passmark &apos;%1&apos; for piece &apos;%2&apos;. Passmark is empty.</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>QmuParser</name>

View File

@ -264,8 +264,33 @@ QVector<VLayoutPassmark> ConvertPassmarks(const VPiece &piece, const VContainer
const int nodeIndex = VPiecePath::indexOfNode(path, pData.id);
if (nodeIndex != -1)
{
layoutPassmark.lines = passmark.BuiltInSAPassmark(piece, pattern);
layoutPassmark.baseLine = ConstFirst (passmark.BuiltInSAPassmarkBaseLine(piece));
const QVector<QLineF> lines = passmark.BuiltInSAPassmark(piece, pattern);
if (lines.isEmpty())
{
const QString errorMsg =
QObject::tr("Cannot prepare builtin passmark '%1' for piece '%2'. Passmark is empty.")
.arg(pData.nodeName, piece.GetName());
qApp->IsPedantic() ? throw VException(errorMsg) :
qWarning() << VAbstractApplication::patternMessageSignature + errorMsg;
return;
}
layoutPassmark.lines = lines;
const QVector<QLineF> baseLines = passmark.BuiltInSAPassmarkBaseLine(piece);
if (baseLines.isEmpty())
{
const QString errorMsg =
QObject::tr("Cannot prepare builtin passmark '%1' for piece '%2'. Passmark base line is "
"empty.")
.arg(pData.nodeName, piece.GetName());
qApp->IsPedantic() ? throw VException(errorMsg) :
qWarning() << VAbstractApplication::patternMessageSignature + errorMsg;
return;
}
layoutPassmark.baseLine = ConstFirst (baseLines);
layoutPassmark.type = pData.passmarkLineType;
layoutPassmark.isBuiltIn = true;
@ -295,18 +320,39 @@ QVector<VLayoutPassmark> ConvertPassmarks(const VPiece &piece, const VContainer
const int nodeIndex = VPiecePath::indexOfNode(path, pData.id);
if (nodeIndex != -1)
{
QVector<QLineF> lines =
QVector<QLineF> baseLines =
passmark.SAPassmarkBaseLine(piece, pattern, static_cast<PassmarkSide>(side));
if (baseLines.isEmpty())
{
const QString errorMsg =
QObject::tr("Cannot prepare passmark '%1' for piece '%2'. Passmark base line is empty.")
.arg(pData.nodeName, piece.GetName());
qApp->IsPedantic() ? throw VException(errorMsg) :
qWarning() << VAbstractApplication::patternMessageSignature + errorMsg;
return;
}
if (side == PassmarkSide::All || side == PassmarkSide::Right)
{
layoutPassmark.baseLine = lines.first();
layoutPassmark.baseLine = baseLines.first();
}
else if (side == PassmarkSide::Right)
{
layoutPassmark.baseLine = lines.last();
layoutPassmark.baseLine = baseLines.last();
}
layoutPassmark.lines = passmark.SAPassmark(piece, pattern, side);
const QVector<QLineF> lines = passmark.SAPassmark(piece, pattern, side);
if (lines.isEmpty())
{
const QString errorMsg =
QObject::tr("Cannot prepare passmark '%1' for piece '%2'. Passmark is empty.")
.arg(pData.nodeName, piece.GetName());
qApp->IsPedantic() ? throw VException(errorMsg) :
qWarning() << VAbstractApplication::patternMessageSignature + errorMsg;
return;
}
layoutPassmark.lines = lines;
layoutPassmark.type = pData.passmarkLineType;
layoutPassmark.isBuiltIn = false;