Code

better fix for lpe stack forking
[inkscape.git] / src / ui / clipboard.cpp
index dd1f981b5dd8d1de2adae5520dceaf73911ea6ec..9ce2ac5bac211ae2b5908a00d549a181c32171cc 100644 (file)
@@ -1057,6 +1057,8 @@ void ClipboardManagerImpl::_applyPathEffect(SPItem *item, gchar const *effectsta
     {
         SPLPEItem *lpeitem = SP_LPE_ITEM(item);
         // for each effect in the stack, check if we need to fork it before adding it to the item
+        sp_lpe_item_fork_path_effects_if_necessary(lpeitem, 1);
+
         std::istringstream iss(effectstack);
         std::string href;
         while (std::getline(iss, href, ';'))
@@ -1065,8 +1067,7 @@ void ClipboardManagerImpl::_applyPathEffect(SPItem *item, gchar const *effectsta
             if (!obj) {
                 return;
             }
-            // if the effectstack is not used by anyone, we might as well take it
-            LivePathEffectObject *lpeobj = LIVEPATHEFFECT(obj)->fork_private_if_necessary(1);
+            LivePathEffectObject *lpeobj = LIVEPATHEFFECT(obj);
             sp_lpe_item_add_path_effect(lpeitem, lpeobj);
         }
     }