Code

use object's document
authormental <mental@users.sourceforge.net>
Wed, 11 Jun 2008 15:54:55 +0000 (15:54 +0000)
committermental <mental@users.sourceforge.net>
Wed, 11 Jun 2008 15:54:55 +0000 (15:54 +0000)
src/box3d.cpp

index d7ec7ef073c0de72cd06bda12f65697b3a5d1f5e..db06359ecf92dbea9e4cc258f0a73e95c7dfc68d 100644 (file)
@@ -273,19 +273,17 @@ static Inkscape::XML::Node *box3d_write(SPObject *object, Inkscape::XML::Node *r
             repr->setAttribute("inkscape:perspectiveID", box->persp_href);
         } else {
             /* box is not yet linked to a perspective; use the document's current perspective */
-            SPDocument *doc = inkscape_active_document();
+            SPDocument *doc = SP_OBJECT_DOCUMENT(object);
             if (box->persp_ref->getURI()) {
                 gchar *uri_string = box->persp_ref->getURI()->toString();
                 repr->setAttribute("inkscape:perspectiveID", uri_string);
                 g_free(uri_string);
-            } else if (doc) {
+            } else {
                 Inkscape::XML::Node *persp_repr = SP_OBJECT_REPR(doc->current_persp3d);
                 const gchar *persp_id = persp_repr->attribute("id");
                 gchar *href = g_strdup_printf("#%s", persp_id);
                 repr->setAttribute("inkscape:perspectiveID", href);
                 g_free(href);
-            } else {
-                g_print ("No active document while creating perspective!!!\n");
             }
         }