summaryrefslogtreecommitdiffstats
path: root/src/xml/rebase-hrefs.h
diff options
context:
space:
mode:
authorPeter Moulder <peter.moulder@monash.edu>2009-04-07 05:31:32 +0000
committerpjrm <pjrm@users.sourceforge.net>2009-04-07 05:31:32 +0000
commitc2d8810625892a8bedcaa192df9b4165e46609ee (patch)
tree86bf3792eb9043b59435c17ae9415138d2e81a21 /src/xml/rebase-hrefs.h
parentfunctional noop: Clarify g_strcanon behaviour by not redundantly reassigning ... (diff)
downloadinkscape-c2d8810625892a8bedcaa192df9b4165e46609ee.tar.gz
inkscape-c2d8810625892a8bedcaa192df9b4165e46609ee.zip
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)
Diffstat (limited to 'src/xml/rebase-hrefs.h')
-rw-r--r--src/xml/rebase-hrefs.h36
1 files changed, 36 insertions, 0 deletions
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 <glib/gtypes.h>
+#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<AttributeRecord const> rebase_href_attrs(
+ gchar const *old_abs_base,
+ gchar const *new_abs_base,
+ Inkscape::Util::List<AttributeRecord const> 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 :