diff options
| author | su_v <suv-sf@users.sourceforge.net> | 2012-12-04 09:51:15 +0000 |
|---|---|---|
| committer | ~suv <suv-sf@users.sourceforge.net> | 2012-12-04 09:51:15 +0000 |
| commit | 2c6e21d9fd3945a73b3ed5d04a87fb16a90f7a8e (patch) | |
| tree | 52a0994d8a30aaa8f867073d1cd9ce575f490de8 /src/gradient-chemistry.cpp | |
| parent | changes_2012-11_28.patch (diff) | |
| parent | wix installer: create msi filename from version sing in src/inkscape.rc, add ... (diff) | |
| download | inkscape-2c6e21d9fd3945a73b3ed5d04a87fb16a90f7a8e.tar.gz inkscape-2c6e21d9fd3945a73b3ed5d04a87fb16a90f7a8e.zip | |
merge from trunk (r11929)
[win32] Please update to latest devlibs for Windows (r41)
(bzr r11668.1.44)
Diffstat (limited to 'src/gradient-chemistry.cpp')
| -rw-r--r-- | src/gradient-chemistry.cpp | 18 |
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++ |
