diff options
| author | Ted Gould <ted@gould.cx> | 2016-08-12 04:11:03 +0000 |
|---|---|---|
| committer | Ted Gould <ted@gould.cx> | 2016-08-12 04:11:03 +0000 |
| commit | ff848ebc9919d158c3ec3d7420e72b6aca99a3ea (patch) | |
| tree | 030ab171865d0ed7f6bae3ef68315639cdb2622b /src/gradient-chemistry.cpp | |
| parent | Merging 0.92.x branch (diff) | |
| parent | CloneTiler: Further C++ification (diff) | |
| download | inkscape-ff848ebc9919d158c3ec3d7420e72b6aca99a3ea.tar.gz inkscape-ff848ebc9919d158c3ec3d7420e72b6aca99a3ea.zip | |
Merge trunk
(bzr r14950.1.20)
Diffstat (limited to 'src/gradient-chemistry.cpp')
| -rw-r--r-- | src/gradient-chemistry.cpp | 32 |
1 files changed, 14 insertions, 18 deletions
diff --git a/src/gradient-chemistry.cpp b/src/gradient-chemistry.cpp index edeb523d7..4521d72fd 100644 --- a/src/gradient-chemistry.cpp +++ b/src/gradient-chemistry.cpp @@ -24,7 +24,6 @@ #include <2geom/bezier-curve.h> #include <2geom/crossing.h> #include <2geom/line.h> -#include <2geom/angle.h> #include "style.h" #include "document-private.h" @@ -38,7 +37,6 @@ #include <glibmm/i18n.h> #include "sp-gradient-reference.h" -#include "sp-gradient-vector.h" #include "sp-linear-gradient.h" #include "sp-radial-gradient.h" #include "sp-mesh.h" @@ -48,11 +46,9 @@ #include "sp-text.h" #include "sp-tspan.h" -#include "xml/repr.h" #include "svg/svg.h" #include "svg/svg-color.h" #include "svg/css-ostringstream.h" -#include "preferences.h" #define noSP_GR_VERBOSE @@ -199,8 +195,8 @@ static guint count_gradient_hrefs(SPObject *o, SPGradient *gr) i ++; } - for ( SPObject *child = o->firstChild(); child; child = child->getNext() ) { - i += count_gradient_hrefs(child, gr); + for (auto& child: o->children) { + i += count_gradient_hrefs(&child, gr); } return i; @@ -926,11 +922,11 @@ void sp_item_gradient_reverse_vector(SPItem *item, Inkscape::PaintTarget fill_or GSList *child_objects = NULL; std::vector<double> offsets; double offset; - for ( SPObject *child = vector->firstChild(); child; child = child->getNext()) { - child_reprs = g_slist_prepend (child_reprs, child->getRepr()); - child_objects = g_slist_prepend (child_objects, child); + for (auto& child: vector->children) { + child_reprs = g_slist_prepend (child_reprs, child.getRepr()); + child_objects = g_slist_prepend (child_objects, &child); offset=0; - sp_repr_get_double(child->getRepr(), "offset", &offset); + sp_repr_get_double(child.getRepr(), "offset", &offset); offsets.push_back(offset); } @@ -979,9 +975,9 @@ void sp_item_gradient_invert_vector_color(SPItem *item, Inkscape::PaintTarget fi sp_gradient_repr_set_link(gradient->getRepr(), vector); } - for ( SPObject *child = vector->firstChild(); child; child = child->getNext()) { - if (SP_IS_STOP(child)) { - guint32 color = SP_STOP(child)->get_rgba32(); + for (auto& child: vector->children) { + if (SP_IS_STOP(&child)) { + guint32 color = SP_STOP(&child)->get_rgba32(); //g_message("Stop color %d", color); gchar c[64]; sp_svg_write_color (c, sizeof(c), @@ -994,7 +990,7 @@ void sp_item_gradient_invert_vector_color(SPItem *item, Inkscape::PaintTarget fi ); SPCSSAttr *css = sp_repr_css_attr_new (); sp_repr_css_set_property (css, "stop-color", c); - sp_repr_css_change(child->getRepr(), css, "style"); + sp_repr_css_change(child.getRepr(), css, "style"); sp_repr_css_attr_unref (css); } } @@ -1570,8 +1566,8 @@ void sp_gradient_invert_selected_gradients(SPDesktop *desktop, Inkscape::PaintTa { Inkscape::Selection *selection = desktop->getSelection(); - const std::vector<SPItem*> list=selection->itemList(); - for (std::vector<SPItem*>::const_iterator i = list.begin(); i != list.end(); ++i) { + auto list= selection->items(); + for (auto i = list.begin(); i != list.end(); ++i) { sp_item_gradient_invert_vector_color(*i, fill_or_stroke); } @@ -1595,8 +1591,8 @@ void sp_gradient_reverse_selected_gradients(SPDesktop *desktop) if (drag && !drag->selected.empty()) { drag->selected_reverse_vector(); } else { // If no drag or no dragger selected, act on selection (both fill and stroke gradients) - const std::vector<SPItem*> list=selection->itemList(); - for (std::vector<SPItem*>::const_iterator i = list.begin(); i != list.end(); ++i) { + auto list= selection->items(); + for (auto i = list.begin(); i != list.end(); ++i) { sp_item_gradient_reverse_vector(*i, Inkscape::FOR_FILL); sp_item_gradient_reverse_vector(*i, Inkscape::FOR_STROKE); } |
