summaryrefslogtreecommitdiffstats
path: root/src/document.cpp
diff options
context:
space:
mode:
authorMarkus Engel <markus.engel@tum.de>2013-04-10 14:10:04 +0000
committerMarkus Engel <markus.engel@tum.de>2013-04-10 14:10:04 +0000
commit8de8047c5e30af8598646d7a66c62dbf290f7c51 (patch)
tree86d7a26167981fe33697e490a5dd432bb0d4bebd /src/document.cpp
parentAdded constructors to EventContext tree / some missing virtual pads. (diff)
downloadinkscape-8de8047c5e30af8598646d7a66c62dbf290f7c51.tar.gz
inkscape-8de8047c5e30af8598646d7a66c62dbf290f7c51.zip
Removed old SPObject factory.
(bzr r11608.1.91)
Diffstat (limited to 'src/document.cpp')
-rw-r--r--src/document.cpp17
1 files changed, 15 insertions, 2 deletions
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<SPRoot*>(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);