Code

now that selection description includes style (filtered, clipped), we need to update...
[inkscape.git] / src / sp-item.cpp
index b5d9050c69685d26b2ab183b8ab1623b64c56ac7..2ac480341a4ef469a9194ed439bff6f249a517ea 100644 (file)
@@ -47,6 +47,7 @@
 #include "sp-item-rm-unsatisfied-cns.h"
 #include "sp-pattern.h"
 #include "sp-switch.h"
+#include "sp-guide-constraint.h"
 #include "gradient-chemistry.h"
 #include "preferences.h"
 #include "conn-avoid-ref.h"
@@ -176,6 +177,8 @@ void SPItem::init() {
 
     this->avoidRef = new SPAvoidRef(this);
 
+    new (&this->constraints) std::vector<SPGuideConstraint>();
+
     new (&this->_transformed_signal) sigc::signal<void, Geom::Matrix const *, SPItem *>();
 }
 
@@ -970,7 +973,7 @@ void sp_item_snappoints(SPItem const *item, SnapPointsIter p, Inkscape::SnapPref
 
     // Get the snappoints at the item's center
     if (snapprefs != NULL && snapprefs->getIncludeItemCenter()) {
-        *p = item->getCenter();
+       *p = item->getCenter();
     }
 
     // Get the snappoints of clipping paths and mask, if any
@@ -1047,8 +1050,14 @@ sp_item_description(SPItem *item)
             g_free (s);
             s = snew;
         }
-        if (SP_OBJECT_STYLE(item) && SP_OBJECT_STYLE(item)->filter.href) {
-            gchar *snew = g_strdup_printf (_("%s; <i>filtered</i>"), s);
+        if (SP_OBJECT_STYLE(item) && SP_OBJECT_STYLE(item)->filter.href && SP_OBJECT_STYLE(item)->filter.href->getObject()) {
+            const gchar *label = SP_OBJECT_STYLE(item)->filter.href->getObject()->label();
+            gchar *snew;
+            if (label) {
+                snew = g_strdup_printf (_("%s; <i>filtered (%s)</i>"), s, label);
+            } else {
+                snew = g_strdup_printf (_("%s; <i>filtered</i>"), s);
+            }
             g_free (s);
             s = snew;
         }