X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=src%2Fsp-tref.cpp;h=1f1cb4351022319c5ee56ad360063fe801303c35;hb=57eb32794c2df43d60ee8f0a9aa8576567358ce6;hp=16420436180a84f8c9d9713707265440628722b9;hpb=2f99f08590b9e75d4c4f33cc4374db3e8f97f15d;p=inkscape.git diff --git a/src/sp-tref.cpp b/src/sp-tref.cpp index 164204361..1f1cb4351 100644 --- a/src/sp-tref.cpp +++ b/src/sp-tref.cpp @@ -321,7 +321,7 @@ sp_tref_write(SPObject *object, Inkscape::XML::Node *repr, guint flags) * The code for this function is swiped from the tspan bbox code, since tref should work pretty much the same way */ static void -sp_tref_bbox(SPItem const *item, NRRect *bbox, NR::Matrix const &transform, unsigned const flags) +sp_tref_bbox(SPItem const *item, NRRect *bbox, NR::Matrix const &transform, unsigned const /*flags*/) { // find out the ancestor text which holds our layout SPObject *parent_text = SP_OBJECT(item); @@ -353,10 +353,22 @@ static gchar * sp_tref_description(SPItem *item) { SPTRef *tref = SP_TREF(item); - + + SPObject *referred = tref->getObjectReferredTo(); + if (tref && tref->getObjectReferredTo()) { - char *child_desc = sp_item_description(SP_ITEM(tref->getObjectReferredTo())); - char *ret = g_strdup_printf(_("Cloned character data from: %s"), child_desc); + char *child_desc; + + if (SP_IS_ITEM(referred)) { + child_desc = sp_item_description(SP_ITEM(referred)); + } else { + child_desc = ""; + } + + char *ret = g_strdup_printf( + _("Cloned character data%s%s"), + (SP_IS_ITEM(referred) ? _(" from ") : ""), + child_desc); g_free(child_desc); return ret; } else { @@ -367,7 +379,7 @@ sp_tref_description(SPItem *item) /* For the sigc::connection changes (i.e. when the object being refered to changes) */ static void -sp_tref_href_changed(SPObject *old_ref, SPObject *ref, SPTRef *tref) +sp_tref_href_changed(SPObject */*old_ref*/, SPObject */*ref*/, SPTRef *tref) { if (tref) { @@ -399,7 +411,7 @@ sp_tref_href_changed(SPObject *old_ref, SPObject *ref, SPTRef *tref) * Delete the tref object */ static void -sp_tref_delete_self(SPObject *deleted, SPTRef *self) +sp_tref_delete_self(SPObject */*deleted*/, SPTRef *self) { SP_OBJECT(self)->deleteObject(); }