Fix Valentina crash.
--HG-- branch : develop
This commit is contained in:
parent
ae870b8b2e
commit
d8a6ce669e
|
@ -62,7 +62,6 @@
|
|||
#include "../vtools/undocommands/addgroup.h"
|
||||
#include "dialogs/vwidgetdetails.h"
|
||||
#include "../vpatterndb/vpiecepath.h"
|
||||
#include "../vpatterndb/measurements.h"
|
||||
#include "../qmuparser/qmuparsererror.h"
|
||||
#include "../vtools/dialogs/support/dialogeditlabel.h"
|
||||
|
||||
|
@ -478,8 +477,7 @@ bool MainWindow::LoadMeasurements(const QString &path)
|
|||
}
|
||||
else if (m->Type() == MeasurementsType::Individual)
|
||||
{
|
||||
VContainer::SetSize(*pattern->DataVariables()->value(size_M)->GetValue());
|
||||
VContainer::SetHeight(*pattern->DataVariables()->value(height_M)->GetValue());
|
||||
SetSizeHeightForIndividualM();
|
||||
}
|
||||
|
||||
return true;
|
||||
|
@ -528,8 +526,7 @@ bool MainWindow::UpdateMeasurements(const QString &path, int size, int height)
|
|||
}
|
||||
else if (m->Type() == MeasurementsType::Individual)
|
||||
{
|
||||
VContainer::SetSize(*pattern->DataVariables()->value(size_M)->GetValue());
|
||||
VContainer::SetHeight(*pattern->DataVariables()->value(height_M)->GetValue());
|
||||
SetSizeHeightForIndividualM();
|
||||
}
|
||||
|
||||
return true;
|
||||
|
|
|
@ -40,6 +40,7 @@
|
|||
#include "../vpatterndb/floatItemData/vpiecelabeldata.h"
|
||||
#include "../vpatterndb/floatItemData/vpatternlabeldata.h"
|
||||
#include "../vpatterndb/floatItemData/vgrainlinedata.h"
|
||||
#include "../vpatterndb/measurements.h"
|
||||
#include "../vtools/tools/vabstracttool.h"
|
||||
#include "../vtools/tools/vtoolseamallowance.h"
|
||||
|
||||
|
@ -1515,6 +1516,30 @@ QString MainWindowsNoGUI::FileName() const
|
|||
return QFileInfo(fileName).baseName();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void MainWindowsNoGUI::SetSizeHeightForIndividualM() const
|
||||
{
|
||||
const QHash<QString, QSharedPointer<VInternalVariable> > * vars = pattern->DataVariables();
|
||||
|
||||
if (vars->contains(size_M))
|
||||
{
|
||||
VContainer::SetSize(*vars->value(size_M)->GetValue());
|
||||
}
|
||||
else
|
||||
{
|
||||
VContainer::SetSize(0);
|
||||
}
|
||||
|
||||
if (vars->contains(height_M))
|
||||
{
|
||||
VContainer::SetHeight(*vars->value(height_M)->GetValue());
|
||||
}
|
||||
else
|
||||
{
|
||||
VContainer::SetHeight(0);
|
||||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
int MainWindowsNoGUI::ContinueIfLayoutStale()
|
||||
{
|
||||
|
|
|
@ -99,6 +99,7 @@ protected:
|
|||
bool LayoutSettings(VLayoutGenerator& lGenerator);
|
||||
int ContinueIfLayoutStale();
|
||||
QString FileName() const;
|
||||
void SetSizeHeightForIndividualM() const;
|
||||
private slots:
|
||||
void PrintPages (QPrinter *printer);
|
||||
void ErrorConsoleMode(const LayoutErrors &state);
|
||||
|
|
Loading…
Reference in New Issue
Block a user