summaryrefslogtreecommitdiffstats
path: root/src/gradient-chemistry.cpp
diff options
context:
space:
mode:
authorJohn Smith <john.smith7545@yahoo.com>2012-11-28 00:44:24 +0000
committerJohn Smith <john.smith7545@yahoo.com>2012-11-28 00:44:24 +0000
commitc31f12ada683e302beb99dbc6eaea5d6d1205ab2 (patch)
treeb08c8cf71364338d95cb5306245cd4d7272d164f /src/gradient-chemistry.cpp
parentGTK+ 3: Migrate to GdkRGBA (diff)
downloadinkscape-c31f12ada683e302beb99dbc6eaea5d6d1205ab2.tar.gz
inkscape-c31f12ada683e302beb99dbc6eaea5d6d1205ab2.zip
Fix for 1071421 : Setting swatch as fill/stroke creates new swatches which never go away
(bzr r11911)
Diffstat (limited to '')
-rw-r--r--src/gradient-chemistry.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/gradient-chemistry.cpp b/src/gradient-chemistry.cpp
index 0038e9325..6b019ad2a 100644
--- a/src/gradient-chemistry.cpp
+++ b/src/gradient-chemistry.cpp
@@ -27,6 +27,7 @@
#include "style.h"
#include "document-private.h"
#include "document-undo.h"
+#include "desktop.h"
#include "desktop-style.h"
#include "desktop-handles.h"
#include "event-context.h"
@@ -1592,6 +1593,23 @@ void sp_gradient_reverse_selected_gradients(SPDesktop *desktop)
_("Reverse gradient"));
}
+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);
+ if ( id == grad->getId() ) {
+ grad->setSwatch(false);
+ DocumentUndo::done(doc, SP_VERB_CONTEXT_GRADIENT,
+ _("Delete swatch"));
+ break;
+ }
+ }
+ }
+}
/*
Local Variables:
mode:c++