From ce2389867e8ebb79d2884a481c61f1ffe3144dd4 Mon Sep 17 00:00:00 2001 From: mental Date: Wed, 11 Jun 2008 15:54:55 +0000 Subject: [PATCH] use object's document --- src/box3d.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/box3d.cpp b/src/box3d.cpp index d7ec7ef07..db06359ec 100644 --- a/src/box3d.cpp +++ b/src/box3d.cpp @@ -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"); } } -- 2.30.2