Fix updating dimension placeholder for individual measurements.

This commit is contained in:
Roman Telezhynskyi 2020-10-22 19:24:18 +03:00
parent 7a28cbb14a
commit 909c703c46

View File

@ -2121,27 +2121,25 @@ void MainWindow::StoreIndividualMDimensions()
auto StoreDimension = [this, measurements](IMD type)
{
const QString name = m->MeasurementForDimension(type);
if (not name.isEmpty() && measurements.contains(name))
{
const bool valid = not name.isEmpty() && measurements.contains(name);
switch(type)
{
case IMD::X:
qApp->SetDimensionHeight(*measurements.value(name)->GetValue());
qApp->SetDimensionHeight(valid ? *measurements.value(name)->GetValue() : 0);
break;
case IMD::Y:
qApp->SetDimensionSize(*measurements.value(name)->GetValue());
qApp->SetDimensionSize(valid ? *measurements.value(name)->GetValue() : 0);
break;
case IMD::W:
qApp->SetDimensionHip(*measurements.value(name)->GetValue());
qApp->SetDimensionHip(valid ? *measurements.value(name)->GetValue() : 0);
break;
case IMD::Z:
qApp->SetDimensionWaist(*measurements.value(name)->GetValue());
qApp->SetDimensionWaist(valid ? *measurements.value(name)->GetValue() : 0);
break;
case IMD::N:
default:
break;
}
}
};
StoreDimension(IMD::X);