summaryrefslogtreecommitdiffstats
path: root/src/sp-object-repr.cpp
diff options
context:
space:
mode:
authorKrzysztof Kosi??ski <tweenk.pl@gmail.com>2010-04-04 23:26:13 +0000
committerKrzysztof KosiƄski <tweenk.pl@gmail.com>2010-04-04 23:26:13 +0000
commita03fbcd36d55eb8e79dd7fef5ee9d67365f471cf (patch)
tree9a28320c2d1b0fceaadf0a2cbbfcc6af9f611aa4 /src/sp-object-repr.cpp
parentCoords: fix initial cursor position in the text tool (diff)
downloadinkscape-a03fbcd36d55eb8e79dd7fef5ee9d67365f471cf.tar.gz
inkscape-a03fbcd36d55eb8e79dd7fef5ee9d67365f471cf.zip
Coords: fix guidelines
(bzr r9281.1.14)
Diffstat (limited to 'src/sp-object-repr.cpp')
-rw-r--r--src/sp-object-repr.cpp17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/sp-object-repr.cpp b/src/sp-object-repr.cpp
index 62143e3ab..e32819746 100644
--- a/src/sp-object-repr.cpp
+++ b/src/sp-object-repr.cpp
@@ -91,9 +91,9 @@ static unsigned const N_NAME_TYPES = SODIPODI_TYPE + 1;
static GType name_to_gtype(NameType name_type, gchar const *name);
/**
- * Construct an SPRoot and all its descendents from the given repr.
+ * Construct an SPRoot and all its descendents from the given XML representation.
*/
-SPObject *
+void
sp_object_repr_build_tree(SPDocument *document, Inkscape::XML::Node *repr)
{
g_assert(document != NULL);
@@ -103,13 +103,14 @@ sp_object_repr_build_tree(SPDocument *document, Inkscape::XML::Node *repr)
g_assert(name != NULL);
GType const type = name_to_gtype(REPR_NAME, name);
g_assert(g_type_is_a(type, SP_TYPE_ROOT));
- gpointer newobj = g_object_new(type, 0);
- g_assert(newobj != NULL);
- SPObject *const object = SP_OBJECT(newobj);
- g_assert(object != NULL);
- sp_object_invoke_build(object, document, repr, FALSE);
- return object;
+ // create and assign root
+ SPObject *root = SP_OBJECT(g_object_new(type, 0));
+ g_assert(root != NULL);
+ document->root = root;
+
+ // recursively create SP tree elements
+ sp_object_invoke_build(root, document, repr, FALSE);
}
GType