56 #include <QDomNodeList>
59 #include "../ifc/xml/vabstractpattern.h"
60 #include "../vmisc/logging.h"
65 , draftBlockName(draftBlockName)
66 , draftBlock(QDomElement())
67 , previousDraftBlockName(QString())
73 const QDomElement previousDraftBlock = block.previousSibling().toElement();
87 qCDebug(vUndo,
"Undo.");
89 QDomElement rootElement =
doc->documentElement();
94 rootElement.insertAfter(
draftBlock, previousDraftBlock);
101 if (not list.isEmpty())
103 block = list.at(0).toElement();
106 Q_ASSERT_X(not block.isNull(), Q_FUNC_INFO,
"Couldn't' find tag draft block");
117 qCDebug(vUndo,
"Redo.");
119 QDomElement rootElement =
doc->documentElement();
DeleteDraftBlock(VAbstractPattern *doc, const QString &draftBlockName, QUndoCommand *parent=nullptr)
QString previousDraftBlockName
virtual ~DeleteDraftBlock() Q_DECL_OVERRIDE
virtual void undo() Q_DECL_OVERRIDE
virtual void redo() Q_DECL_OVERRIDE
QDomElement getDraftBlockElement(const QString &name)
static const QString TagDraftBlock
static const QString AttrName
void changeActiveDraftBlock(const QString &name, const Document &parse=Document::FullParse)
changeActiveDraftBlock set new active draft block name.
static QString GetParametrString(const QDomElement &domElement, const QString &name, const QString &defValue=QString())
Returns the string value of the given attribute. RENAME: see above.