Code

Translations. French translation minor update.
[inkscape.git] / src / sp-object-repr.cpp
index e32819746f52cdb54dee18d6a1d6a0884151e8ff..475a57521c3780306c877c6cd5864733803a6150 100644 (file)
@@ -1,10 +1,9 @@
-#define __SP_OBJECT_REPR_C__
-
 /*
  * Object type dictionary and build frontend
  *
  * Authors:
  *   Lauris Kaplinski <lauris@kaplinski.com>
+ *   Abhishek Sharma
  *
  * Copyright (C) 1999-2003 Lauris Kaplinski
  *
@@ -91,9 +90,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 XML representation.
+ * Construct an SPRoot and all its descendents from the given repr.
  */
-void
+SPObject *
 sp_object_repr_build_tree(SPDocument *document, Inkscape::XML::Node *repr)
 {
     g_assert(document != NULL);
@@ -103,14 +102,13 @@ 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);
+    object->invoke_build(document, repr, FALSE);
 
-    // 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);
+    return object;
 }
 
 GType
@@ -291,4 +289,4 @@ sp_object_type_register(gchar const *name, GType const gtype)
   fill-column:99
   End:
 */
-// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :
+// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 :