diff options
| author | Marc Jeanmougin <marc@jeanmougin.fr> | 2015-12-09 15:49:59 +0000 |
|---|---|---|
| committer | Marc Jeanmougin <marcjeanmougin@free.fr> | 2015-12-09 15:49:59 +0000 |
| commit | 50ab3a3c4215474d437f9adcc4b725bed26767d7 (patch) | |
| tree | 0241555b1dc6efe9f35db7696c7e440e8a56bada /src/gradient-chemistry.cpp | |
| parent | Remove unused var in header file (diff) | |
| parent | update to trunk (diff) | |
| download | inkscape-50ab3a3c4215474d437f9adcc4b725bed26767d7.tar.gz inkscape-50ab3a3c4215474d437f9adcc4b725bed26767d7.zip | |
Merge glib_hunt: cppification and removal of many glib GList/GSList/GHashTable
(bzr r14520)
Diffstat (limited to 'src/gradient-chemistry.cpp')
| -rw-r--r-- | src/gradient-chemistry.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/gradient-chemistry.cpp b/src/gradient-chemistry.cpp index 886bf484d..9f2d030d4 100644 --- a/src/gradient-chemistry.cpp +++ b/src/gradient-chemistry.cpp @@ -1592,7 +1592,7 @@ void sp_gradient_reverse_selected_gradients(SPDesktop *desktop) GrDrag *drag = ev->get_drag(); // First try selected dragger - if (drag && drag->selected) { + 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(); @@ -1612,9 +1612,9 @@ void sp_gradient_unset_swatch(SPDesktop *desktop, std::string id) SPDocument *doc = desktop ? desktop->doc() : 0; if (doc) { - const GSList *gradients = doc->getResourceList("gradient"); - for (const GSList *item = gradients; item; item = item->next) { - SPGradient* grad = SP_GRADIENT(item->data); + const std::set<SPObject *> gradients = doc->getResourceList("gradient"); + for (std::set<SPObject *>::const_iterator i = gradients.begin(); i != gradients.end(); ++i) { + SPGradient* grad = SP_GRADIENT(*i); if ( id == grad->getId() ) { grad->setSwatch(false); DocumentUndo::done(doc, SP_VERB_CONTEXT_GRADIENT, |
