From 8de8047c5e30af8598646d7a66c62dbf290f7c51 Mon Sep 17 00:00:00 2001 From: Markus Engel Date: Wed, 10 Apr 2013 16:10:04 +0200 Subject: Removed old SPObject factory. (bzr r11608.1.91) --- src/document.cpp | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'src/document.cpp') diff --git a/src/document.cpp b/src/document.cpp index 706710cfc..0a8b2e674 100644 --- a/src/document.cpp +++ b/src/document.cpp @@ -58,9 +58,9 @@ #include "preferences.h" #include "profile-manager.h" #include "rdf.h" +#include "sp-factory.h" #include "sp-item-group.h" #include "sp-namedview.h" -#include "sp-object-repr.h" #include "sp-symbol.h" #include "transf_mat_3x4.h" #include "unit-constants.h" @@ -348,7 +348,20 @@ SPDocument *SPDocument::createDoc(Inkscape::XML::Document *rdoc, } document->name = g_strdup(name); - document->root = sp_object_repr_build_tree(document, rroot); + // Create SPRoot element + SPObject* rootObj = SPFactory::instance().createObject(*rroot); + document->root = dynamic_cast(rootObj); + + if (document->root == nullptr) { + // Node is not a valid root element + delete rootObj; + + // fixme: what to do here? + throw; + } + + // Recursively build object tree + document->root->invoke_build(document, rroot, false); /* fixme: Not sure about this, but lets assume ::build updates */ rroot->setAttribute("inkscape:version", Inkscape::version_string); -- cgit v1.2.3