summaryrefslogtreecommitdiffstats
path: root/src/ui/clipboard.cpp
diff options
context:
space:
mode:
authorJabier Arraiza Cenoz <jabier.arraiza@marker.es>2016-11-05 17:10:22 +0000
committerjabiertxof <info@marker.es>2016-11-05 17:10:22 +0000
commit218c1acafd09c2b2469db082cf6e389869f9c48e (patch)
treec7324d131df0a85effbc548e1ee35446aff25fdd /src/ui/clipboard.cpp
parentFix angle constrain, thanks to vlada, Mc and LiamW (diff)
parentMove a header place (diff)
downloadinkscape-218c1acafd09c2b2469db082cf6e389869f9c48e.tar.gz
inkscape-218c1acafd09c2b2469db082cf6e389869f9c48e.zip
Update to trunk
(bzr r15142.1.30)
Diffstat (limited to 'src/ui/clipboard.cpp')
-rw-r--r--src/ui/clipboard.cpp43
1 files changed, 20 insertions, 23 deletions
diff --git a/src/ui/clipboard.cpp b/src/ui/clipboard.cpp
index 0a671cc8a..a8e708597 100644
--- a/src/ui/clipboard.cpp
+++ b/src/ui/clipboard.cpp
@@ -60,6 +60,7 @@
#include "sp-mask.h"
#include "sp-textpath.h"
#include "sp-rect.h"
+#include "sp-object.h"
#include "live_effects/lpeobject.h"
#include "live_effects/lpeobject-reference.h"
#include "live_effects/parameter/path.h"
@@ -688,7 +689,25 @@ 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);
+ gchar *new_conflict_id = sp_object_get_unique_id(lpeobj, lpeobj->getAttribute("id"));
+ lpeobjcopy->setAttribute("id", new_conflict_id);
+ g_free(new_conflict_id);
+ os << "#" << lpeobjcopy->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 +739,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 +795,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);