From 197f66062c6d6cc77539117526a9ecc30449bd61 Mon Sep 17 00:00:00 2001 From: "Jon A. Cruz" Date: Thu, 16 Oct 2014 15:42:34 -0700 Subject: Removed dangerous GTK-mimicking macros. (bzr r13619) --- src/box3d.cpp | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) (limited to 'src/box3d.cpp') diff --git a/src/box3d.cpp b/src/box3d.cpp index eb82524dd..5f60766f4 100644 --- a/src/box3d.cpp +++ b/src/box3d.cpp @@ -6,6 +6,7 @@ * Lauris Kaplinski * bulia byak * Abhishek Sharma + * Jon A. Cruz * * Copyright (C) 2007 Authors * Copyright (C) 1999-2002 Lauris Kaplinski @@ -263,9 +264,10 @@ void box3d_position_set(SPBox3D *box) { /* This draws the curve and calls requestDisplayUpdate() for each side (the latter is done in box3d_side_position_set() to avoid update conflicts with the parent box) */ - for ( SPObject *child = box->firstChild(); child; child = child->getNext() ) { - if (SP_IS_BOX3D_SIDE(child)) { - box3d_side_position_set(SP_BOX3D_SIDE(child)); + for ( SPObject *obj = box->firstChild(); obj; obj = obj->getNext() ) { + Box3DSide *side = dynamic_cast(obj); + if (side) { + box3d_side_position_set(side); } } } @@ -1079,10 +1081,10 @@ box3d_recompute_z_orders (SPBox3D *box) { static std::map box3d_get_sides(SPBox3D *box) { std::map sides; - for ( SPObject *side = box->firstChild(); side; side = side->getNext() ) { - if (SP_IS_BOX3D_SIDE(side)){ - Box3DSide *bside = SP_BOX3D_SIDE(side); - sides[Box3D::face_to_int(bside->getFaceId())] = bside; + for ( SPObject *obj = box->firstChild(); obj; obj = obj->getNext() ) { + Box3DSide *side = dynamic_cast(obj); + if (side) { + sides[Box3D::face_to_int(side->getFaceId())] = side; } } sides.erase(-1); @@ -1280,9 +1282,10 @@ SPGroup *box3d_convert_to_group(SPBox3D *box) // create a new group and add the sides (converted to ordinary paths) as its children Inkscape::XML::Node *grepr = xml_doc->createElement("svg:g"); - for ( SPObject *child = box->firstChild(); child; child = child->getNext() ) { - if (SP_IS_BOX3D_SIDE(child)) { - Inkscape::XML::Node *repr = box3d_side_convert_to_path(SP_BOX3D_SIDE(child)); + for ( SPObject *obj = box->firstChild(); obj; obj = obj->getNext() ) { + Box3DSide *side = dynamic_cast(obj); + if (side) { + Inkscape::XML::Node *repr = box3d_side_convert_to_path(side); grepr->appendChild(repr); } else { g_warning("Non-side item encountered as child of a 3D box."); -- cgit v1.2.3