diff options
| author | Marc Jeanmougin <marc@jeanmougin.fr> | 2015-05-08 13:46:25 +0000 |
|---|---|---|
| committer | Marc Jeanmougin <marcjeanmougin@free.fr> | 2015-05-08 13:46:25 +0000 |
| commit | 48e0423afcb02fe4a0f705d828a0dbdb3106b397 (patch) | |
| tree | fe90975cd27d20532e0716290fe6149c801f4a5c /src/extension/implementation/script.cpp | |
| parent | forgotten dynamic cast (diff) | |
| download | inkscape-48e0423afcb02fe4a0f705d828a0dbdb3106b397.tar.gz inkscape-48e0423afcb02fe4a0f705d828a0dbdb3106b397.zip | |
fixes a few of jenkins warnings
(bzr r14126)
Diffstat (limited to '')
| -rw-r--r-- | src/extension/implementation/script.cpp | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/src/extension/implementation/script.cpp b/src/extension/implementation/script.cpp index 5cab3a2b2..e07a3963c 100644 --- a/src/extension/implementation/script.cpp +++ b/src/extension/implementation/script.cpp @@ -812,6 +812,12 @@ void Script::copy_doc (Inkscape::XML::Node * oldroot, Inkscape::XML::Node * newr } } + if(!oldroot_namedview) + { + g_warning("Error on copy_doc: No namedview on destination document."); + return; + } + // Unparent (delete) for (unsigned int i = 0; i < delete_list.size(); i++) { sp_repr_unparent(delete_list[i]); @@ -823,12 +829,10 @@ void Script::copy_doc (Inkscape::XML::Node * oldroot, Inkscape::XML::Node * newr child = child->next()) { if (!strcmp("sodipodi:namedview", child->name())) { newroot_namedview = child; - if (oldroot_namedview != NULL) { - for (Inkscape::XML::Node * newroot_namedview_child = child->firstChild(); - newroot_namedview_child != NULL; - newroot_namedview_child = newroot_namedview_child->next()) { - oldroot_namedview->appendChild(newroot_namedview_child->duplicate(oldroot->document())); - } + for (Inkscape::XML::Node * newroot_namedview_child = child->firstChild(); + newroot_namedview_child != NULL; + newroot_namedview_child = newroot_namedview_child->next()) { + oldroot_namedview->appendChild(newroot_namedview_child->duplicate(oldroot->document())); } } else { oldroot->appendChild(child->duplicate(oldroot->document())); |
