Code

Make linked offsets respect "Relink duplicated clones" settings
authorAdonis Papaderos <ado.papas@yahoo.gr>
Mon, 6 Dec 2010 21:19:26 +0000 (23:19 +0200)
committerAdonis Papaderos <ado.papas@yahoo.gr>
Mon, 6 Dec 2010 21:19:26 +0000 (23:19 +0200)
src/selection-chemistry.cpp

index 6786479d6230bda78540ff89461b2c80f323141e..55cfe9234a0b47e4c47608dae81e1e0cfae2376d 100644 (file)
@@ -415,6 +415,14 @@ 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++) {
+                    if (!strcmp(SP_OFFSET(old_clone)->sourceHref+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);
+                    }
+                }
             }
         }
     }