Code

Filter effects dialog:
authornicholasbishop <nicholasbishop@users.sourceforge.net>
Tue, 17 Jul 2007 19:14:51 +0000 (19:14 +0000)
committernicholasbishop <nicholasbishop@users.sourceforge.net>
Tue, 17 Jul 2007 19:14:51 +0000 (19:14 +0000)
* Enable duplicating filters (from the popup menu)

src/ui/dialog/filter-effects-dialog.cpp

index cb0a52db283ceaf93c1b3b54922d691309468f65..19613f1fd97a742c3d2ea52212155b74e00f5371 100644 (file)
@@ -169,10 +169,12 @@ void FilterEffectsDialog::FilterModifier::remove_filter()
 
 void FilterEffectsDialog::FilterModifier::duplicate_filter()
 {
-    SPFilter *filter = get_selected_filter();
+    SPFilterfilter = get_selected_filter();
 
     if(filter) {
-        //SPFilter *dupfilter = filter_duplicate(sp_desktop_document(SP_ACTIVE_DESKTOP), filter);
+        Inkscape::XML::Node* repr = SP_OBJECT_REPR(filter), *parent = repr->parent();
+        repr = repr->duplicate(repr->document());
+        parent->appendChild(repr);
 
         sp_document_done(filter->document, SP_VERB_DIALOG_FILTER_EFFECTS, _("Duplicate filter"));