From: theadib Date: Tue, 5 May 2009 23:19:43 +0000 (+0000) Subject: using uri syntax while importing files using xlink:href X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=f93a8ec1f26ca809f77308c8c057ee6417b8a245;p=inkscape.git using uri syntax while importing files using xlink:href --- diff --git a/src/extension/internal/gdkpixbuf-input.cpp b/src/extension/internal/gdkpixbuf-input.cpp index 773913ffc..0acf1648c 100644 --- a/src/extension/internal/gdkpixbuf-input.cpp +++ b/src/extension/internal/gdkpixbuf-input.cpp @@ -55,7 +55,14 @@ GdkpixbufInput::open(Inkscape::Extension::Input */*mod*/, char const *uri) // import as repr = xml_doc->createElement("svg:image"); - repr->setAttribute("xlink:href", uri); + // convert filename to uri + gchar* _uri = g_filename_to_uri(uri, NULL, NULL); + if(_uri) { + repr->setAttribute("xlink:href", _uri); + g_free(_uri); + } else { + repr->setAttribute("xlink:href", uri); + } /* impl: doc->base is currently NULL, so we can use uri for href whether it's absolute * or relative. The href will get rewritten by rebase_hrefs if by chance uri is relative * and doc gets saved to a different directory.