diff options
| author | Jabier Arraiza Cenoz <jabier.arraiza@marker.es> | 2013-09-19 22:33:11 +0000 |
|---|---|---|
| committer | Jabiertxof <jtx@jtx.marker.es> | 2013-09-19 22:33:11 +0000 |
| commit | 4bda89e32e33c7bdff5d3ea3c1ceee1f806de9f7 (patch) | |
| tree | caeb924426bcc861badc6fa81318b67460b26d47 /src/sp-desc.cpp | |
| parent | Update to trunk (diff) | |
| parent | updates for cmake (diff) | |
| download | inkscape-4bda89e32e33c7bdff5d3ea3c1ceee1f806de9f7.tar.gz inkscape-4bda89e32e33c7bdff5d3ea3c1ceee1f806de9f7.zip | |
Update to trunk
(bzr r11950.1.141)
Diffstat (limited to 'src/sp-desc.cpp')
| -rw-r--r-- | src/sp-desc.cpp | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/src/sp-desc.cpp b/src/sp-desc.cpp index aec90714d..199ae0176 100644 --- a/src/sp-desc.cpp +++ b/src/sp-desc.cpp @@ -16,33 +16,31 @@ #include "sp-desc.h" #include "xml/repr.h" -static Inkscape::XML::Node *sp_desc_write(SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags); +#include "sp-factory.h" -G_DEFINE_TYPE(SPDesc, sp_desc, SP_TYPE_OBJECT); +namespace { + SPObject* createDesc() { + return new SPDesc(); + } -static void sp_desc_class_init(SPDescClass *klass) -{ - SPObjectClass *sp_object_class = reinterpret_cast<SPObjectClass *>(klass); + bool descRegistered = SPFactory::instance().registerObject("svg:desc", createDesc); +} - sp_object_class->write = sp_desc_write; +SPDesc::SPDesc() : SPObject() { } -static void sp_desc_init(SPDesc */*desc*/) -{ +SPDesc::~SPDesc() { } /** * Writes it's settings to an incoming repr object, if any. */ -static Inkscape::XML::Node *sp_desc_write(SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags) -{ +Inkscape::XML::Node* SPDesc::write(Inkscape::XML::Document* doc, Inkscape::XML::Node* repr, guint flags) { if (!repr) { - repr = object->getRepr()->duplicate(doc); + repr = this->getRepr()->duplicate(doc); } - if ((static_cast<SPObjectClass *>(sp_desc_parent_class))->write) { - (static_cast<SPObjectClass *>(sp_desc_parent_class))->write(object, doc, repr, flags); - } + SPObject::write(doc, repr, flags); return repr; } |
