diff options
| author | MenTaLguY <mental@rydia.net> | 2008-06-08 19:44:26 +0000 |
|---|---|---|
| committer | mental <mental@users.sourceforge.net> | 2008-06-08 19:44:26 +0000 |
| commit | 3e9f14e201944380006bb851d40f5cacb860678d (patch) | |
| tree | 05e1d487b101aead4e985c4187209cdff5bb041f /src/xml/repr-css.cpp | |
| parent | Add option to either suppress path flash for items with LPE (e.g., spiro spli... (diff) | |
| download | inkscape-3e9f14e201944380006bb851d40f5cacb860678d.tar.gz inkscape-3e9f14e201944380006bb851d40f5cacb860678d.zip | |
plumb document references a little deeper in
(bzr r5861)
Diffstat (limited to 'src/xml/repr-css.cpp')
| -rw-r--r-- | src/xml/repr-css.cpp | 15 |
1 files changed, 12 insertions, 3 deletions
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 <glibmm/ustring.h> #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 |
