diff options
| author | Jabier Arraiza Cenoz <jabier.arraiza@marker.es> | 2016-10-02 22:44:54 +0000 |
|---|---|---|
| committer | jabiertxof <info@marker.es> | 2016-10-02 22:44:54 +0000 |
| commit | 90e142963afd950b2868434075890054aef090b3 (patch) | |
| tree | edcaf3d0d85b614e5f327fb58c909ffee5207e26 /src/box3d.cpp | |
| parent | Added some widgets from caligraphic tool (diff) | |
| parent | Adjust dock size to minimum width during canvas table size allocation signal. (diff) | |
| download | inkscape-90e142963afd950b2868434075890054aef090b3.tar.gz inkscape-90e142963afd950b2868434075890054aef090b3.zip | |
Update to trunk and some fixes
(bzr r14865.1.14)
Diffstat (limited to 'src/box3d.cpp')
| -rw-r--r-- | src/box3d.cpp | 26 |
1 files changed, 10 insertions, 16 deletions
diff --git a/src/box3d.cpp b/src/box3d.cpp index c4c2728e4..dfc4d06e7 100644 --- a/src/box3d.cpp +++ b/src/box3d.cpp @@ -23,18 +23,12 @@ #include "box3d.h" #include "box3d-side.h" #include "ui/tools/box3d-tool.h" -#include "proj_pt.h" -#include "transf_mat_3x4.h" #include "perspective-line.h" -#include "inkscape.h" -#include "persp3d.h" -#include "line-geometry.h" #include "persp3d-reference.h" #include "uri.h" #include <2geom/line.h> #include "sp-guide.h" #include "sp-namedview.h" -#include "preferences.h" #include "desktop.h" @@ -259,8 +253,8 @@ 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 *obj = box->firstChild(); obj; obj = obj->getNext() ) { - Box3DSide *side = dynamic_cast<Box3DSide *>(obj); + for (auto& obj: box->children) { + Box3DSide *side = dynamic_cast<Box3DSide *>(&obj); if (side) { box3d_side_position_set(side); } @@ -275,8 +269,8 @@ Geom::Affine SPBox3D::set_transform(Geom::Affine const &xform) { gdouble const sw = hypot(ret[0], ret[1]); gdouble const sh = hypot(ret[2], ret[3]); - for ( SPObject *child = firstChild(); child; child = child->getNext() ) { - SPItem *childitem = dynamic_cast<SPItem *>(child); + for (auto& child: children) { + SPItem *childitem = dynamic_cast<SPItem *>(&child); if (childitem) { // Adjust stroke width childitem->adjust_stroke(sqrt(fabs(sw * sh))); @@ -1074,8 +1068,8 @@ box3d_recompute_z_orders (SPBox3D *box) { static std::map<int, Box3DSide *> box3d_get_sides(SPBox3D *box) { std::map<int, Box3DSide *> sides; - for ( SPObject *obj = box->firstChild(); obj; obj = obj->getNext() ) { - Box3DSide *side = dynamic_cast<Box3DSide *>(obj); + for (auto& obj: box->children) { + Box3DSide *side = dynamic_cast<Box3DSide *>(&obj); if (side) { sides[Box3D::face_to_int(side->getFaceId())] = side; } @@ -1217,8 +1211,8 @@ static void box3d_extract_boxes_rec(SPObject *obj, std::list<SPBox3D *> &boxes) if (box) { boxes.push_back(box); } else if (dynamic_cast<SPGroup *>(obj)) { - for ( SPObject *child = obj->firstChild(); child; child = child->getNext() ) { - box3d_extract_boxes_rec(child, boxes); + for (auto& child: obj->children) { + box3d_extract_boxes_rec(&child, boxes); } } } @@ -1276,8 +1270,8 @@ 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 *obj = box->firstChild(); obj; obj = obj->getNext() ) { - Box3DSide *side = dynamic_cast<Box3DSide *>(obj); + for (auto& obj: box->children) { + Box3DSide *side = dynamic_cast<Box3DSide *>(&obj); if (side) { Inkscape::XML::Node *repr = box3d_side_convert_to_path(side); grepr->appendChild(repr); |
