diff options
| author | Adrian Boguszewski <adrbogus1@student.pg.gda.pl> | 2016-07-13 11:36:19 +0000 |
|---|---|---|
| committer | Adrian Boguszewski <adrbogus1@student.pg.gda.pl> | 2016-07-13 11:36:19 +0000 |
| commit | d1947e768272c703674129d5c583204ff2b59251 (patch) | |
| tree | c1bf1563d0c0837cbab3733c18df0c7c82b18ff4 /src/file.cpp | |
| parent | Merged trunk (diff) | |
| download | inkscape-d1947e768272c703674129d5c583204ff2b59251.tar.gz inkscape-d1947e768272c703674129d5c583204ff2b59251.zip | |
Second part of new SPObject children list
(bzr r14954.1.19)
Diffstat (limited to 'src/file.cpp')
| -rw-r--r-- | src/file.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/file.cpp b/src/file.cpp index 650ce5d0f..11e5f0a42 100644 --- a/src/file.cpp +++ b/src/file.cpp @@ -1204,8 +1204,8 @@ file_import(SPDocument *in_doc, const Glib::ustring &uri, // Count the number of top-level items in the imported document. guint items_count = 0; - for ( SPObject *child = doc->getRoot()->firstChild(); child; child = child->getNext()) { - if (SP_IS_ITEM(child)) { + for (auto& child: doc->getRoot()->_children) { + if (SP_IS_ITEM(&child)) { items_count++; } } @@ -1234,9 +1234,9 @@ file_import(SPDocument *in_doc, const Glib::ustring &uri, // Construct a new object representing the imported image, // and insert it into the current document. SPObject *new_obj = NULL; - for ( SPObject *child = doc->getRoot()->firstChild(); child; child = child->getNext() ) { - if (SP_IS_ITEM(child)) { - Inkscape::XML::Node *newitem = child->getRepr()->duplicate(xml_in_doc); + for (auto& child: doc->getRoot()->_children) { + if (SP_IS_ITEM(&child)) { + Inkscape::XML::Node *newitem = child.getRepr()->duplicate(xml_in_doc); // convert layers to groups, and make sure they are unlocked // FIXME: add "preserve layers" mode where each layer from @@ -1249,10 +1249,10 @@ file_import(SPDocument *in_doc, const Glib::ustring &uri, } // don't lose top-level defs or style elements - else if (child->getRepr()->type() == Inkscape::XML::ELEMENT_NODE) { - const gchar *tag = child->getRepr()->name(); + else if (child.getRepr()->type() == Inkscape::XML::ELEMENT_NODE) { + const gchar *tag = child.getRepr()->name(); if (!strcmp(tag, "svg:style")) { - in_doc->getRoot()->appendChildRepr(child->getRepr()->duplicate(xml_in_doc)); + in_doc->getRoot()->appendChildRepr(child.getRepr()->duplicate(xml_in_doc)); } } } |
