From c4edcb698f1adfc0de6c00f9a2a2f535fe581455 Mon Sep 17 00:00:00 2001 From: Xortex Date: Sat, 8 Sep 2018 10:01:46 +0200 Subject: fix Bug #1786269 --- src/selection-chemistry.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) mode change 100644 => 100755 src/selection-chemistry.cpp (limited to 'src/selection-chemistry.cpp') diff --git a/src/selection-chemistry.cpp b/src/selection-chemistry.cpp old mode 100644 new mode 100755 index 366ccbe33..00c08a4ca --- a/src/selection-chemistry.cpp +++ b/src/selection-chemistry.cpp @@ -515,6 +515,7 @@ void ObjectSet::duplicate(bool suppressDone, bool duplicateLayer) SPUse *use = dynamic_cast(old_clone); SPOffset *offset = dynamic_cast(old_clone); SPText *text = dynamic_cast(old_clone); + SPPath *path = dynamic_cast(old_clone); if (use) { SPItem *orig = use->get_original(); if (!orig) // orphaned @@ -544,6 +545,20 @@ void ObjectSet::duplicate(bool suppressDone, bool duplicateLayer) doc->getObjectById(new_ids[i])->firstChild()->getRepr()->setAttribute("xlink:href", Glib::ustring("#") + new_ids[j]); } } + } else if (path) { + if (old_clone->getAttribute("inkscape:connection-start") != nullptr) { + const char *old_start = old_clone->getAttribute("inkscape:connection-start"); + const char *old_end = old_clone->getAttribute("inkscape:connection-end"); + SPObject *new_clone = doc->getObjectById(new_ids[i]); + for (guint j = 0; j < old_ids.size(); j++) { + if(old_start == Glib::ustring("#") + old_ids[j]) { + new_clone->getRepr()->setAttribute("inkscape:connection-start", Glib::ustring("#") + new_ids[j]); + } + if(old_end == Glib::ustring("#") + old_ids[j]) { + new_clone->getRepr()->setAttribute("inkscape:connection-end", Glib::ustring("#") + new_ids[j]); + } + } + } } } } -- cgit v1.2.3