From 8a4d915e364626fa7ab997bcb1b7db14931ae7a8 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Tue, 22 Jan 2019 18:56:04 +0200 Subject: [PATCH] Fix regression. Impossible to create new pattern piece. --HG-- branch : develop --- src/app/valentina/mainwindow.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/app/valentina/mainwindow.cpp b/src/app/valentina/mainwindow.cpp index b4a355282..aa48ac67e 100644 --- a/src/app/valentina/mainwindow.cpp +++ b/src/app/valentina/mainwindow.cpp @@ -2013,12 +2013,11 @@ void MainWindow::ToolBarDraws() { const QString activDraw = doc->GetNameActivPP(); const QString nameDraw = PatternPieceName(activDraw); - if (nameDraw.isEmpty()) + if (nameDraw.isEmpty() || activDraw == nameDraw) { return; } - RenamePP *renamePP = new RenamePP(doc, nameDraw, comboBoxDraws); - qApp->getUndoStack()->push(renamePP); + qApp->getUndoStack()->push(new RenamePP(doc, nameDraw, comboBoxDraws)); }); } @@ -4488,7 +4487,7 @@ QString MainWindow::PatternPieceName(const QString &text) nameDraw = dlg->textValue(); if (bOk == false || nameDraw.isEmpty() || text == nameDraw) { - return QString(); + return text; } if (comboBoxDraws->findText(nameDraw) == -1)