Fix regression. Impossible to create new pattern piece.

--HG--
branch : develop
This commit is contained in:
Roman Telezhynskyi 2019-01-22 18:56:04 +02:00
parent 86ec5e7254
commit 8a4d915e36

View File

@ -2013,12 +2013,11 @@ void MainWindow::ToolBarDraws()
{ {
const QString activDraw = doc->GetNameActivPP(); const QString activDraw = doc->GetNameActivPP();
const QString nameDraw = PatternPieceName(activDraw); const QString nameDraw = PatternPieceName(activDraw);
if (nameDraw.isEmpty()) if (nameDraw.isEmpty() || activDraw == nameDraw)
{ {
return; return;
} }
RenamePP *renamePP = new RenamePP(doc, nameDraw, comboBoxDraws); qApp->getUndoStack()->push(new RenamePP(doc, nameDraw, comboBoxDraws));
qApp->getUndoStack()->push(renamePP);
}); });
} }
@ -4488,7 +4487,7 @@ QString MainWindow::PatternPieceName(const QString &text)
nameDraw = dlg->textValue(); nameDraw = dlg->textValue();
if (bOk == false || nameDraw.isEmpty() || text == nameDraw) if (bOk == false || nameDraw.isEmpty() || text == nameDraw)
{ {
return QString(); return text;
} }
if (comboBoxDraws->findText(nameDraw) == -1) if (comboBoxDraws->findText(nameDraw) == -1)