diff options
| author | Maximilian Albert <maximilian.albert@gmail.com> | 2009-08-06 14:17:17 +0000 |
|---|---|---|
| committer | cilix42 <cilix42@users.sourceforge.net> | 2009-08-06 14:17:17 +0000 |
| commit | 51c2905fd3e99955db2d823b79abb763d8097028 (patch) | |
| tree | 90128509479f5498e1125d1e4eb9cdc05bf6b6e6 /src/xml | |
| parent | Adding one more control to Smart Jelly (diff) | |
| download | inkscape-51c2905fd3e99955db2d823b79abb763d8097028.tar.gz inkscape-51c2905fd3e99955db2d823b79abb763d8097028.zip | |
Revert recent refactoring changes by johnce because they break the build, which cannot be fixed easily.
(bzr r8422)
Diffstat (limited to 'src/xml')
| -rw-r--r-- | src/xml/document.h | 6 | ||||
| -rw-r--r-- | src/xml/node.h | 2 | ||||
| -rw-r--r-- | src/xml/rebase-hrefs.cpp | 8 | ||||
| -rw-r--r-- | src/xml/rebase-hrefs.h | 5 | ||||
| -rw-r--r-- | src/xml/repr-css.cpp | 10 | ||||
| -rw-r--r-- | src/xml/repr.h | 2 | ||||
| -rw-r--r-- | src/xml/xml-forward.h | 2 |
7 files changed, 16 insertions, 19 deletions
diff --git a/src/xml/document.h b/src/xml/document.h index a5f457fe8..2b9ea5cc3 100644 --- a/src/xml/document.h +++ b/src/xml/document.h @@ -12,8 +12,8 @@ * */ -#ifndef SEEN_INKSCAPE_XML_SP_REPR_DOCTREE_H -#define SEEN_INKSCAPE_XML_SP_REPR_DOCTREE_H +#ifndef SEEN_INKSCAPE_XML_SP_REPR_DOC_H +#define SEEN_INKSCAPE_XML_SP_REPR_DOC_H #include "xml/xml-forward.h" #include "xml/node.h" @@ -41,7 +41,7 @@ namespace XML { * "restore point" by calling beginTransaction() again. There can be only one active * transaction at a time for a given document. */ -class DocumentTree : virtual public Node { +struct Document : virtual public Node { public: /** * @name Document transactions diff --git a/src/xml/node.h b/src/xml/node.h index 38f006d5c..abcccdb9a 100644 --- a/src/xml/node.h +++ b/src/xml/node.h @@ -80,8 +80,6 @@ public: * @{ */ - - /** * @brief Get the type of the node * @return NodeType enumeration member corresponding to the type of the node. 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); diff --git a/src/xml/rebase-hrefs.h b/src/xml/rebase-hrefs.h index 36de6ba6e..b4f288c4d 100644 --- a/src/xml/rebase-hrefs.h +++ b/src/xml/rebase-hrefs.h @@ -4,15 +4,14 @@ #include <glib/gtypes.h> #include "util/list.h" #include "xml/attribute-record.h" -#include "document.h" +struct SPDocument; namespace Inkscape { namespace XML { -//struct Document; gchar *calc_abs_doc_base(gchar const *doc_base); -void rebase_hrefs(Inkscape::XML::Document *doc, gchar const *new_base, bool spns); +void rebase_hrefs(SPDocument *doc, gchar const *new_base, bool spns); Inkscape::Util::List<AttributeRecord const> rebase_href_attrs( gchar const *old_abs_base, diff --git a/src/xml/repr-css.cpp b/src/xml/repr-css.cpp index a7e913853..be125f453 100644 --- a/src/xml/repr-css.cpp +++ b/src/xml/repr-css.cpp @@ -18,19 +18,19 @@ using Inkscape::XML::AttributeRecord; using Inkscape::XML::SimpleNode; using Inkscape::XML::Node; using Inkscape::XML::NodeType; -//using Inkscape::XML::Document; +using Inkscape::XML::Document; struct SPCSSAttrImpl : public SimpleNode, public SPCSSAttr { public: - SPCSSAttrImpl(Inkscape::XML::Document *doc) + SPCSSAttrImpl(Document *doc) : SimpleNode(g_quark_from_static_string("css"), doc) {} - SPCSSAttrImpl(SPCSSAttrImpl const &other, Inkscape::XML::Document *doc) - : SimpleNode(other, (Inkscape::XML::Document *)doc) {} + SPCSSAttrImpl(SPCSSAttrImpl const &other, Document *doc) + : SimpleNode(other, doc) {} NodeType type() const { return Inkscape::XML::ELEMENT_NODE; } protected: - SimpleNode *_duplicate(Inkscape::XML::Document* doc) const { return new SPCSSAttrImpl(*this, (Inkscape::XML::Document *)doc); } + SimpleNode *_duplicate(Document* doc) const { return new SPCSSAttrImpl(*this, doc); } }; static void sp_repr_css_add_components(SPCSSAttr *css, Node *repr, gchar const *attr); diff --git a/src/xml/repr.h b/src/xml/repr.h index b40fe63a9..549822e4e 100644 --- a/src/xml/repr.h +++ b/src/xml/repr.h @@ -148,7 +148,7 @@ Inkscape::XML::Node *sp_repr_lookup_child(Inkscape::XML::Node *repr, gchar const *value); -inline Inkscape::XML::Node *sp_repr_document_first_child(Inkscape::XML::DocumentTree const *doc) { +inline Inkscape::XML::Node *sp_repr_document_first_child(Inkscape::XML::Document const *doc) { return const_cast<Inkscape::XML::Node *>(doc->firstChild()); } diff --git a/src/xml/xml-forward.h b/src/xml/xml-forward.h index e3ebad183..33218c8ae 100644 --- a/src/xml/xml-forward.h +++ b/src/xml/xml-forward.h @@ -20,7 +20,7 @@ namespace XML { struct AttributeRecord; struct CommentNode; class CompositeNodeObserver; -class Document; +struct Document; class ElementNode; class Event; class EventAdd; |
