=== modified file 'src/arc-context.cpp'
--- src/arc-context.cpp	2013-09-26 23:45:12 +0000
+++ src/arc-context.cpp	2013-10-05 11:12:22 +0000
@@ -363,7 +363,7 @@
         // Set style
         sp_desktop_apply_style_tool(desktop, repr, "/tools/shapes/arc", false);
 
-        this->arc = SP_ARC(desktop->currentLayer()->appendChildRepr(repr));
+        this->arc = SP_GENERICELLIPSE(desktop->currentLayer()->appendChildRepr(repr));
         Inkscape::GC::release(repr);
         this->arc->transform = SP_ITEM(desktop->currentLayer())->i2doc_affine().inverse();
         this->arc->updateRepr();
@@ -409,9 +409,9 @@
         }
     }
 
-    this->arc->sp_arc_position_set(
-                        r.midpoint()[Geom::X], r.midpoint()[Geom::Y],
-                        r.dimensions()[Geom::X] / 2, r.dimensions()[Geom::Y] / 2);
+    this->arc->position_set(
+        r.midpoint()[Geom::X], r.midpoint()[Geom::Y],
+        r.dimensions()[Geom::X] / 2, r.dimensions()[Geom::Y] / 2);
 
     double rdimx = r.dimensions()[Geom::X];
     double rdimy = r.dimensions()[Geom::Y];

=== modified file 'src/arc-context.h'
--- src/arc-context.h	2013-09-15 00:43:49 +0000
+++ src/arc-context.h	2013-10-04 14:47:57 +0000
@@ -41,7 +41,7 @@
 	virtual const std::string& getPrefsPath();
 
 private:
-	SPArc *arc;
+	SPGenericEllipse *arc;
 
     Geom::Point center;
 

=== modified file 'src/knotholder.cpp'
--- src/knotholder.cpp	2013-10-04 21:57:28 +0000
+++ src/knotholder.cpp	2013-10-07 18:46:57 +0000
@@ -242,7 +242,7 @@
 
 void KnotHolder::add(KnotHolderEntity *e)
 {
-    g_message("Adding a knot at %p", e);
+    // g_message("Adding a knot at %p", e);
     entity.push_back(e);
     updateControlSizes();
 }

=== modified file 'src/object-edit.cpp'
--- src/object-edit.cpp	2013-10-04 21:57:28 +0000
+++ src/object-edit.cpp	2013-10-05 10:58:25 +0000
@@ -69,7 +69,7 @@
         knotholder = new RectKnotHolder(desktop, item, NULL);
     } else if (SP_IS_BOX3D(item)) {
         knotholder = new Box3DKnotHolder(desktop, item, NULL);
-    } else if (SP_IS_ARC(item)) {
+    } else if (SP_IS_GENERICELLIPSE(item)) {
         knotholder = new ArcKnotHolder(desktop, item, NULL);
     } else if (SP_IS_STAR(item)) {
         knotholder = new StarKnotHolder(desktop, item, NULL);
@@ -787,7 +787,7 @@
 {
     int snaps = Inkscape::Preferences::get()->getInt("/options/rotationsnapsperpi/value", 12);
 
-    SPArc *arc = SP_ARC(item);
+    SPGenericEllipse *arc = SP_GENERICELLIPSE(item);
 
     arc->setClosed(sp_genericellipse_side(arc, p) == -1);
 
@@ -808,9 +808,8 @@
 ArcKnotHolderEntityStart::knot_get() const
 {
     SPGenericEllipse const *ge = SP_GENERICELLIPSE(item);
-    SPArc *arc = SP_ARC(item);
 
-    return arc->getPointAtAngle(ge->start);
+    return ge->getPointAtAngle(ge->start);
 }
 
 void
@@ -829,7 +828,7 @@
 {
     int snaps = Inkscape::Preferences::get()->getInt("/options/rotationsnapsperpi/value", 12);
 
-    SPArc *arc = SP_ARC(item);
+    SPGenericEllipse *arc = SP_GENERICELLIPSE(item);
 
     arc->setClosed(sp_genericellipse_side(arc, p) == -1);
 
@@ -850,9 +849,8 @@
 ArcKnotHolderEntityEnd::knot_get() const
 {
     SPGenericEllipse const *ge = SP_GENERICELLIPSE(item);
-    SPArc *arc = SP_ARC(item);
 
-    return arc->getPointAtAngle(ge->end);
+    return ge->getPointAtAngle(ge->end);
 }
 
 

=== modified file 'src/selection-chemistry.cpp'
--- src/selection-chemistry.cpp	2013-10-04 21:57:28 +0000
+++ src/selection-chemistry.cpp	2013-10-05 06:34:54 +0000
@@ -1915,8 +1915,8 @@
     if ( SP_IS_RECT(i)) {
         return ( SP_IS_RECT(j) );
 
-    } else if (SP_IS_GENERICELLIPSE(i) || SP_IS_ELLIPSE(i) || SP_IS_ARC(i) || SP_IS_CIRCLE(i)) {
-        return (SP_IS_GENERICELLIPSE(j) || SP_IS_ELLIPSE(j) || SP_IS_ARC(j) || SP_IS_CIRCLE(j));
+    } else if (SP_IS_GENERICELLIPSE(i)) {
+        return (SP_IS_GENERICELLIPSE(j));
 
     } else if (SP_IS_STAR(i) || SP_IS_POLYGON(i)) {
         return (SP_IS_STAR(j) || SP_IS_POLYGON(j)) ;

=== modified file 'src/sp-ellipse.cpp'
--- src/sp-ellipse.cpp	2013-10-04 21:57:28 +0000
+++ src/sp-ellipse.cpp	2013-10-07 18:40:07 +0000
@@ -9,6 +9,7 @@
  *
  * Copyright (C) 1999-2002 Lauris Kaplinski
  * Copyright (C) 2000-2001 Ximian, Inc.
+ * Copyright (C) 2013 Tavmjong Bah
  *
  * Released under GNU GPL, read the file 'COPYING' for more information
  */
@@ -39,17 +40,23 @@
 namespace {
 SPObject *create_ellipse()
 {
-    return new SPEllipse();
+    SPGenericEllipse *ellipse = new SPGenericEllipse();
+    ellipse->type = SP_GENERIC_ELLIPSE_ELLIPSE;
+    return (SPObject*)ellipse;
 }
 
 SPObject *create_circle()
 {
-    return new SPCircle();
+    SPGenericEllipse *circle = new SPGenericEllipse();
+    circle->type = SP_GENERIC_ELLIPSE_CIRCLE;
+    return (SPObject*)circle;
 }
 
 SPObject *create_arc()
 {
-    return new SPArc();
+    SPGenericEllipse *arc = new SPGenericEllipse();
+    arc->type = SP_GENERIC_ELLIPSE_ARC;
+    return (SPObject*)arc;
 }
 
 bool ellipse_registered = SPFactory::instance().registerObject("svg:ellipse", create_ellipse);
@@ -76,16 +83,120 @@
 {
 }
 
+void SPGenericEllipse::setClosed(bool value) {
+    _closed = value;
+}
+
 bool SPGenericEllipse::closed() {
     return _closed;
 }
 
-void SPGenericEllipse::setClosed(bool value) {
-    _closed = value;
+void SPGenericEllipse::build(SPDocument *document, Inkscape::XML::Node *repr)
+{
+    // std::cout << "SPGenericEllipse::build: Entrance: " << this->type
+    //           << "  ("  << g_quark_to_string(repr->code()) << ")" << std::endl;
+
+    switch ( type ) {
+        case SP_GENERIC_ELLIPSE_ARC:
+            this->readAttr("sodipodi:cx");
+            this->readAttr("sodipodi:cy");
+            this->readAttr("sodipodi:rx");
+            this->readAttr("sodipodi:ry");
+            this->readAttr("sodipodi:start");
+            this->readAttr("sodipodi:end");
+            this->readAttr("sodipodi:open");
+            break;
+
+        case SP_GENERIC_ELLIPSE_CIRCLE:
+            this->readAttr("cx");
+            this->readAttr("cy");
+            this->readAttr("r");
+            break;
+
+        case SP_GENERIC_ELLIPSE_ELLIPSE:
+            this->readAttr("cx");
+            this->readAttr("cy");
+            this->readAttr("rx");
+            this->readAttr("ry");
+            break;
+
+        default:
+            std::cerr << "SPGenericEllipse::build() unknown defined type." << std::endl;
+    }
+
+    SPShape::build(document, repr);
+}
+
+void SPGenericEllipse::set(unsigned int key, gchar const *value)
+{
+    // There are multiple ways to set internal cx, cy, rx, and ry (via SVG attributes or Sodipodi
+    // attributes) thus we don't want to unset them if a read fails (e.g., when we explicitly clear
+    // an attribute by setting it to NULL).
+    SVGLength t;
+    switch (key) {
+    case SP_ATTR_CX:
+    case SP_ATTR_SODIPODI_CX:
+        if( t.read(value) ) cx = t;
+        this->requestDisplayUpdate(SP_OBJECT_MODIFIED_FLAG);
+        break;
+
+    case SP_ATTR_CY:
+    case SP_ATTR_SODIPODI_CY:
+        if( t.read(value) ) cy = t;
+        this->requestDisplayUpdate(SP_OBJECT_MODIFIED_FLAG);
+        break;
+
+    case SP_ATTR_RX:
+    case SP_ATTR_SODIPODI_RX:
+        if( t.read(value) && t.value > 0.0 ) this->rx = t;
+        this->requestDisplayUpdate(SP_OBJECT_MODIFIED_FLAG);
+        break;
+
+    case SP_ATTR_RY:
+    case SP_ATTR_SODIPODI_RY:
+        if( t.read(value) && t.value > 0.0 ) this->ry = t;
+        this->requestDisplayUpdate(SP_OBJECT_MODIFIED_FLAG);
+        break;
+
+    case SP_ATTR_R:
+        if( t.read(value) && t.value > 0.0 ) {
+            this->ry = this->rx = t;
+        }
+        this->requestDisplayUpdate(SP_OBJECT_MODIFIED_FLAG);
+        break;
+
+    case SP_ATTR_SODIPODI_START:
+        if (value) {
+            sp_svg_number_read_d(value, &this->start);
+        } else {
+            this->start = 0;
+        }
+        this->requestDisplayUpdate(SP_OBJECT_MODIFIED_FLAG);
+        break;
+
+    case SP_ATTR_SODIPODI_END:
+        if (value) {
+            sp_svg_number_read_d(value, &this->end);
+        } else {
+            this->end = 2 * M_PI;
+        }
+        this->requestDisplayUpdate(SP_OBJECT_MODIFIED_FLAG);
+        break;
+
+    case SP_ATTR_SODIPODI_OPEN:
+        this->_closed = (!value);
+        this->requestDisplayUpdate(SP_OBJECT_MODIFIED_FLAG);
+        break;
+
+    default:
+        SPShape::set(key, value);
+        break;
+    }
 }
 
 void SPGenericEllipse::update(SPCtx *ctx, guint flags)
 {
+    // std::cout << "\nSPGenericEllipse::update: Entrance" << std::endl;
     if (flags & (SP_OBJECT_MODIFIED_FLAG | SP_OBJECT_STYLE_MODIFIED_FLAG | SP_OBJECT_VIEWPORT_MODIFIED_FLAG)) {
         Geom::Rect const &viewbox = ((SPItemCtx const *) ctx)->viewport;
 
@@ -104,36 +215,183 @@
     }
 
     SPShape::update(ctx, flags);
-}
-
-void SPGenericEllipse::update_patheffect(bool write)
-{
-    this->set_shape();
-
-    if (write) {
-        Inkscape::XML::Node *repr = this->getRepr();
-
-        if (this->_curve != NULL) {
-            gchar *str = sp_svg_write_path(this->_curve->get_pathvector());
-            repr->setAttribute("d", str);
-            g_free(str);
-        } else {
-            repr->setAttribute("d", NULL);
-        }
-    }
-
-    this->requestDisplayUpdate(SP_OBJECT_MODIFIED_FLAG);
-}
-
-bool SPGenericEllipse::_isSlice() const
-{
-    Geom::AngleInterval a(this->start, this->end, true);
-
-    return !(Geom::are_near(a.extent(), 0) || Geom::are_near(a.extent(), SP_2PI));
-}
-
+    // std::cout << "SPGenericEllipse::update: Exit\n" << std::endl;
+}
+
+Inkscape::XML::Node *SPGenericEllipse::write(Inkscape::XML::Document *xml_doc, Inkscape::XML::Node *repr, guint flags)
+{
+    // std::cout << "\nSPGenericEllipse::write: Entrance"
+    //           << "  ("  << g_quark_to_string(repr->code()) << ")" << std::endl;
+
+    GenericEllipseType new_type = SP_GENERIC_ELLIPSE_UNDEFINED;
+    if (this->_isSlice() || hasPathEffect() ) {
+        new_type = SP_GENERIC_ELLIPSE_ARC;
+    } else if ( rx.computed == ry.computed ) {
+        new_type = SP_GENERIC_ELLIPSE_CIRCLE;
+    } else {
+        new_type = SP_GENERIC_ELLIPSE_ELLIPSE;
+    }
+    // std::cout << "  new_type: " << new_type << std::endl;
+
+    if (flags & SP_OBJECT_WRITE_EXT) {
+
+        if ((flags & SP_OBJECT_WRITE_BUILD) && !repr) {
+
+            switch ( new_type ) {
+
+                case SP_GENERIC_ELLIPSE_ARC:
+                    repr = xml_doc->createElement("svg:path");
+                    break;
+                case SP_GENERIC_ELLIPSE_CIRCLE:
+                    repr = xml_doc->createElement("svg:circle");
+                    break;
+                case SP_GENERIC_ELLIPSE_ELLIPSE:
+                    repr = xml_doc->createElement("svg:ellipse");
+                    break;
+                case SP_GENERIC_ELLIPSE_UNDEFINED:
+                default:
+                    std::cerr << "SPGenericEllipse::write(): unknown type." << std::endl;
+            }
+        }
+
+        if( type != new_type ) {
+            switch( new_type ) {
+                case SP_GENERIC_ELLIPSE_ARC:
+                    repr->setCodeUnsafe(g_quark_from_string("svg:path"));
+                    break;
+                case SP_GENERIC_ELLIPSE_CIRCLE:
+                    repr->setCodeUnsafe(g_quark_from_string("svg:circle"));
+                    break;
+                case SP_GENERIC_ELLIPSE_ELLIPSE:
+                    repr->setCodeUnsafe(g_quark_from_string("svg:ellipse"));
+                    break;
+                default:
+                    std::cerr << "SPGenericEllipse::write(): unknown type." << std::endl;
+            }
+            type = new_type;
+
+            // FIXME: The XML dialog won't update the element name. We need
+            // a notifyElementNameChanged callback added to the XML observers
+            // to trigger a refresh.
+        }
+
+        // std::cout << "  type: " << g_quark_to_string( repr->code() ) << std::endl;
+        // std::cout << "  cx: " << cx.computed
+        //           << "  cy: " << cy.computed
+        //           << "  rx: " << rx.computed
+        //           << "  ry: " << ry.computed << std::endl;
+
+        switch ( type ) {
+            case SP_GENERIC_ELLIPSE_UNDEFINED:
+            case SP_GENERIC_ELLIPSE_ARC:
+
+                repr->setAttribute("sodipodi:type", "arc");
+                sp_repr_set_svg_double(repr, "sodipodi:cx", this->cx.computed);
+                sp_repr_set_svg_double(repr, "sodipodi:cy", this->cy.computed);
+                sp_repr_set_svg_double(repr, "sodipodi:rx", this->rx.computed);
+                sp_repr_set_svg_double(repr, "sodipodi:ry", this->ry.computed);
+                repr->setAttribute("cx", NULL );
+                repr->setAttribute("cy", NULL );
+                repr->setAttribute("rx", NULL );
+                repr->setAttribute("ry", NULL );
+                repr->setAttribute("r", NULL );
+
+                // write start and end only if they are non-trivial; otherwise remove
+                if (this->_isSlice()) {
+                    sp_repr_set_svg_double(repr, "sodipodi:start", this->start);
+                    sp_repr_set_svg_double(repr, "sodipodi:end", this->end);
+
+                    repr->setAttribute("sodipodi:open", (!this->_closed) ? "true" : NULL);
+                } else {
+                    repr->setAttribute("sodipodi:end", NULL);
+                    repr->setAttribute("sodipodi:start", NULL);
+                    repr->setAttribute("sodipodi:open", NULL);
+                }
+
+                // write d=
+                this->set_elliptical_path_attribute(repr);
+                break;
+
+            case SP_GENERIC_ELLIPSE_CIRCLE:
+                sp_repr_set_svg_double(repr, "cx", this->cx.computed);
+                sp_repr_set_svg_double(repr, "cy", this->cy.computed);
+                sp_repr_set_svg_double(repr, "r",  this->rx.computed);
+                repr->setAttribute("rx", NULL );
+                repr->setAttribute("ry", NULL );
+                repr->setAttribute("sodipodi:cx", NULL );
+                repr->setAttribute("sodipodi:cy", NULL );
+                repr->setAttribute("sodipodi:rx", NULL );
+                repr->setAttribute("sodipodi:ry", NULL );
+                repr->setAttribute("sodipodi:end", NULL );
+                repr->setAttribute("sodipodi:start", NULL );
+                repr->setAttribute("sodipodi:open", NULL );
+                repr->setAttribute("sodipodi:type", NULL );
+                repr->setAttribute("d", NULL );
+                break;
+
+            case SP_GENERIC_ELLIPSE_ELLIPSE:
+                sp_repr_set_svg_double(repr, "cx", this->cx.computed);
+                sp_repr_set_svg_double(repr, "cy", this->cy.computed);
+                sp_repr_set_svg_double(repr, "rx", this->rx.computed);
+                sp_repr_set_svg_double(repr, "ry", this->ry.computed);
+                repr->setAttribute("r", NULL );
+                repr->setAttribute("sodipodi:cx", NULL );
+                repr->setAttribute("sodipodi:cy", NULL );
+                repr->setAttribute("sodipodi:rx", NULL );
+                repr->setAttribute("sodipodi:ry", NULL );
+                repr->setAttribute("sodipodi:end", NULL );
+                repr->setAttribute("sodipodi:start", NULL );
+                repr->setAttribute("sodipodi:open", NULL );
+                repr->setAttribute("sodipodi:type", NULL );
+                repr->setAttribute("d", NULL );
+                break;
+
+            default:
+                std::cerr << "SPGenericEllipse::write: unknown type." << std::endl;
+        }
+    }
+
+    this->set_shape(); // evaluate SPCurve
+
+    SPShape::write(xml_doc, repr, flags);
+
+    // std::cout << "SPGenericEllipse::write: Exit: " << g_quark_to_string(repr->code()) << "\n" << std::endl;
+    return repr;
+}
+
+const char *SPGenericEllipse::displayName()
+{
+
+    switch ( type ) {
+        case SP_GENERIC_ELLIPSE_UNDEFINED:
+        case SP_GENERIC_ELLIPSE_ARC:
+
+            if (this->_isSlice()) {
+                if (this->_closed) {
+                    return _("Segment");
+                } else {
+                    return _("Arc");
+                }
+            } else {
+                return _("Ellipse");
+            }
+
+        case SP_GENERIC_ELLIPSE_CIRCLE:
+            return _("Circle");
+
+        case SP_GENERIC_ELLIPSE_ELLIPSE:
+            return _("Ellipse");
+
+        default:
+            return "Unknown ellipse: ERROR";
+    }
+    return ("Shouldn't be here");
+}
+
+// Create path for rendering shape on screen
 void SPGenericEllipse::set_shape()
 {
+    // std::cout << "SPGenericEllipse::set_shape: Entrance" << std::endl;
     if (hasBrokenPathEffect()) {
         g_warning("The ellipse shape has unknown LPE on it! Convert to path to make it editable preserving the appearance; editing it as ellipse will remove the bad LPE");
 
@@ -147,7 +405,6 @@
 
         return;
     }
-
     if (Geom::are_near(this->rx.computed, 0) || Geom::are_near(this->ry.computed, 0)) {
         return;
     }
@@ -196,6 +453,10 @@
         curve->closepath();
     }
 
+    // gchar *str = sp_svg_write_path(curve->get_pathvector());
+    // std::cout << "  path: " << str << std::endl;
+    // g_free(str);
+
     // Stretching / moving the calculated shape to fit the actual dimensions.
     Geom::Affine aff = Geom::Scale(rx.computed, ry.computed) * Geom::Translate(cx.computed, cy.computed);
     curve->transform(aff);
@@ -217,54 +478,7 @@
     }
 
     curve->unref();
-}
-
-void SPGenericEllipse::snappoints(std::vector<Inkscape::SnapCandidatePoint> &p, Inkscape::SnapPreferences const *snapprefs)
-{
-    this->normalize();
-    Geom::Affine const i2dt = this->i2dt_affine();
-
-    // Snap to the 4 quadrant points of the ellipse, but only if the arc
-    // spans far enough to include them
-    if (snapprefs->isTargetSnappable(Inkscape::SNAPTARGET_ELLIPSE_QUADRANT_POINT)) {
-        for (double angle = 0; angle < SP_2PI; angle += M_PI_2) {
-            if (Geom::AngleInterval(this->start, this->end, true).contains(angle)) {
-                Geom::Point pt = this->getPointAtAngle(angle) * i2dt;
-                p.push_back(Inkscape::SnapCandidatePoint(pt, Inkscape::SNAPSOURCE_ELLIPSE_QUADRANT_POINT, Inkscape::SNAPTARGET_ELLIPSE_QUADRANT_POINT));
-            }
-        }
-    }
-
-    double cx = this->cx.computed;
-    double cy = this->cy.computed;
-
-    bool slice = this->_isSlice();
-
-    // Add the centre, if we have a closed slice or when explicitly asked for
-    if (snapprefs->isTargetSnappable(Inkscape::SNAPTARGET_NODE_CUSP) && slice && this->_closed) {
-        Geom::Point pt = Geom::Point(cx, cy) * i2dt;
-        p.push_back(Inkscape::SnapCandidatePoint(pt, Inkscape::SNAPSOURCE_NODE_CUSP, Inkscape::SNAPTARGET_NODE_CUSP));
-    }
-
-    if (snapprefs->isTargetSnappable(Inkscape::SNAPTARGET_OBJECT_MIDPOINT)) {
-        Geom::Point pt = Geom::Point(cx, cy) * i2dt;
-        p.push_back(Inkscape::SnapCandidatePoint(pt, Inkscape::SNAPSOURCE_OBJECT_MIDPOINT, Inkscape::SNAPTARGET_OBJECT_MIDPOINT));
-    }
-
-    // And if we have a slice, also snap to the endpoints
-    if (snapprefs->isTargetSnappable(Inkscape::SNAPTARGET_NODE_CUSP) && slice) {
-        // Add the start point, if it's not coincident with a quadrant point
-        if (!Geom::are_near(std::fmod(this->start, M_PI_2), 0)) {
-            Geom::Point pt = this->getPointAtAngle(this->start) * i2dt;
-            p.push_back(Inkscape::SnapCandidatePoint(pt, Inkscape::SNAPSOURCE_NODE_CUSP, Inkscape::SNAPTARGET_NODE_CUSP));
-        }
-
-        // Add the end point, if it's not coincident with a quadrant point
-        if (!Geom::are_near(std::fmod(this->end, M_PI_2), 0)) {
-            Geom::Point pt = this->getPointAtAngle(this->end) * i2dt;
-            p.push_back(Inkscape::SnapCandidatePoint(pt, Inkscape::SNAPSOURCE_NODE_CUSP, Inkscape::SNAPTARGET_NODE_CUSP));
-        }
-    }
+    // std::cout << "SPGenericEllipse::set_shape: Exit" << std::endl;
 }
 
 Geom::Affine SPGenericEllipse::set_transform(Geom::Affine const &xform)
@@ -323,6 +537,83 @@
     return ret;
 }
 
+void SPGenericEllipse::snappoints(std::vector<Inkscape::SnapCandidatePoint> &p, Inkscape::SnapPreferences const *snapprefs)
+{
+    this->normalize();
+    Geom::Affine const i2dt = this->i2dt_affine();
+
+    // Snap to the 4 quadrant points of the ellipse, but only if the arc
+    // spans far enough to include them
+    if (snapprefs->isTargetSnappable(Inkscape::SNAPTARGET_ELLIPSE_QUADRANT_POINT)) {
+        for (double angle = 0; angle < SP_2PI; angle += M_PI_2) {
+            if (Geom::AngleInterval(this->start, this->end, true).contains(angle)) {
+                Geom::Point pt = this->getPointAtAngle(angle) * i2dt;
+                p.push_back(Inkscape::SnapCandidatePoint(pt, Inkscape::SNAPSOURCE_ELLIPSE_QUADRANT_POINT, Inkscape::SNAPTARGET_ELLIPSE_QUADRANT_POINT));
+            }
+        }
+    }
+
+    double cx = this->cx.computed;
+    double cy = this->cy.computed;
+    
+
+    bool slice = this->_isSlice();
+
+    // Add the centre, if we have a closed slice or when explicitly asked for
+    if (snapprefs->isTargetSnappable(Inkscape::SNAPTARGET_NODE_CUSP) && slice && this->_closed) {
+        Geom::Point pt = Geom::Point(cx, cy) * i2dt;
+        p.push_back(Inkscape::SnapCandidatePoint(pt, Inkscape::SNAPSOURCE_NODE_CUSP, Inkscape::SNAPTARGET_NODE_CUSP));
+    }
+
+    if (snapprefs->isTargetSnappable(Inkscape::SNAPTARGET_OBJECT_MIDPOINT)) {
+        Geom::Point pt = Geom::Point(cx, cy) * i2dt;
+        p.push_back(Inkscape::SnapCandidatePoint(pt, Inkscape::SNAPSOURCE_OBJECT_MIDPOINT, Inkscape::SNAPTARGET_OBJECT_MIDPOINT));
+    }
+
+    // And if we have a slice, also snap to the endpoints
+    if (snapprefs->isTargetSnappable(Inkscape::SNAPTARGET_NODE_CUSP) && slice) {
+        // Add the start point, if it's not coincident with a quadrant point
+        if (!Geom::are_near(std::fmod(this->start, M_PI_2), 0)) {
+            Geom::Point pt = this->getPointAtAngle(this->start) * i2dt;
+            p.push_back(Inkscape::SnapCandidatePoint(pt, Inkscape::SNAPSOURCE_NODE_CUSP, Inkscape::SNAPTARGET_NODE_CUSP));
+        }
+
+        // Add the end point, if it's not coincident with a quadrant point
+        if (!Geom::are_near(std::fmod(this->end, M_PI_2), 0)) {
+            Geom::Point pt = this->getPointAtAngle(this->end) * i2dt;
+            p.push_back(Inkscape::SnapCandidatePoint(pt, Inkscape::SNAPSOURCE_NODE_CUSP, Inkscape::SNAPTARGET_NODE_CUSP));
+        }
+    }
+}
+
+void SPGenericEllipse::modified(guint flags)
+{
+    if (flags & (SP_OBJECT_MODIFIED_FLAG | SP_OBJECT_STYLE_MODIFIED_FLAG | SP_OBJECT_VIEWPORT_MODIFIED_FLAG)) {
+        this->set_shape();
+    }
+
+    SPShape::modified(flags);
+}
+
+void SPGenericEllipse::update_patheffect(bool write)
+{
+    this->set_shape();
+
+    if (write) {
+        Inkscape::XML::Node *repr = this->getRepr();
+
+        if (this->_curve != NULL) {
+            gchar *str = sp_svg_write_path(this->_curve->get_pathvector());
+            repr->setAttribute("d", str);
+            g_free(str);
+        } else {
+            repr->setAttribute("d", NULL);
+        }
+    }
+
+    this->requestDisplayUpdate(SP_OBJECT_MODIFIED_FLAG);
+}
+
 void SPGenericEllipse::normalize()
 {
     Geom::AngleInterval a(this->start, this->end, true);
@@ -331,207 +622,20 @@
     this->end = a.finalAngle().radians0();
 }
 
-Inkscape::XML::Node *SPGenericEllipse::write(Inkscape::XML::Document *xml_doc, Inkscape::XML::Node *repr, guint flags)
-{
-    if (flags & SP_OBJECT_WRITE_EXT) {
-        if ((flags & SP_OBJECT_WRITE_BUILD) && !repr) {
-            repr = xml_doc->createElement("svg:path");
-        }
-
-        sp_repr_set_svg_double(repr, "sodipodi:cx", this->cx.computed);
-        sp_repr_set_svg_double(repr, "sodipodi:cy", this->cy.computed);
-        sp_repr_set_svg_double(repr, "sodipodi:rx", this->rx.computed);
-        sp_repr_set_svg_double(repr, "sodipodi:ry", this->ry.computed);
-
-        if (SP_IS_ARC(this)) {
-            SP_ARC(this)->sp_arc_set_elliptical_path_attribute(this->getRepr());
-        }
-    }
-
-    this->set_shape(); // evaluate SPCurve
-
-    SPShape::write(xml_doc, repr, flags);
-
-    return repr;
-}
-
-/* SVG <ellipse> element */
-SPEllipse::SPEllipse() : SPGenericEllipse()
-{
-}
-
-SPEllipse::~SPEllipse()
-{
-}
-
-void SPEllipse::build(SPDocument *document, Inkscape::XML::Node *repr)
-{
-    SPGenericEllipse::build(document, repr);
-
-    this->readAttr("cx");
-    this->readAttr("cy");
-    this->readAttr("rx");
-    this->readAttr("ry");
-}
-
-
-Inkscape::XML::Node *SPEllipse::write(Inkscape::XML::Document *xml_doc, Inkscape::XML::Node *repr, guint flags)
-{
-    if ((flags & SP_OBJECT_WRITE_BUILD) && !repr) {
-        repr = xml_doc->createElement("svg:ellipse");
-    }
-
-    sp_repr_set_svg_double(repr, "cx", this->cx.computed);
-    sp_repr_set_svg_double(repr, "cy", this->cy.computed);
-    sp_repr_set_svg_double(repr, "rx", this->rx.computed);
-    sp_repr_set_svg_double(repr, "ry", this->ry.computed);
-
-    SPGenericEllipse::write(xml_doc, repr, flags);
-
-    return repr;
-}
-
-
-void SPEllipse::set(unsigned int key, gchar const *value)
-{
-    switch (key) {
-    case SP_ATTR_CX:
-        this->cx.readOrUnset(value);
-        this->requestDisplayUpdate(SP_OBJECT_MODIFIED_FLAG);
-        break;
-
-    case SP_ATTR_CY:
-        this->cy.readOrUnset(value);
-        this->requestDisplayUpdate(SP_OBJECT_MODIFIED_FLAG);
-        break;
-
-    case SP_ATTR_RX:
-        if (!this->rx.read(value) || (this->rx.value <= 0.0)) {
-            this->rx.unset();
-        }
-
-        this->requestDisplayUpdate(SP_OBJECT_MODIFIED_FLAG);
-        break;
-
-    case SP_ATTR_RY:
-        if (!this->ry.read(value) || (this->ry.value <= 0.0)) {
-            this->ry.unset();
-        }
-
-        this->requestDisplayUpdate(SP_OBJECT_MODIFIED_FLAG);
-        break;
-
-    default:
-        SPGenericEllipse::set(key, value);
-        break;
-    }
-}
-
-const char *SPEllipse::displayName()
-{
-    return _("Ellipse");
-}
-
-
-/* SVG <circle> element */
-SPCircle::SPCircle() : SPGenericEllipse()
-{
-}
-
-SPCircle::~SPCircle()
-{
-}
-
-void SPCircle::build(SPDocument *document, Inkscape::XML::Node *repr)
-{
-    SPGenericEllipse::build(document, repr);
-
-    this->readAttr("cx");
-    this->readAttr("cy");
-    this->readAttr("r");
-}
-
-
-Inkscape::XML::Node *SPCircle::write(Inkscape::XML::Document *xml_doc, Inkscape::XML::Node *repr, guint flags)
-{
-    if ((flags & SP_OBJECT_WRITE_BUILD) && !repr) {
-        repr = xml_doc->createElement("svg:circle");
-    }
-
-    sp_repr_set_svg_double(repr, "cx", this->cx.computed);
-    sp_repr_set_svg_double(repr, "cy", this->cy.computed);
-    sp_repr_set_svg_double(repr, "r", this->rx.computed);
-
-    SPGenericEllipse::write(xml_doc, repr, flags);
-
-    return repr;
-}
-
-void SPCircle::set(unsigned int key, gchar const *value)
-{
-    switch (key) {
-    case SP_ATTR_CX:
-        this->cx.readOrUnset(value);
-        this->requestDisplayUpdate(SP_OBJECT_MODIFIED_FLAG);
-        break;
-
-    case SP_ATTR_CY:
-        this->cy.readOrUnset(value);
-        this->requestDisplayUpdate(SP_OBJECT_MODIFIED_FLAG);
-        break;
-
-    case SP_ATTR_R:
-        if (!this->rx.read(value) || this->rx.value <= 0.0) {
-            this->rx.unset();
-        }
-
-        this->ry = this->rx;
-        this->requestDisplayUpdate(SP_OBJECT_MODIFIED_FLAG);
-        break;
-
-    default:
-        SPGenericEllipse::set(key, value);
-        break;
-    }
-}
-
-const char *SPCircle::displayName()
-{
-    return _("Circle");
-}
-
-/* <path sodipodi:type="arc"> element */
-SPArc::SPArc() : SPGenericEllipse()
-{
-}
-
-SPArc::~SPArc()
-{
-}
-
-void SPArc::build(SPDocument *document, Inkscape::XML::Node *repr)
-{
-    SPGenericEllipse::build(document, repr);
-
-    this->readAttr("sodipodi:cx");
-    this->readAttr("sodipodi:cy");
-    this->readAttr("sodipodi:rx");
-    this->readAttr("sodipodi:ry");
-
-    this->readAttr("sodipodi:start");
-    this->readAttr("sodipodi:end");
-    this->readAttr("sodipodi:open");
+Geom::Point SPGenericEllipse::getPointAtAngle(double arg) const
+{
+    return Geom::Point::polar(arg) * Geom::Scale(rx.computed, ry.computed) * Geom::Translate(cx.computed, cy.computed);
 }
 
 /*
- * sp_arc_set_elliptical_path_attribute:
+ * set_elliptical_path_attribute:
  *
  * Convert center to endpoint parameterization and set it to repr.
  *
  * See SVG 1.0 Specification W3C Recommendation
  * ``F.6 Ellptical arc implementation notes'' for more detail.
  */
-bool SPArc::sp_arc_set_elliptical_path_attribute(Inkscape::XML::Node *repr)
+bool SPGenericEllipse::set_elliptical_path_attribute(Inkscape::XML::Node *repr)
 {
     Inkscape::SVG::PathString str;
 
@@ -566,124 +670,7 @@
     return true;
 }
 
-Inkscape::XML::Node *SPArc::write(Inkscape::XML::Document *xml_doc, Inkscape::XML::Node *repr, guint flags)
-{
-    if ((flags & SP_OBJECT_WRITE_BUILD) && !repr) {
-        repr = xml_doc->createElement("svg:path");
-    }
-
-    if (flags & SP_OBJECT_WRITE_EXT) {
-        repr->setAttribute("sodipodi:type", "arc");
-
-        sp_repr_set_svg_double(repr, "sodipodi:cx", this->cx.computed);
-        sp_repr_set_svg_double(repr, "sodipodi:cy", this->cy.computed);
-        sp_repr_set_svg_double(repr, "sodipodi:rx", this->rx.computed);
-        sp_repr_set_svg_double(repr, "sodipodi:ry", this->ry.computed);
-
-        // write start and end only if they are non-trivial; otherwise remove
-        if (this->_isSlice()) {
-            sp_repr_set_svg_double(repr, "sodipodi:start", this->start);
-            sp_repr_set_svg_double(repr, "sodipodi:end", this->end);
-
-            repr->setAttribute("sodipodi:open", (!this->_closed) ? "true" : NULL);
-        } else {
-            repr->setAttribute("sodipodi:end", NULL);
-            repr->setAttribute("sodipodi:start", NULL);
-            repr->setAttribute("sodipodi:open", NULL);
-        }
-    }
-
-    // write d=
-    this->sp_arc_set_elliptical_path_attribute(repr);
-
-    SPGenericEllipse::write(xml_doc, repr, flags);
-
-    return repr;
-}
-
-void SPArc::set(unsigned int key, gchar const *value)
-{
-    switch (key) {
-    case SP_ATTR_SODIPODI_CX:
-        this->cx.readOrUnset(value);
-        this->requestDisplayUpdate(SP_OBJECT_MODIFIED_FLAG);
-        break;
-
-    case SP_ATTR_SODIPODI_CY:
-        this->cy.readOrUnset(value);
-        this->requestDisplayUpdate(SP_OBJECT_MODIFIED_FLAG);
-        break;
-
-    case SP_ATTR_SODIPODI_RX:
-        if (!this->rx.read(value) || this->rx.computed <= 0.0) {
-            this->rx.unset();
-        }
-
-        this->requestDisplayUpdate(SP_OBJECT_MODIFIED_FLAG);
-        break;
-
-    case SP_ATTR_SODIPODI_RY:
-        if (!this->ry.read(value) || this->ry.computed <= 0.0) {
-            this->ry.unset();
-        }
-
-        this->requestDisplayUpdate(SP_OBJECT_MODIFIED_FLAG);
-        break;
-
-    case SP_ATTR_SODIPODI_START:
-        if (value) {
-            sp_svg_number_read_d(value, &this->start);
-        } else {
-            this->start = 0;
-        }
-
-        this->requestDisplayUpdate(SP_OBJECT_MODIFIED_FLAG);
-        break;
-
-    case SP_ATTR_SODIPODI_END:
-        if (value) {
-            sp_svg_number_read_d(value, &this->end);
-        } else {
-            this->end = 2 * M_PI;
-        }
-
-        this->requestDisplayUpdate(SP_OBJECT_MODIFIED_FLAG);
-        break;
-
-    case SP_ATTR_SODIPODI_OPEN:
-        this->_closed = (!value);
-        this->requestDisplayUpdate(SP_OBJECT_MODIFIED_FLAG);
-        break;
-
-    default:
-        SPGenericEllipse::set(key, value);
-        break;
-    }
-}
-
-void SPArc::modified(guint flags)
-{
-    if (flags & (SP_OBJECT_MODIFIED_FLAG | SP_OBJECT_STYLE_MODIFIED_FLAG | SP_OBJECT_VIEWPORT_MODIFIED_FLAG)) {
-        this->set_shape();
-    }
-
-    SPGenericEllipse::modified(flags);
-}
-
-const char *SPArc::displayName()
-{
-    if (this->_isSlice()) {
-        if (this->_closed) {
-            return _("Segment");
-        } else {
-            return _("Arc");
-        }
-    } else {
-        return _("Ellipse");
-    }
-}
-
-void SPArc::sp_arc_position_set(gdouble x, gdouble y, gdouble rx, gdouble ry)
+void SPGenericEllipse::position_set(gdouble x, gdouble y, gdouble rx, gdouble ry)
 {
     this->cx.computed = x;
     this->cy.computed = y;
@@ -706,9 +693,11 @@
     this->requestDisplayUpdate(SP_OBJECT_MODIFIED_FLAG);
 }
 
-Geom::Point SPGenericEllipse::getPointAtAngle(double arg) const
+bool SPGenericEllipse::_isSlice() const
 {
-    return Geom::Point::polar(arg) * Geom::Scale(rx.computed, ry.computed) * Geom::Translate(cx.computed, cy.computed);
+    Geom::AngleInterval a(this->start, this->end, true);
+
+    return !(Geom::are_near(a.extent(), 0) || Geom::are_near(a.extent(), SP_2PI));
 }
 
 /*

=== modified file 'src/sp-ellipse.h'
--- src/sp-ellipse.h	2013-09-29 22:17:20 +0000
+++ src/sp-ellipse.h	2013-10-07 18:20:33 +0000
@@ -7,9 +7,11 @@
  * Authors:
  *   Lauris Kaplinski <lauris@...39...>
  *   Mitsuru Oka
+ *   Tavmjong Bah
  *
  * Copyright (C) 1999-2002 Lauris Kaplinski
  * Copyright (C) 2000-2001 Ximian, Inc.
+ * Copyright (C) 2013 Tavmjong Bah
  *
  * Released under GNU GPL, read the file 'COPYING' for more information
  */
@@ -21,11 +23,20 @@
 #define SP_GENERICELLIPSE(obj) (dynamic_cast<SPGenericEllipse*>((SPObject*)obj))
 #define SP_IS_GENERICELLIPSE(obj) (dynamic_cast<const SPGenericEllipse*>((SPObject*)obj) != NULL)
 
+enum GenericEllipseType {
+    SP_GENERIC_ELLIPSE_UNDEFINED,
+    SP_GENERIC_ELLIPSE_ARC,
+    SP_GENERIC_ELLIPSE_CIRCLE,
+    SP_GENERIC_ELLIPSE_ELLIPSE
+};
+
 class SPGenericEllipse : public SPShape {
 public:
     SPGenericEllipse();
     virtual ~SPGenericEllipse();
 
+    // Regardless of type, the ellipse/circle/arc is stored
+    // internally with these variables. (Circle radius is rx).
     SVGLength cx;
     SVGLength cy;
     SVGLength rx;
@@ -38,14 +49,23 @@
     void setClosed(bool value);
 
     double start, end;
-
+    GenericEllipseType type;
+
+    virtual void build(SPDocument *document, Inkscape::XML::Node *repr);
+
+    virtual void set(unsigned int key, gchar const *value);
     virtual void update(SPCtx *ctx, unsigned int flags);
+
     virtual Inkscape::XML::Node *write(Inkscape::XML::Document *xml_doc, Inkscape::XML::Node *repr, guint flags);
+    virtual const char *displayName();
 
-    virtual void snappoints(std::vector<Inkscape::SnapCandidatePoint> &p, Inkscape::SnapPreferences const *snapprefs);
     virtual void set_shape();
     virtual Geom::Affine set_transform(Geom::Affine const &xform);
 
+    virtual void snappoints(std::vector<Inkscape::SnapCandidatePoint> &p, Inkscape::SnapPreferences const *snapprefs);
+
+    virtual void modified(unsigned int flags);
+
     virtual void update_patheffect(bool write);
 
     /**
@@ -55,6 +75,9 @@
 
     Geom::Point getPointAtAngle(double arg) const;
 
+    bool set_elliptical_path_attribute(Inkscape::XML::Node *repr);
+    void position_set(gdouble x, gdouble y, gdouble rx, gdouble ry);
+
 protected:
     /**
      * @brief Determines whether the shape is a part of an ellipse.
@@ -64,62 +87,6 @@
     bool _closed;
 };
 
-
-/* SVG <ellipse> element */
-#define SP_ELLIPSE(obj) (dynamic_cast<SPEllipse*>((SPObject*)obj))
-#define SP_IS_ELLIPSE(obj) (dynamic_cast<const SPEllipse*>((SPObject*)obj) != NULL)
-
-class SPEllipse : public SPGenericEllipse {
-public:
-    SPEllipse();
-    virtual ~SPEllipse();
-
-    virtual void build(SPDocument *document, Inkscape::XML::Node *repr);
-    virtual Inkscape::XML::Node *write(Inkscape::XML::Document *xml_doc, Inkscape::XML::Node *repr, guint flags);
-    virtual void set(unsigned int key, gchar const *value);
-    virtual const char *displayName();
-};
-
-
-/* SVG <circle> element */
-#define SP_CIRCLE(obj) (dynamic_cast<SPCircle*>((SPObject*)obj))
-#define SP_IS_CIRCLE(obj) (dynamic_cast<const SPCircle*>((SPObject*)obj) != NULL)
-
-class SPCircle : public SPGenericEllipse {
-public:
-    SPCircle();
-    virtual ~SPCircle();
-
-    virtual void build(SPDocument *document, Inkscape::XML::Node *repr);
-    virtual Inkscape::XML::Node *write(Inkscape::XML::Document *xml_doc, Inkscape::XML::Node *repr, guint flags);
-    virtual void set(unsigned int key, gchar const *value);
-    virtual const char *displayName();
-};
-
-
-/* <path sodipodi:type="arc"> element */
-#define SP_ARC(obj) (dynamic_cast<SPArc*>((SPObject*)obj))
-#define SP_IS_ARC(obj) (dynamic_cast<const SPArc*>((SPObject*)obj) != NULL)
-
-class SPArc : public SPGenericEllipse {
-public:
-    SPArc();
-    virtual ~SPArc();
-
-    virtual void build(SPDocument *document, Inkscape::XML::Node *repr);
-    virtual Inkscape::XML::Node *write(Inkscape::XML::Document *xml_doc, Inkscape::XML::Node *repr, guint flags);
-    virtual void set(unsigned int key, gchar const *value);
-    virtual const char *displayName();
-    virtual void modified(unsigned int flags);
-
-    void sp_arc_position_set(gdouble x, gdouble y, gdouble rx, gdouble ry);
-
-private:
-    bool sp_arc_set_elliptical_path_attribute(Inkscape::XML::Node *repr);
-
-    friend class SPGenericEllipse;
-};
-
 #endif
 
 /*

=== modified file 'src/sp-lpe-item.cpp'
--- src/sp-lpe-item.cpp	2013-10-04 21:57:28 +0000
+++ src/sp-lpe-item.cpp	2013-10-07 19:03:29 +0000
@@ -35,6 +35,7 @@
 #include "inkscape.h"
 #include "desktop.h"
 #include "shape-editor.h"
+#include "sp-ellipse.h"
 
 #include <algorithm>
 
@@ -387,6 +388,10 @@
 
         this->getRepr()->setAttribute("inkscape:path-effect", hrefs.c_str());
 
+        // Make sure that ellipse is stored as <svg:path>
+        if( SP_IS_GENERICELLIPSE(this)) {
+            SP_GENERICELLIPSE(this)->write( this->getRepr()->document(), this->getRepr(), SP_OBJECT_WRITE_EXT );
+        }
         // make sure there is an original-d for paths!!!
         sp_lpe_item_create_original_path_recursive(this);
 
@@ -436,17 +441,28 @@
         this->getRepr()->setAttribute("inkscape:path-effect", r.c_str());
     } else {
         this->getRepr()->setAttribute("inkscape:path-effect", NULL);
+        // Make sure that ellipse is stored as <svg:circle> or <svg:ellipse> if possible.
+        if( SP_IS_GENERICELLIPSE(this)) {
+            SP_GENERICELLIPSE(this)->write( this->getRepr()->document(), this->getRepr(), SP_OBJECT_WRITE_EXT );
+        }
     }
 
     if (!keep_paths) {
         sp_lpe_item_cleanup_original_path_recursive(this);
     }
+
+
 }
 
 void SPLPEItem::removeAllPathEffects(bool keep_paths)
 {
     this->getRepr()->setAttribute("inkscape:path-effect", NULL);
 
+    // Make sure that ellipse is stored as <svg:circle> or <svg:ellipse> if possible.
+    if( SP_IS_GENERICELLIPSE(this)) {
+        SP_GENERICELLIPSE(this)->write( this->getRepr()->document(), this->getRepr(), SP_OBJECT_WRITE_EXT );
+    }
+
     if (!keep_paths) {
         sp_lpe_item_cleanup_original_path_recursive(this);
     }

=== modified file 'src/sp-mesh-array.cpp'
--- src/sp-mesh-array.cpp	2013-03-25 01:41:57 +0000
+++ src/sp-mesh-array.cpp	2013-10-04 14:54:25 +0000
@@ -1058,9 +1058,9 @@
             end   = start + 2.0 * M_PI;
         }
 
-        if ( SP_IS_ARC( item ) ) {
+        if ( SP_IS_GENERICELLIPSE( item ) ) {
             // For arcs use set start/stop
-            SPArc* arc = SP_ARC( item );
+            SPGenericEllipse* arc = SP_GENERICELLIPSE( item );
             center[Geom::X] = arc->cx.computed;
             center[Geom::Y] = arc->cy.computed;
             rx = arc->rx.computed;
@@ -1130,11 +1130,11 @@
 
         // Normal grid meshes
 
-        if( SP_IS_ARC( item ) ) {
+        if( SP_IS_GENERICELLIPSE( item ) ) {
 
             // std::cout << "We've got ourselves an arc!" << std::endl;
 
-            SPArc* arc = SP_ARC( item );
+            SPGenericEllipse* arc = SP_GENERICELLIPSE( item );
             center[Geom::X] = arc->cx.computed;
             center[Geom::Y] = arc->cy.computed;
             gdouble rx = arc->rx.computed;

=== modified file 'src/ui/dialog/find.cpp'
--- src/ui/dialog/find.cpp	2013-03-15 12:24:39 +0000
+++ src/ui/dialog/find.cpp	2013-10-04 14:57:37 +0000
@@ -664,7 +664,7 @@
     if ( SP_IS_RECT(item)) {
         return ( all ||check_rects.get_active());
 
-    } else if (SP_IS_GENERICELLIPSE(item) || SP_IS_ELLIPSE(item) || SP_IS_ARC(item) || SP_IS_CIRCLE(item)) {
+    } else if (SP_IS_GENERICELLIPSE(item)) {
         return ( all ||  check_ellipses.get_active());
 
     } else if (SP_IS_STAR(item) || SP_IS_POLYGON(item)) {

=== modified file 'src/widgets/arc-toolbar.cpp'
--- src/widgets/arc-toolbar.cpp	2013-09-26 23:45:12 +0000
+++ src/widgets/arc-toolbar.cpp	2013-10-05 11:04:39 +0000
@@ -112,10 +112,9 @@
     {
         SPItem *item = SP_ITEM(items->data);
 
-        if (SP_IS_ARC(item) && SP_IS_GENERICELLIPSE(item)) {
+        if (SP_IS_GENERICELLIPSE(item)) {
 
             SPGenericEllipse *ge = SP_GENERICELLIPSE(item);
-            SPArc *arc = SP_ARC(item);
 
             if (!strcmp(value_name, "start")) {
                 ge->start = (gtk_adjustment_get_value(adj) * M_PI)/ 180;
@@ -124,8 +123,8 @@
             }
 
             ge->normalize();
-            (SP_OBJECT(arc))->updateRepr();
-            (SP_OBJECT(arc))->requestDisplayUpdate(SP_OBJECT_MODIFIED_FLAG);
+            (SP_OBJECT(ge))->updateRepr();
+            (SP_OBJECT(ge))->requestDisplayUpdate(SP_OBJECT_MODIFIED_FLAG);
 
             modmade = true;
         }
@@ -181,7 +180,7 @@
              items = items->next)
         {
             SPItem *item = reinterpret_cast<SPItem*>(items->data);
-            if (SP_IS_ARC(item)) {
+            if (SP_IS_GENERICELLIPSE(item)) {
                 Inkscape::XML::Node *repr = item->getRepr();
                 repr->setAttribute("sodipodi:open", "true");
                 item->updateRepr();
@@ -194,7 +193,7 @@
              items = items->next)
         {
             SPItem *item = reinterpret_cast<SPItem *>(items->data);
-            if (SP_IS_ARC(item)) {
+            if (SP_IS_GENERICELLIPSE(item)) {
                 Inkscape::XML::Node *repr = item->getRepr();
                 repr->setAttribute("sodipodi:open", NULL);
                 item->updateRepr();
@@ -286,7 +285,7 @@
          items = items->next)
     {
         SPItem *item = reinterpret_cast<SPItem *>(items->data);
-        if (SP_IS_ARC(item)) {
+        if (SP_IS_GENERICELLIPSE(item)) {
             n_selected++;
             repr = item->getRepr();
         }

