Fixed issue #622. Piece lost custom seam allowance data.

--HG--
branch : develop
This commit is contained in:
Roman Telezhynskyi 2017-02-08 10:28:18 +02:00
parent a740d52861
commit a1774149f6
2 changed files with 5 additions and 2 deletions

View File

@ -40,6 +40,7 @@
#include "../vpatterndb/vpatternpiecedata.h"
#include "../vpatterndb/vpatterninfogeometry.h"
#include "../vpatterndb/vgrainlinegeometry.h"
#include "../vtools/tools/vabstracttool.h"
#include <QFileDialog>
#include <QFileInfo>
@ -475,7 +476,9 @@ void MainWindowsNoGUI::PrepareDetailsForLayout(const QHash<quint32, VPiece> *det
QHash<quint32, VPiece>::const_iterator i = details->constBegin();
while (i != details->constEnd())
{
listDetails.append(VLayoutPiece::Create(i.value(), pattern));
VAbstractTool *tool = qobject_cast<VAbstractTool*>(doc->getTool(i.key()));
SCASSERT(tool != nullptr)
listDetails.append(VLayoutPiece::Create(i.value(), tool->getData()));
++i;
}
}

View File

@ -140,7 +140,7 @@ VToolSeamAllowance *VToolSeamAllowance::Create(quint32 id, VPiece newPiece, QStr
doc->AddTool(id, piece);
}
//Very important to delete it. Only this tool need this special variable.
data->RemoveVariable(currentLength);
data->RemoveVariable(currentSeamAllowance);
return piece;
}