Code

fix error in curve cxxtests
[inkscape.git] / src / conn-avoid-ref.cpp
index 0bbefa3c015d194af8f777d7ad72c255e037f0c1..43c9c0b66cb652c5fa906f50d7d1f5e1c5ca20b2 100644 (file)
  */
 
 
+#include <cstring>
+#include <string>
 
 #include "sp-item.h"
 #include "conn-avoid-ref.h"
-#include "libnr/nr-rect-ops.h"
 #include "libavoid/polyutil.h"
 #include "libavoid/router.h"
 #include "libavoid/connector.h"
-#include "xml/simple-node.cpp"
+#include "xml/node.h"
 #include "document.h"
-#include "prefs-utils.h"
-
 #include "desktop.h"
 #include "desktop-handles.h"
 #include "sp-namedview.h"
@@ -191,7 +190,7 @@ static Avoid::Polygn avoid_item_poly(SPItem const *item)
     //       by the sp_*_update functions, e.g., text.
     sp_document_ensure_up_to_date(item->document);
     
-    NR::Maybe<NR::Rect> rHull = item->getBounds(sp_item_i2doc_affine(item));
+    Geom::OptRect rHull = item->getBounds(sp_item_i2doc_affine(item));
     if (!rHull) {
         return Avoid::newPoly(0);
     }
@@ -199,13 +198,14 @@ static Avoid::Polygn avoid_item_poly(SPItem const *item)
     double spacing = desktop->namedview->connector_spacing;
 
     // Add a little buffer around the edge of each object.
-    NR::Rect rExpandedHull = NR::expand(*rHull, -spacing); 
+    Geom::Rect rExpandedHull = *rHull;
+    rExpandedHull.expandBy(spacing); 
     poly = Avoid::newPoly(4);
 
     for (unsigned n = 0; n < 4; ++n) {
-        NR::Point hullPoint = rExpandedHull.corner(n);
-        poly.ps[n].x = hullPoint[NR::X];
-        poly.ps[n].y = hullPoint[NR::Y];
+        Geom::Point hullPoint = rExpandedHull.corner(n);
+        poly.ps[n].x = hullPoint[Geom::X];
+        poly.ps[n].y = hullPoint[Geom::Y];
     }
 
     return poly;
@@ -236,7 +236,7 @@ GSList *get_avoided_items(GSList *list, SPObject *from, SPDesktop *desktop,
 }
 
 
-void avoid_item_move(NR::Matrix const */*mp*/, SPItem *moved_item)
+void avoid_item_move(Geom::Matrix const */*mp*/, SPItem *moved_item)
 {
     Avoid::ShapeRef *shapeRef = moved_item->avoidRef->shapeRef;
     g_assert(shapeRef);
@@ -253,7 +253,7 @@ void avoid_item_move(NR::Matrix const */*mp*/, SPItem *moved_item)
 void init_avoided_shape_geometry(SPDesktop *desktop)
 {
     // Don't count this as changes to the document,
-    // it is basically just llate initialisation.
+    // it is basically just late initialisation.
     SPDocument *document = sp_desktop_document(desktop);
     bool saved = sp_document_get_undo_sensitive(document);
     sp_document_set_undo_sensitive(document, false);