Code

A simple layout document as to what, why and how is cppification.
[inkscape.git] / src / xml / rebase-hrefs.cpp
index ec43bb178b99fc6f6cefb1f935fb794d4f67fadf..33978420c61b3afa0044995bcf9ff8d62576e46f 100644 (file)
@@ -201,6 +201,9 @@ Inkscape::XML::calc_abs_doc_base(gchar const *const doc_base)
  */
 void Inkscape::XML::rebase_hrefs(SPDocument *const doc, gchar const *const new_base, bool const spns)
 {
+    if (!doc->base)
+        return;
+
     gchar *const old_abs_base = calc_abs_doc_base(doc->base);
     gchar *const new_abs_base = calc_abs_doc_base(new_base);
 
@@ -224,7 +227,7 @@ void Inkscape::XML::rebase_hrefs(SPDocument *const doc, gchar const *const new_b
      *
      * Note also that Inkscape only supports fragment hrefs (href="#pattern257") for many of these
      * cases. */
-    GSList const *images = sp_document_get_resource_list(doc, "image");
+    GSList const *images = doc->get_resource_list("image");
     for (GSList const *l = images; l != NULL; l = l->next) {
         Inkscape::XML::Node *ir = SP_OBJECT_REPR(l->data);