From: mental Date: Mon, 26 Feb 2007 08:05:15 +0000 (+0000) Subject: get rid of sp_repr_document wrapper function X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=2058adcb4fb0c17cfd7da5fd75df71b550528691;p=inkscape.git get rid of sp_repr_document wrapper function --- diff --git a/src/extension/internal/svg.cpp b/src/extension/internal/svg.cpp index ab9c59830..5539e0358 100644 --- a/src/extension/internal/svg.cpp +++ b/src/extension/internal/svg.cpp @@ -214,7 +214,7 @@ Svg::save (Inkscape::Extension::Output *mod, SPDocument *doc, const gchar *uri) Inkscape::IO::fixupHrefs( doc, save_path, spns ); - gboolean const s = sp_repr_save_file (sp_repr_document (repr), uri, SP_SVG_NS_URI); + gboolean const s = sp_repr_save_file (repr->document(), uri, SP_SVG_NS_URI); if (s == FALSE) { throw Inkscape::Extension::Output::save_failed(); } diff --git a/src/inkscape.cpp b/src/inkscape.cpp index ac2a64ed7..016384274 100644 --- a/src/inkscape.cpp +++ b/src/inkscape.cpp @@ -452,7 +452,7 @@ inkscape_crash_handler (int signum) file = Inkscape::IO::fopen_utf8name(c, "w"); } if (file) { - sp_repr_save_stream (sp_repr_document (repr), file, SP_SVG_NS_URI); + sp_repr_save_stream (repr->document(), file, SP_SVG_NS_URI); savednames = g_slist_prepend (savednames, g_strdup (c)); fclose (file); } else { diff --git a/src/sp-image.cpp b/src/sp-image.cpp index 06371f232..5f8b15718 100644 --- a/src/sp-image.cpp +++ b/src/sp-image.cpp @@ -1053,7 +1053,7 @@ sp_image_repr_read_image (Inkscape::XML::Node * repr) if (pixbuf != NULL) return pixbuf; } else if (!g_path_is_absolute (filename)) { /* try to load from relative pos */ - docbase = sp_repr_document_root (sp_repr_document (repr))->attribute("sodipodi:docbase"); + docbase = sp_repr_document_root (repr->document()->attribute("sodipodi:docbase"); if (!docbase) docbase = "."; fullname = g_build_filename(docbase, filename, NULL); pixbuf = Inkscape::IO::pixbuf_new_from_file( fullname, NULL ); diff --git a/src/xml/repr.h b/src/xml/repr.h index 1b2cad756..1f7f68bf1 100644 --- a/src/xml/repr.h +++ b/src/xml/repr.h @@ -143,12 +143,6 @@ inline Inkscape::XML::Node *sp_repr_document_root(Inkscape::XML::Document const return const_cast(doc->root()); } -/// Returns the node's document. -inline Inkscape::XML::Document *sp_repr_document(Inkscape::XML::Node const *repr) { - if (!repr) return NULL; - return const_cast(repr->document()); -} - /* Contents */ /// Sets the node's \a key attribute to \a value. inline unsigned sp_repr_set_attr(Inkscape::XML::Node *repr, gchar const *key, gchar const *value,