diff --git a/src/id-clash.cpp b/src/id-clash.cpp
index 1ce30e0ddf67f6ae11dd6d5a1ff98df8cad2a418..b215576a4d506f8ca39fc9a875313dfe31edf0e4 100644 (file)
--- a/src/id-clash.cpp
+++ b/src/id-clash.cpp
typedef std::list<id_changeitem_type> id_changelist_type;
const char *href_like_attributes[] = {
+ "inkscape:connection-end",
+ "inkscape:connection-start",
"inkscape:href",
"inkscape:path-effect",
"inkscape:perspectiveID",
static void
find_references(SPObject *elem, refmap_type *refmap)
{
+ if (SP_OBJECT_IS_CLONED(elem)) return;
Inkscape::XML::Node *repr_elem = SP_OBJECT_REPR(elem);
+ if (!repr_elem) return;
if (repr_elem->type() != Inkscape::XML::ELEMENT_NODE) return;
/* check for references in inkscape:clipboard elements */
for (unsigned i = 0; i < NUM_SPIPAINT_PROPERTIES; ++i) {
const SPIPaint SPStyle::*prop = SPIPaint_members[i];
const SPIPaint *paint = &(style->*prop);
- if (paint->isPaintserver()) {
- const gchar *id = SP_OBJECT_ID(paint->value.href->getObject());
- IdReference idref = { REF_STYLE, elem, SPIPaint_properties[i] };
- (*refmap)[id].push_back(idref);
+ if (paint->isPaintserver() && paint->value.href) {
+ const SPObject *obj = paint->value.href->getObject();
+ if (obj) {
+ const gchar *id = SP_OBJECT_ID(obj);
+ IdReference idref = { REF_STYLE, elem, SPIPaint_properties[i] };
+ (*refmap)[id].push_back(idref);
+ }
}
}
/* check for url(#...) references in 'filter' */
const SPIFilter *filter = &(style->filter);
if (filter->href) {
- const gchar *id = SP_OBJECT_ID(filter->href->getObject());
- IdReference idref = { REF_STYLE, elem, "filter" };
- (*refmap)[id].push_back(idref);
+ const SPObject *obj = filter->href->getObject();
+ if (obj) {
+ const gchar *id = SP_OBJECT_ID(obj);
+ IdReference idref = { REF_STYLE, elem, "filter" };
+ (*refmap)[id].push_back(idref);
+ }
}
/* check for other url(#...) references */