Fixed issue #492. Valentina crashes when add an increment.

--HG--
branch : release
This commit is contained in:
Roman Telezhynskyi 2016-05-23 21:13:30 +03:00
parent 643c60cc70
commit b3bef6655d
3 changed files with 7 additions and 0 deletions

View File

@ -3,6 +3,7 @@
- [#473] Tape 'Preferences' cause loss of focus.
- [#485] Error when drawing a curved path.
- [#491] Valentina doesn't update fractional separator.
- [#492] Valentina crashes when add an increment.
# Version 0.4.4 April 12, 2016
- Updated measurement templates with all measurements. Added new template Aldrich/Women measurements.

View File

@ -1004,6 +1004,9 @@ void TMainWindow::Fx()
if (dialog->exec() == QDialog::Accepted)
{
// Fix the bug #492. https://bitbucket.org/dismine/valentina/issues/492/valentina-crashes-when-add-an-increment
// Because of the bug need to take QTableWidgetItem twice time. Previous update "killed" the pointer.
const QTableWidgetItem *nameField = ui->tableWidget->item(row, ColumnName);
m->SetMValue(nameField->data(Qt::UserRole).toString(), dialog->GetFormula());
MeasurementsWasSaved(false);

View File

@ -704,6 +704,9 @@ void DialogIncrements::Fx()
if (dialog->exec() == QDialog::Accepted)
{
// Fix the bug #492. https://bitbucket.org/dismine/valentina/issues/492/valentina-crashes-when-add-an-increment
// Because of the bug need to take QTableWidgetItem twice time. Previous update "killed" the pointer.
const QTableWidgetItem *nameField = ui->tableWidgetIncrement->item(row, 0);
doc->SetIncrementFormula(nameField->text(), dialog->GetFormula());
FullUpdateTree(Document::LiteParse);
ui->tableWidgetIncrement->selectRow(row);