From a6fa3b454bdcef9b23e0a3107b6de6b4c6a477a0 Mon Sep 17 00:00:00 2001 From: johnce Date: Wed, 5 Aug 2009 05:56:35 +0000 Subject: SPDocument->Document (bzr r8405) --- src/xml/rebase-hrefs.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/xml/rebase-hrefs.cpp') diff --git a/src/xml/rebase-hrefs.cpp b/src/xml/rebase-hrefs.cpp index ec43bb178..8d771fef2 100644 --- a/src/xml/rebase-hrefs.cpp +++ b/src/xml/rebase-hrefs.cpp @@ -199,7 +199,7 @@ Inkscape::XML::calc_abs_doc_base(gchar const *const doc_base) * * \param spns True iff doc should contain sodipodi:absref attributes. */ -void Inkscape::XML::rebase_hrefs(SPDocument *const doc, gchar const *const new_base, bool const spns) +void Inkscape::XML::rebase_hrefs(Document *const doc, gchar const *const new_base, bool const spns) { gchar *const old_abs_base = calc_abs_doc_base(doc->base); gchar *const new_abs_base = calc_abs_doc_base(new_base); -- cgit v1.2.3 From e8b5612f8dbe3cefaf56469320fa12bea9713a1b Mon Sep 17 00:00:00 2001 From: johnce Date: Wed, 5 Aug 2009 18:32:38 +0000 Subject: xml/Document -> DocumentTree (bzr r8417) --- src/xml/rebase-hrefs.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/xml/rebase-hrefs.cpp') diff --git a/src/xml/rebase-hrefs.cpp b/src/xml/rebase-hrefs.cpp index 8d771fef2..0fa5c0337 100644 --- a/src/xml/rebase-hrefs.cpp +++ b/src/xml/rebase-hrefs.cpp @@ -1,6 +1,6 @@ #include "xml/rebase-hrefs.h" #include "dir-util.h" -#include "../document.h" /* Unfortunately there's a separate xml/document.h. */ +#include "document.h" /* Unfortunately there's a separate xml/document.h. */ #include "io/sys.h" #include "sp-object.h" #include "streq.h" @@ -199,9 +199,9 @@ Inkscape::XML::calc_abs_doc_base(gchar const *const doc_base) * * \param spns True iff doc should contain sodipodi:absref attributes. */ -void Inkscape::XML::rebase_hrefs(Document *const doc, gchar const *const new_base, bool const spns) +void Inkscape::XML::rebase_hrefs(Inkscape::XML::Document *doc, gchar const *const new_base, bool const spns) { - gchar *const old_abs_base = calc_abs_doc_base(doc->base); + gchar *const old_abs_base = calc_abs_doc_base((Inkscape::XML::Document *)(doc)->base); gchar *const new_abs_base = calc_abs_doc_base(new_base); /* TODO: Should handle not just image but also: @@ -224,7 +224,7 @@ void Inkscape::XML::rebase_hrefs(Document *const doc, gchar const *const new_bas * * Note also that Inkscape only supports fragment hrefs (href="#pattern257") for many of these * cases. */ - GSList const *images = sp_document_get_resource_list(doc, "image"); + GSList const *images = sp_document_get_resource_list((Inkscape::XML::Document *)doc, "image"); for (GSList const *l = images; l != NULL; l = l->next) { Inkscape::XML::Node *ir = SP_OBJECT_REPR(l->data); -- cgit v1.2.3 From 51c2905fd3e99955db2d823b79abb763d8097028 Mon Sep 17 00:00:00 2001 From: Maximilian Albert Date: Thu, 6 Aug 2009 14:17:17 +0000 Subject: Revert recent refactoring changes by johnce because they break the build, which cannot be fixed easily. (bzr r8422) --- src/xml/rebase-hrefs.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/xml/rebase-hrefs.cpp') diff --git a/src/xml/rebase-hrefs.cpp b/src/xml/rebase-hrefs.cpp index 0fa5c0337..ec43bb178 100644 --- a/src/xml/rebase-hrefs.cpp +++ b/src/xml/rebase-hrefs.cpp @@ -1,6 +1,6 @@ #include "xml/rebase-hrefs.h" #include "dir-util.h" -#include "document.h" /* Unfortunately there's a separate xml/document.h. */ +#include "../document.h" /* Unfortunately there's a separate xml/document.h. */ #include "io/sys.h" #include "sp-object.h" #include "streq.h" @@ -199,9 +199,9 @@ Inkscape::XML::calc_abs_doc_base(gchar const *const doc_base) * * \param spns True iff doc should contain sodipodi:absref attributes. */ -void Inkscape::XML::rebase_hrefs(Inkscape::XML::Document *doc, gchar const *const new_base, bool const spns) +void Inkscape::XML::rebase_hrefs(SPDocument *const doc, gchar const *const new_base, bool const spns) { - gchar *const old_abs_base = calc_abs_doc_base((Inkscape::XML::Document *)(doc)->base); + gchar *const old_abs_base = calc_abs_doc_base(doc->base); gchar *const new_abs_base = calc_abs_doc_base(new_base); /* TODO: Should handle not just image but also: @@ -224,7 +224,7 @@ void Inkscape::XML::rebase_hrefs(Inkscape::XML::Document *doc, gchar const *cons * * Note also that Inkscape only supports fragment hrefs (href="#pattern257") for many of these * cases. */ - GSList const *images = sp_document_get_resource_list((Inkscape::XML::Document *)doc, "image"); + GSList const *images = sp_document_get_resource_list(doc, "image"); for (GSList const *l = images; l != NULL; l = l->next) { Inkscape::XML::Node *ir = SP_OBJECT_REPR(l->data); -- cgit v1.2.3 From d8f681faf74d46b77fed976d16c52ac7404517d1 Mon Sep 17 00:00:00 2001 From: bulia byak Date: Sun, 23 Aug 2009 01:40:44 +0000 Subject: patch from 416549 (bzr r8522) --- src/xml/rebase-hrefs.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/xml/rebase-hrefs.cpp') diff --git a/src/xml/rebase-hrefs.cpp b/src/xml/rebase-hrefs.cpp index ec43bb178..c3876725d 100644 --- a/src/xml/rebase-hrefs.cpp +++ b/src/xml/rebase-hrefs.cpp @@ -201,6 +201,9 @@ Inkscape::XML::calc_abs_doc_base(gchar const *const doc_base) */ void Inkscape::XML::rebase_hrefs(SPDocument *const doc, gchar const *const new_base, bool const spns) { + if (!doc->base) + return; + gchar *const old_abs_base = calc_abs_doc_base(doc->base); gchar *const new_abs_base = calc_abs_doc_base(new_base); -- cgit v1.2.3