summaryrefslogtreecommitdiffstats
path: root/src/gradient-chemistry.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gradient-chemistry.cpp')
-rw-r--r--src/gradient-chemistry.cpp8
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,