summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 604bbc9)
raw | patch | inline | side by side (parent: 604bbc9)
author | pjrm <pjrm@users.sourceforge.net> | |
Tue, 7 Apr 2009 06:13:27 +0000 (06:13 +0000) | ||
committer | pjrm <pjrm@users.sourceforge.net> | |
Tue, 7 Apr 2009 06:13:27 +0000 (06:13 +0000) |
src/selection-chemistry.cpp | patch | blob | history |
index a57e5cfebd5a5d08f6a9edae863210e5d5c92bbd..8e9bf45da237b7354988c383af9d3aab54c5e9bf 100644 (file)
#include "svg/svg.h"
#include "desktop.h"
#include "desktop-style.h"
+#include "dir-util.h"
#include "selection.h"
#include "tools-switch.h"
#include "desktop-handles.h"
#include <libnr/nr-matrix-ops.h>
#include <2geom/transforms.h>
#include "xml/repr.h"
+#include "xml/rebase-hrefs.h"
#include "style.h"
#include "document-private.h"
#include "sp-gradient.h"
if (pb) {
// Create the repr for the image
Inkscape::XML::Node * repr = xml_doc->createElement("svg:image");
- repr->setAttribute("xlink:href", basename);
- repr->setAttribute("sodipodi:absref", filepath);
+ {
+ repr->setAttribute("sodipodi:absref", filepath);
+ gchar *abs_base = Inkscape::XML::calc_abs_doc_base(document->base);
+ repr->setAttribute("xlink:href", sp_relative_path_from_path(filepath, abs_base));
+ g_free(abs_base);
+ }
if (res == PX_PER_IN) { // for default 90 dpi, snap it to pixel grid
sp_repr_set_svg_double(repr, "width", width);
sp_repr_set_svg_double(repr, "height", height);