summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMaximilian Albert <maximilian.albert@gmail.com>2008-03-29 22:17:45 +0000
committercilix42 <cilix42@users.sourceforge.net>2008-03-29 22:17:45 +0000
commit309a00bf6b8a0a7e74553f33b563bf03163af968 (patch)
tree62913a1ac7cfccb52398b0108497e3c5252e2c15 /src
parentnr_matrix_inverse is no more, removed test from nr-matrix-test.h (diff)
downloadinkscape-309a00bf6b8a0a7e74553f33b563bf03163af968.tar.gz
inkscape-309a00bf6b8a0a7e74553f33b563bf03163af968.zip
Fix passing wrong pointer type when using the tweak tool on 3D boxes
(bzr r5232)
Diffstat (limited to 'src')
-rw-r--r--src/box3d.cpp4
-rw-r--r--src/box3d.h2
-rw-r--r--src/path-chemistry.cpp2
-rw-r--r--src/sp-item-group.cpp13
4 files changed, 9 insertions, 12 deletions
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<SPBox3D *> 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;