summaryrefslogtreecommitdiffstats
path: root/src/file.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/file.cpp')
-rw-r--r--src/file.cpp13
1 files changed, 5 insertions, 8 deletions
diff --git a/src/file.cpp b/src/file.cpp
index f9e259fe2..984bf7e08 100644
--- a/src/file.cpp
+++ b/src/file.cpp
@@ -769,7 +769,7 @@ file_save_remote(SPDocument */*doc*/,
return false;
}
- result = gnome_vfs_create (&to_handle, uri_local, GNOME_VFS_OPEN_WRITE, FALSE, GNOME_VFS_PERM_USER_ALL);
+ gnome_vfs_create (&to_handle, uri_local, GNOME_VFS_OPEN_WRITE, FALSE, GNOME_VFS_PERM_USER_ALL);
result = gnome_vfs_open (&to_handle, uri_local, GNOME_VFS_OPEN_WRITE);
if (result != GNOME_VFS_OK) {
@@ -782,8 +782,8 @@ file_save_remote(SPDocument */*doc*/,
result = gnome_vfs_read (from_handle, buffer, 8192, &bytes_read);
if ((result == GNOME_VFS_ERROR_EOF) &&(!bytes_read)){
- result = gnome_vfs_close (from_handle);
- result = gnome_vfs_close (to_handle);
+ gnome_vfs_close (from_handle);
+ gnome_vfs_close (to_handle);
return true;
}
@@ -1069,7 +1069,7 @@ void sp_import_document(SPDesktop *desktop, SPDocument *clipdoc, bool in_place)
desktop->doc()->importDefs(clipdoc);
// copy objects
- GSList *pasted_objects = NULL;
+ std::vector<Inkscape::XML::Node*> pasted_objects;
for (Inkscape::XML::Node *obj = root->firstChild() ; obj ; obj = obj->next()) {
// Don't copy metadata, defs, named views and internal clipboard contents to the document
if (!strcmp(obj->name(), "svg:defs")) {
@@ -1088,9 +1088,8 @@ void sp_import_document(SPDesktop *desktop, SPDocument *clipdoc, bool in_place)
target_parent->appendChild(obj_copy);
Inkscape::GC::release(obj_copy);
- pasted_objects = g_slist_prepend(pasted_objects, (gpointer) obj_copy);
+ pasted_objects.push_back(obj_copy);
}
-
// Change the selection to the freshly pasted objects
Inkscape::Selection *selection = desktop->getSelection();
selection->setReprList(pasted_objects);
@@ -1129,8 +1128,6 @@ void sp_import_document(SPDesktop *desktop, SPDocument *clipdoc, bool in_place)
sp_selection_move_relative(selection, offset);
}
-
- g_slist_free(pasted_objects);
}