Code

drop more missing files from autoconf
[inkscape.git] / src / conn-avoid-ref.cpp
index 22ddb54250c2a46c2f99ffe63bf1bb888bdad37c..540e8205fbbf191e093619c4e60e601c3faa5fa7 100644 (file)
@@ -186,18 +186,20 @@ static Avoid::Polygn avoid_item_poly(SPItem const *item)
     //       some convex hull code, though not NR::ConvexHull as this
     //       only keeps the bounding box of the convex hull currently.
 
-    // TODO: SPItem::invokeBbox gives the wrong result for some objects
+    // TODO: SPItem::getBounds gives the wrong result for some objects
     //       that have internal representations that are updated later
     //       by the sp_*_update functions, e.g., text.
     sp_document_ensure_up_to_date(item->document);
     
-    NR::Rect rHull = item->invokeBbox(sp_item_i2doc_affine(item));
-
+    NR::Maybe<NR::Rect> rHull = item->getBounds(sp_item_i2doc_affine(item));
+    if (!rHull) {
+        return Avoid::newPoly(0);
+    }
 
     double spacing = desktop->namedview->connector_spacing;
 
     // Add a little buffer around the edge of each object.
-    NR::Rect rExpandedHull = NR::expand(rHull, -spacing); 
+    NR::Rect rExpandedHull = NR::expand(*rHull, -spacing); 
     poly = Avoid::newPoly(4);
 
     for (unsigned n = 0; n < 4; ++n) {
@@ -273,8 +275,8 @@ void init_avoided_shape_geometry(SPDesktop *desktop)
     // Don't count this as changes to the document,
     // it is basically just llate initialisation.
     SPDocument *document = sp_desktop_document(desktop);
-    gboolean saved = sp_document_get_undo_sensitive(document);
-    sp_document_set_undo_sensitive(document, FALSE);
+    bool saved = sp_document_get_undo_sensitive(document);
+    sp_document_set_undo_sensitive(document, false);
     
     bool initialised = false;
     GSList *items = get_avoided_items(NULL, desktop->currentRoot(), desktop,