From 3e9f14e201944380006bb851d40f5cacb860678d Mon Sep 17 00:00:00 2001 From: MenTaLguY Date: Sun, 8 Jun 2008 19:44:26 +0000 Subject: plumb document references a little deeper in (bzr r5861) --- src/xml/repr-css.cpp | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'src/xml/repr-css.cpp') diff --git a/src/xml/repr-css.cpp b/src/xml/repr-css.cpp index 888250c40..be125f453 100644 --- a/src/xml/repr-css.cpp +++ b/src/xml/repr-css.cpp @@ -8,6 +8,7 @@ #include #include "xml/repr.h" +#include "xml/simple-document.h" #include "xml/simple-node.h" #include "style.h" #include "libcroco/cr-sel-eng.h" @@ -21,20 +22,28 @@ using Inkscape::XML::Document; struct SPCSSAttrImpl : public SimpleNode, public SPCSSAttr { public: - SPCSSAttrImpl() : SimpleNode(g_quark_from_static_string("css")) {} + SPCSSAttrImpl(Document *doc) + : SimpleNode(g_quark_from_static_string("css"), doc) {} + SPCSSAttrImpl(SPCSSAttrImpl const &other, Document *doc) + : SimpleNode(other, doc) {} NodeType type() const { return Inkscape::XML::ELEMENT_NODE; } protected: - SimpleNode *_duplicate(Document* /*doc*/) const { return new SPCSSAttrImpl(*this); } + SimpleNode *_duplicate(Document* doc) const { return new SPCSSAttrImpl(*this, doc); } }; static void sp_repr_css_add_components(SPCSSAttr *css, Node *repr, gchar const *attr); + SPCSSAttr * sp_repr_css_attr_new() { - return new SPCSSAttrImpl(); + static Inkscape::XML::Document *attr_doc=NULL; + if (!attr_doc) { + attr_doc = new Inkscape::XML::SimpleDocument(); + } + return new SPCSSAttrImpl(attr_doc); } void -- cgit v1.2.3