summaryrefslogtreecommitdiffstats
path: root/src/document.cpp
diff options
context:
space:
mode:
authorMatthew Petroff <matthew@mpetroff.net>2013-09-20 17:05:24 +0000
committerMatthew Petroff <matthew@mpetroff.net>2013-09-20 17:05:24 +0000
commit48b4ee48e518d65c3c5e49369a747c2aa4b0081b (patch)
tree7159f8bc67d3f96ae43c42c32cacec6f7813f6fa /src/document.cpp
parentFix bug in rectangle toolbar. (diff)
parentFix grids after C++ification. Patch from Markus Engel (diff)
downloadinkscape-48b4ee48e518d65c3c5e49369a747c2aa4b0081b.tar.gz
inkscape-48b4ee48e518d65c3c5e49369a747c2aa4b0081b.zip
Merge from trunk.
(bzr r12475.1.29)
Diffstat (limited to 'src/document.cpp')
-rw-r--r--src/document.cpp18
1 files changed, 16 insertions, 2 deletions
diff --git a/src/document.cpp b/src/document.cpp
index a544c60c9..967d049c2 100644
--- a/src/document.cpp
+++ b/src/document.cpp
@@ -57,9 +57,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 "util/units.h"
@@ -348,7 +348,21 @@ SPDocument *SPDocument::createDoc(Inkscape::XML::Document *rdoc,
}
document->name = g_strdup(name);
- document->root = sp_object_repr_build_tree(document, rroot);
+ // Create SPRoot element
+ const std::string typeString = NodeTraits::get_type_string(*rroot);
+ SPObject* rootObj = SPFactory::instance().createObject(typeString);
+ document->root = dynamic_cast<SPRoot*>(rootObj);
+
+ if (document->root == 0) {
+ // 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);