summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ui/clipboard.cpp40
1 files changed, 17 insertions, 23 deletions
diff --git a/src/ui/clipboard.cpp b/src/ui/clipboard.cpp
index 0a671cc8a..ef00e11b3 100644
--- a/src/ui/clipboard.cpp
+++ b/src/ui/clipboard.cpp
@@ -688,7 +688,23 @@ void ClipboardManagerImpl::_copySelection(ObjectSet *selection)
else
obj_copy = _copyNode(obj, _doc, _clipnode);
-
+ // For lpe items, copy lpe stack if applicable
+ SPLPEItem *lpeitem = dynamic_cast<SPLPEItem *>(item);
+ if (lpeitem) {
+ Inkscape::SVGOStringStream os;
+ if (lpeitem->hasPathEffect()) {
+ for (PathEffectList::iterator it = lpeitem->path_effect_list->begin(); it != lpeitem->path_effect_list->end(); ++it)
+ {
+ LivePathEffectObject *lpeobj = (*it)->lpeobject;
+ if (lpeobj) {
+ Inkscape::XML::Node * lpeobjcopy = _copyNode(lpeobj->getRepr(), _doc, _defs);
+ lpeobjcopy->setAttribute("id",lpeobj->getRepr()->attribute("id"));
+ os << "#" << lpeobj->getRepr()->attribute("id") << ";";
+ }
+ }
+ }
+ obj_copy->setAttribute("inkscape:path-effect", os.str().c_str());
+ }
// copy complete inherited style
SPCSSAttr *css = sp_repr_css_attr_inherited(obj, "style");
sp_repr_css_set(obj_copy, css, "style");
@@ -720,14 +736,6 @@ void ClipboardManagerImpl::_copySelection(ObjectSet *selection)
sp_repr_css_set(_clipnode, style, "style");
sp_repr_css_attr_unref(style);
}
-
- // copy path effect from the first path
- if (object) {
- gchar const *effect =object->getRepr()->attribute("inkscape:path-effect");
- if (effect) {
- _clipnode->setAttribute("inkscape:path-effect", effect);
- }
- }
}
Geom::OptRect size = selection->visualBounds();
@@ -784,20 +792,6 @@ void ClipboardManagerImpl::_copyUsedDefs(SPItem *item)
}
}
- // For lpe items, copy lpe stack if applicable
- SPLPEItem *lpeitem = dynamic_cast<SPLPEItem *>(item);
- if (lpeitem) {
- if (lpeitem->hasPathEffect()) {
- for (PathEffectList::iterator it = lpeitem->path_effect_list->begin(); it != lpeitem->path_effect_list->end(); ++it)
- {
- LivePathEffectObject *lpeobj = (*it)->lpeobject;
- if (lpeobj) {
- _copyNode(lpeobj->getRepr(), _doc, _defs);
- }
- }
- }
- }
-
// For 3D boxes, copy perspectives
{
SPBox3D *box = dynamic_cast<SPBox3D *>(item);