diff --git a/src/sp-ellipse.cpp b/src/sp-ellipse.cpp
index 2847d23e9d342a8ca8f14230d2d82873856810e0..769fa54fd62ed41b84ac16d06b6b9251eebe0041 100644 (file)
--- a/src/sp-ellipse.cpp
+++ b/src/sp-ellipse.cpp
#include "display/curve.h"
#include <glibmm/i18n.h>
#include <2geom/transforms.h>
+#include <2geom/pathvector.h>
#include "document.h"
#include "sp-ellipse.h"
/* Can't we use arcto in this method? */
static void sp_genericellipse_set_shape(SPShape *shape)
{
+ if (sp_lpe_item_has_broken_path_effect(SP_LPE_ITEM(shape))) {
+ 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");
+ if (SP_OBJECT_REPR(shape)->attribute("d")) {
+ // unconditionally read the curve from d, if any, to preserve appearance
+ Geom::PathVector pv = sp_svg_read_pathv(SP_OBJECT_REPR(shape)->attribute("d"));
+ SPCurve *cold = new SPCurve(pv);
+ sp_shape_set_curve_insync (shape, cold, TRUE);
+ cold->unref();
+ }
+ return;
+ }
+
double rx, ry, s, e;
double x0, y0, x1, y1, x2, y2, x3, y3;
double len;
@@ -366,7 +379,7 @@ static Inkscape::XML::Node *sp_genericellipse_write(SPObject *object, Inkscape::
static void sp_ellipse_class_init(SPEllipseClass *klass);
static void sp_ellipse_init(SPEllipse *ellipse);
-static void sp_ellipse_build(SPObject *object, Document *document, Inkscape::XML::Node *repr);
+static void sp_ellipse_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr);
static Inkscape::XML::Node *sp_ellipse_write(SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags);
static void sp_ellipse_set(SPObject *object, unsigned int key, gchar const *value);
static gchar *sp_ellipse_description(SPItem *item);
}
static void
-sp_ellipse_build(SPObject *object, Document *document, Inkscape::XML::Node *repr)
+sp_ellipse_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr)
{
if (((SPObjectClass *) ellipse_parent_class)->build)
(* ((SPObjectClass *) ellipse_parent_class)->build) (object, document, repr);
@@ -513,7 +526,7 @@ sp_ellipse_position_set(SPEllipse *ellipse, gdouble x, gdouble y, gdouble rx, gd
static void sp_circle_class_init(SPCircleClass *klass);
static void sp_circle_init(SPCircle *circle);
-static void sp_circle_build(SPObject *object, Document *document, Inkscape::XML::Node *repr);
+static void sp_circle_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr);
static Inkscape::XML::Node *sp_circle_write(SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags);
static void sp_circle_set(SPObject *object, unsigned int key, gchar const *value);
static gchar *sp_circle_description(SPItem *item);
}
static void
-sp_circle_build(SPObject *object, Document *document, Inkscape::XML::Node *repr)
+sp_circle_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr)
{
if (((SPObjectClass *) circle_parent_class)->build)
(* ((SPObjectClass *) circle_parent_class)->build)(object, document, repr);
static void sp_arc_class_init(SPArcClass *klass);
static void sp_arc_init(SPArc *arc);
-static void sp_arc_build(SPObject *object, Document *document, Inkscape::XML::Node *repr);
+static void sp_arc_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr);
static Inkscape::XML::Node *sp_arc_write(SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags);
static void sp_arc_set(SPObject *object, unsigned int key, gchar const *value);
static void sp_arc_modified(SPObject *object, guint flags);
}
static void
-sp_arc_build(SPObject *object, Document *document, Inkscape::XML::Node *repr)
+sp_arc_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr)
{
if (((SPObjectClass *) arc_parent_class)->build)
(* ((SPObjectClass *) arc_parent_class)->build) (object, document, repr);