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