Code

remove registerEditWidget, move this to SPDesktop::init instead; a noop change but...
[inkscape.git] / src / sp-item.cpp
index ff3952c25995c766a82ce004f4dad4197811afa2..3950482803a544b3efe179f976b39ad03204de72 100644 (file)
@@ -293,6 +293,9 @@ SPItem::setExplicitlyHidden(bool const val) {
  */
 void
 SPItem::setCenter(Geom::Point object_centre) {
+    // for getBounds() to work
+    sp_document_ensure_up_to_date(SP_OBJECT_DOCUMENT(this));
+
     Geom::OptRect bbox = getBounds(sp_item_i2d_affine(this));
     if (bbox) {
         transform_center_x = object_centre[Geom::X] - bbox->midpoint()[Geom::X];
@@ -315,6 +318,9 @@ bool SPItem::isCenterSet() {
 }
 
 Geom::Point SPItem::getCenter() const {
+    // for getBounds() to work
+    sp_document_ensure_up_to_date(SP_OBJECT_DOCUMENT(this));
+
     Geom::OptRect bbox = getBounds(sp_item_i2d_affine(this));
     if (bbox) {
         return to_2geom(bbox->midpoint()) + Geom::Point (this->transform_center_x, this->transform_center_y);
@@ -1056,7 +1062,7 @@ sp_item_description(SPItem *item)
             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);
+                snew = g_strdup_printf (_("%s; <i>filtered (%s)</i>"), s, _(label));
             } else {
                 snew = g_strdup_printf (_("%s; <i>filtered</i>"), s);
             }