summaryrefslogtreecommitdiffstats
path: root/src/widgets/fill-style.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/widgets/fill-style.cpp')
-rw-r--r--src/widgets/fill-style.cpp32
1 files changed, 16 insertions, 16 deletions
diff --git a/src/widgets/fill-style.cpp b/src/widgets/fill-style.cpp
index d60a92b8b..2c298b04d 100644
--- a/src/widgets/fill-style.cpp
+++ b/src/widgets/fill-style.cpp
@@ -481,7 +481,7 @@ void FillNStroke::updateFromPaint()
SPDocument *document = desktop->getDocument();
Inkscape::Selection *selection = desktop->getSelection();
- GSList const *items = selection->itemList();
+ SelContainer const items = selection->itemList();
switch (psel->mode) {
case SPPaintSelector::MODE_EMPTY:
@@ -543,7 +543,7 @@ void FillNStroke::updateFromPaint()
case SPPaintSelector::MODE_GRADIENT_LINEAR:
case SPPaintSelector::MODE_GRADIENT_RADIAL:
case SPPaintSelector::MODE_SWATCH:
- if (items) {
+ if (!items.empty()) {
SPGradientType const gradient_type = ( psel->mode != SPPaintSelector::MODE_GRADIENT_RADIAL
? SP_GRADIENT_TYPE_LINEAR
: SP_GRADIENT_TYPE_RADIAL );
@@ -561,7 +561,7 @@ void FillNStroke::updateFromPaint()
/* No vector in paint selector should mean that we just changed mode */
SPStyle query(desktop->doc());
- int result = objects_query_fillstroke(const_cast<GSList *>(items), &query, kind == FILL);
+ int result = objects_query_fillstroke(items, &query, kind == FILL);
if (result == QUERY_STYLE_MULTIPLE_SAME) {
SPIPaint &targPaint = (kind == FILL) ? query.fill : query.stroke;
SPColor common;
@@ -576,39 +576,39 @@ void FillNStroke::updateFromPaint()
}
}
- for (GSList const *i = items; i != NULL; i = i->next) {
+ for(SelContainer::const_iterator i=items.begin();i!=items.end();i++){
//FIXME: see above
if (kind == FILL) {
- sp_repr_css_change_recursive(reinterpret_cast<SPObject*>(i->data)->getRepr(), css, "style");
+ sp_repr_css_change_recursive(reinterpret_cast<SPObject*>(*i)->getRepr(), css, "style");
}
if (!vector) {
SPGradient *gr = sp_gradient_vector_for_object( document,
desktop,
- reinterpret_cast<SPObject*>(i->data),
+ reinterpret_cast<SPObject*>(*i),
(kind == FILL) ? Inkscape::FOR_FILL : Inkscape::FOR_STROKE,
createSwatch );
if ( gr && createSwatch ) {
gr->setSwatch();
}
- sp_item_set_gradient(SP_ITEM(i->data),
+ sp_item_set_gradient(SP_ITEM(*i),
gr,
gradient_type, (kind == FILL) ? Inkscape::FOR_FILL : Inkscape::FOR_STROKE);
} else {
- sp_item_set_gradient(SP_ITEM(i->data), vector, gradient_type, (kind == FILL) ? Inkscape::FOR_FILL : Inkscape::FOR_STROKE);
+ sp_item_set_gradient(SP_ITEM(*i), vector, gradient_type, (kind == FILL) ? Inkscape::FOR_FILL : Inkscape::FOR_STROKE);
}
}
} else {
// We have changed from another gradient type, or modified spread/units within
// this gradient type.
vector = sp_gradient_ensure_vector_normalized(vector);
- for (GSList const *i = items; i != NULL; i = i->next) {
+ for(SelContainer::const_iterator i=items.begin();i!=items.end();i++){
//FIXME: see above
if (kind == FILL) {
- sp_repr_css_change_recursive(reinterpret_cast<SPObject*>(i->data)->getRepr(), css, "style");
+ sp_repr_css_change_recursive(reinterpret_cast<SPObject*>(*i)->getRepr(), css, "style");
}
- SPGradient *gr = sp_item_set_gradient(SP_ITEM(i->data), vector, gradient_type, (kind == FILL) ? Inkscape::FOR_FILL : Inkscape::FOR_STROKE);
+ SPGradient *gr = sp_item_set_gradient(SP_ITEM(*i), vector, gradient_type, (kind == FILL) ? Inkscape::FOR_FILL : Inkscape::FOR_STROKE);
psel->pushAttrsToGradient( gr );
}
}
@@ -625,7 +625,7 @@ void FillNStroke::updateFromPaint()
case SPPaintSelector::MODE_PATTERN:
- if (items) {
+ if (!items.empty()) {
SPPattern *pattern = psel->getPattern();
if (!pattern) {
@@ -648,12 +648,12 @@ void FillNStroke::updateFromPaint()
// cannot just call sp_desktop_set_style, because we don't want to touch those
// objects who already have the same root pattern but through a different href
// chain. FIXME: move this to a sp_item_set_pattern
- for (GSList const *i = items; i != NULL; i = i->next) {
- Inkscape::XML::Node *selrepr = reinterpret_cast<SPObject*>(i->data)->getRepr();
+ for(SelContainer::const_iterator i=items.begin();i!=items.end();i++){
+ Inkscape::XML::Node *selrepr = reinterpret_cast<SPObject*>(*i)->getRepr();
if ( (kind == STROKE) && !selrepr) {
continue;
}
- SPObject *selobj = reinterpret_cast<SPObject*>(i->data);
+ SPObject *selobj = reinterpret_cast<SPObject*>(*i);
SPStyle *style = selobj->style;
if (style && ((kind == FILL) ? style->fill : style->stroke).isPaintserver()) {
@@ -686,7 +686,7 @@ void FillNStroke::updateFromPaint()
break;
case SPPaintSelector::MODE_UNSET:
- if (items) {
+ if (!items.empty()) {
SPCSSAttr *css = sp_repr_css_attr_new();
if (kind == FILL) {
sp_repr_css_unset_property(css, "fill");