From: Krzysztof KosiƄski Date: Wed, 8 Dec 2010 09:17:25 +0000 (+0100) Subject: Respect "relink duplicates clones" setting with linked offsets. X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=18810e3c807f24dd9100adad097fe15d95ef83c0;hp=de56b49e1cee0142fdb4fd05e3ab21b8a14f6a3c;p=inkscape.git Respect "relink duplicates clones" setting with linked offsets. Patch from Adonis Papaderos. --- diff --git a/src/selection-chemistry.cpp b/src/selection-chemistry.cpp index 6786479d6..8b917de55 100644 --- a/src/selection-chemistry.cpp +++ b/src/selection-chemistry.cpp @@ -415,6 +415,15 @@ void sp_selection_duplicate(SPDesktop *desktop, bool suppressDone) g_free(newref); } } + } else if (SP_IS_OFFSET(old_clone)) { + for (guint j = 0; j < old_ids.size(); j++) { + gchar *source_href = SP_OFFSET(old_clone)->sourceHref; + if (source_href && source_href[0]=='#' && !strcmp(source_href+1, old_ids[j])) { + gchar *newref = g_strdup_printf("#%s", new_ids[j]); + doc->getObjectById(new_ids[i])->repr->setAttribute("xlink:href", newref); + g_free(newref); + } + } } } }