From: cilix42 Date: Sat, 29 Mar 2008 22:17:45 +0000 (+0000) Subject: Fix passing wrong pointer type when using the tweak tool on 3D boxes X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=5b8ee3df72dcac734e27c5f44c5060b5df2adfbd;p=inkscape.git Fix passing wrong pointer type when using the tweak tool on 3D boxes --- diff --git a/src/box3d.cpp b/src/box3d.cpp index f57452101..d7ec7ef07 100644 --- a/src/box3d.cpp +++ b/src/box3d.cpp @@ -1361,7 +1361,7 @@ box3d_switch_perspectives(SPBox3D *box, Persp3D *old_persp, Persp3D *new_persp, /* Converts the 3D box to an ordinary SPGroup, adds it to the XML tree at the same position as the original box and deletes the latter */ -Inkscape::XML::Node * +SPGroup * box3d_convert_to_group(SPBox3D *box) { SPDocument *doc = SP_OBJECT_DOCUMENT(box); Inkscape::XML::Document *xml_doc = sp_document_repr_doc(doc); @@ -1403,7 +1403,7 @@ box3d_convert_to_group(SPBox3D *box) { grepr->setAttribute("id", id); - return grepr; + return SP_GROUP(doc->getObjectByRepr(grepr)); } static inline void diff --git a/src/box3d.h b/src/box3d.h index bc88e6257..953275679 100644 --- a/src/box3d.h +++ b/src/box3d.h @@ -79,7 +79,7 @@ std::list box3d_extract_boxes(SPObject *obj); Persp3D *box3d_get_perspective(SPBox3D const *box); void box3d_switch_perspectives(SPBox3D *box, Persp3D *old_persp, Persp3D *new_persp, bool recompute_corners = false); -Inkscape::XML::Node *box3d_convert_to_group(SPBox3D *box); +SPGroup *box3d_convert_to_group(SPBox3D *box); #endif /* __SP_BOX3D_H__ */ diff --git a/src/path-chemistry.cpp b/src/path-chemistry.cpp index cfdbc0b54..a08b6feb5 100644 --- a/src/path-chemistry.cpp +++ b/src/path-chemistry.cpp @@ -332,7 +332,7 @@ sp_item_list_to_curves(const GSList *items, GSList **selected, GSList **to_selec if (SP_IS_BOX3D(item)) { // convert 3D box to ordinary group of paths; replace the old element in 'selected' with the new group - Inkscape::XML::Node *repr = box3d_convert_to_group(SP_BOX3D(item)); + Inkscape::XML::Node *repr = SP_OBJECT_REPR(box3d_convert_to_group(SP_BOX3D(item))); if (repr) { *to_select = g_slist_prepend (*to_select, repr); diff --git a/src/sp-item-group.cpp b/src/sp-item-group.cpp index cd74f88b8..6ec5256ee 100644 --- a/src/sp-item-group.cpp +++ b/src/sp-item-group.cpp @@ -359,15 +359,12 @@ sp_item_group_ungroup (SPGroup *group, GSList **children, bool do_done) SPItem *pitem = SP_ITEM (SP_OBJECT_PARENT (gitem)); Inkscape::XML::Node *prepr = SP_OBJECT_REPR (pitem); - if (SP_IS_BOX3D(gitem)) { - grepr = box3d_convert_to_group(SP_BOX3D(gitem)); - if (grepr) { - gitem = SP_ITEM(doc->getObjectByRepr(grepr)); - group = SP_GROUP(gitem); - } - } + if (SP_IS_BOX3D(gitem)) { + group = box3d_convert_to_group(SP_BOX3D(gitem)); + gitem = SP_ITEM(group); + } - sp_lpe_item_remove_path_effect(SP_LPE_ITEM(group), false); + sp_lpe_item_remove_path_effect(SP_LPE_ITEM(group), false); /* Step 1 - generate lists of children objects */ GSList *items = NULL;