diff options
| author | Patrick Storz <eduard.braun2@gmx.de> | 2019-09-01 19:49:18 +0000 |
|---|---|---|
| committer | Patrick Storz <eduard.braun2@gmx.de> | 2019-09-01 19:50:16 +0000 |
| commit | 5e8e0a6bdd15427faa16d6432b9fbd7bbe0d6335 (patch) | |
| tree | 37dfb161397255903dd32fe27302fb308e5b9d4a /src/io/file.cpp | |
| parent | Add 'vector-effect' to CSS and attribute lists. (diff) | |
| parent | Update internal extensions for latest .inx format changes (diff) | |
| download | inkscape-5e8e0a6bdd15427faa16d6432b9fbd7bbe0d6335.tar.gz inkscape-5e8e0a6bdd15427faa16d6432b9fbd7bbe0d6335.zip | |
Extension updates for 1.0 (!808)
Diffstat (limited to 'src/io/file.cpp')
| -rw-r--r-- | src/io/file.cpp | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/src/io/file.cpp b/src/io/file.cpp index a87453d47..6317622bb 100644 --- a/src/io/file.cpp +++ b/src/io/file.cpp @@ -8,11 +8,11 @@ * */ +#include "file.h" + #include <iostream> #include <gtkmm.h> -#include "file.h" - #include "document.h" #include "document-undo.h" @@ -24,6 +24,9 @@ #include "object/sp-root.h" +#include "xml/repr.h" + + /** * Create a blank document, remove any template data. * Input: Empty string or template file name. @@ -36,7 +39,15 @@ ink_file_new(const std::string &Template) if (doc) { // Remove all the template info from xml tree Inkscape::XML::Node *myRoot = doc->getReprRoot(); - Inkscape::XML::Node *nodeToRemove = sp_repr_lookup_name(myRoot, "inkscape:_templateinfo"); + Inkscape::XML::Node *nodeToRemove; + + nodeToRemove = sp_repr_lookup_name(myRoot, "inkscape:templateinfo"); + if (nodeToRemove != nullptr) { + Inkscape::DocumentUndo::ScopedInsensitive no_undo(doc); + sp_repr_unparent(nodeToRemove); + delete nodeToRemove; + } + nodeToRemove = sp_repr_lookup_name(myRoot, "inkscape:_templateinfo"); // backwards-compatibility if (nodeToRemove != nullptr) { Inkscape::DocumentUndo::ScopedInsensitive no_undo(doc); sp_repr_unparent(nodeToRemove); |
