Code

Added code to initialize DBus (if enabled.)
[inkscape.git] / src / extension / system.cpp
index 37b70fec8325269104d58eb95541f77fa40b5b22..a7828d3fc115e0bcb291b6e2fea29603c46b68d7 100644 (file)
@@ -93,7 +93,7 @@ open(Extension *key, gchar const *filename)
 
     SPDocument *doc = imod->open(filename);
     if (!doc) {
-        return NULL;
+        throw Input::open_failed();
     }
 
     if (last_chance_svg) {
@@ -257,14 +257,7 @@ save(Extension *key, SPDocument *doc, gchar const *filename, bool setextension,
         saved_dataloss = g_strdup(repr->attribute("inkscape:dataloss"));
     } else {
         /* The document is changing name/uri. */
-
-        /* TODO: Don't treat URIs and filenames interchangeably.
-         * So call g_filename_to_uri when passing to sp_document_set_uri,
-         * and change rebase_hrefs to accept a base URI/LEIRI instead of dir name. */
-        gchar *const new_base = g_path_get_dirname(fileName);
-        Inkscape::XML::rebase_hrefs(doc, new_base, true);
-        sp_document_set_uri(doc, fileName);
-        g_free(new_base);
+        sp_document_change_uri_and_hrefs(doc, fileName);
     }
 
     // Update attributes: