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/xml/rebase-hrefs.h | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 src/xml/rebase-hrefs.h (limited to 'src/xml/rebase-hrefs.h') diff --git a/src/xml/rebase-hrefs.h b/src/xml/rebase-hrefs.h new file mode 100644 index 000000000..b4f288c4d --- /dev/null +++ b/src/xml/rebase-hrefs.h @@ -0,0 +1,36 @@ +#ifndef REBASE_HREFS_H_SEEN +#define REBASE_HREFS_H_SEEN + +#include +#include "util/list.h" +#include "xml/attribute-record.h" +struct SPDocument; + +namespace Inkscape { +namespace XML { + +gchar *calc_abs_doc_base(gchar const *doc_base); + +void rebase_hrefs(SPDocument *doc, gchar const *new_base, bool spns); + +Inkscape::Util::List rebase_href_attrs( + gchar const *old_abs_base, + gchar const *new_abs_base, + Inkscape::Util::List attributes); + +} +} + + +#endif /* !REBASE_HREFS_H_SEEN */ + +/* + Local Variables: + mode:c++ + c-file-style:"stroustrup" + c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +)) + indent-tabs-mode:nil + fill-column:99 + End: +*/ +// vi: set autoindent shiftwidth=4 tabstop=8 filetype=cpp expandtab softtabstop=4 encoding=utf-8 textwidth=99 : -- cgit v1.2.3