For avoiding errors in future better seek the first tag draw and insert before
it. --HG-- branch : develop
This commit is contained in:
parent
d0bdd46d77
commit
c3db8bab68
|
@ -62,17 +62,17 @@ void DeletePatternPiece::undo()
|
||||||
rootElement.insertAfter(patternPiece, previousPP);
|
rootElement.insertAfter(patternPiece, previousPP);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{ // first in the list, add after tag increments
|
{ // first in the list, add before tag draw
|
||||||
const QDomNodeList list = rootElement.elementsByTagName(VAbstractPattern::TagIncrements);
|
const QDomNodeList list = rootElement.elementsByTagName(VAbstractPattern::TagDraw);
|
||||||
QDomElement increment;
|
QDomElement draw;
|
||||||
|
|
||||||
if (not list.isEmpty())
|
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");
|
Q_ASSERT_X(not draw.isNull(), Q_FUNC_INFO, "Couldn't' find tag draw");
|
||||||
rootElement.insertAfter(patternPiece, increment);
|
rootElement.insertBefore(patternPiece, draw);
|
||||||
}
|
}
|
||||||
|
|
||||||
emit NeedFullParsing();
|
emit NeedFullParsing();
|
||||||
|
|
Loading…
Reference in New Issue
Block a user