From c3db8bab68449460c236bfa973795cf6c1bc7798 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Sat, 20 Feb 2016 10:05:18 +0200 Subject: [PATCH] For avoiding errors in future better seek the first tag draw and insert before it. --HG-- branch : develop --- src/libs/vtools/undocommands/deletepatternpiece.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/libs/vtools/undocommands/deletepatternpiece.cpp b/src/libs/vtools/undocommands/deletepatternpiece.cpp index f7e38a19e..e518cba28 100644 --- a/src/libs/vtools/undocommands/deletepatternpiece.cpp +++ b/src/libs/vtools/undocommands/deletepatternpiece.cpp @@ -62,17 +62,17 @@ void DeletePatternPiece::undo() rootElement.insertAfter(patternPiece, previousPP); } else - { // first in the list, add after tag increments - const QDomNodeList list = rootElement.elementsByTagName(VAbstractPattern::TagIncrements); - QDomElement increment; + { // first in the list, add before tag draw + const QDomNodeList list = rootElement.elementsByTagName(VAbstractPattern::TagDraw); + QDomElement draw; if (not list.isEmpty()) { - increment = list.at(0).toElement(); + draw = list.at(0).toElement(); } - Q_ASSERT_X(not increment.isNull(), Q_FUNC_INFO, "Couldn't' find tag Increments"); - rootElement.insertAfter(patternPiece, increment); + Q_ASSERT_X(not draw.isNull(), Q_FUNC_INFO, "Couldn't' find tag draw"); + rootElement.insertBefore(patternPiece, draw); } emit NeedFullParsing();