From c2d8810625892a8bedcaa192df9b4165e46609ee Mon Sep 17 00:00:00 2001 From: Peter Moulder Date: Tue, 7 Apr 2009 05:31:32 +0000 Subject: Move Inkscape::IO::fixupHrefs to Inkscape::XML::rebase_hrefs in new file xml/rebase-hrefs.*. Give it the old and new base directory, so that it can change hrefs without relying on sodipodi:absref. Also create a new function sp_repr_save_rebased_file that changes all xlink:href attributes as it writes them, so that we don't need to modify the owning document. (Especially useful for "Save a copy" or exporting.) extension/system.cpp: (Inkscape::Extension::save): Don't call sp_document_set_uri even temporarily other than at the same time as calling rebase_hrefs. (Otherwise, existing relative hrefs will point nowhere.) When exporting plain SVG, change the relative hrefs according to the destination filename. (bzr r7643) --- src/main.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/main.cpp') diff --git a/src/main.cpp b/src/main.cpp index db3255cad..05cfc8578 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -983,7 +983,8 @@ void sp_process_file_list(GSList *fl) rdoc = sp_repr_document_new("svg:svg"); repr = rdoc->root(); repr = sp_document_root(doc)->updateRepr(rdoc, repr, SP_OBJECT_WRITE_BUILD); - sp_repr_save_file(repr->document(), sp_export_svg, SP_SVG_NS_URI); + sp_repr_save_rebased_file(repr->document(), sp_export_svg, SP_SVG_NS_URI, + doc->base, sp_export_svg); } if (sp_export_ps) { do_export_ps_pdf(doc, sp_export_ps, "image/x-postscript"); -- cgit v1.2.3