Code

clean up tabs and DOS-ishness
[inkscape.git] / src / sp-tref.cpp
index 16420436180a84f8c9d9713707265440628722b9..1f1cb4351022319c5ee56ad360063fe801303c35 100644 (file)
@@ -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(_("<b>Cloned character data</b> 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(
+                _("<b>Cloned character data</b>%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();
 }