X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=src%2Fsp-polygon.cpp;h=a2b1c59724572f0ee8ba17e6e8b6664f3d22bae2;hb=ef9ea67d077bf2cbec9eaa47e057e7ac6559e34c;hp=8c853bcd6a4c2d02b838a7ef5b6f80d89948f3c5;hpb=c87d0307348fcfdc65b6b4ab6999a3cb0de2431f;p=inkscape.git diff --git a/src/sp-polygon.cpp b/src/sp-polygon.cpp index 8c853bcd6..a2b1c5972 100644 --- a/src/sp-polygon.cpp +++ b/src/sp-polygon.cpp @@ -21,6 +21,7 @@ #include "libnr/n-art-bpath.h" #include "svg/stringstream.h" #include "xml/repr.h" +#include "document.h" static void sp_polygon_class_init(SPPolygonClass *pc); static void sp_polygon_init(SPPolygon *polygon); @@ -120,7 +121,8 @@ static Inkscape::XML::Node *sp_polygon_write(SPObject *object, Inkscape::XML::No sp_shape_set_shape(shape); if ((flags & SP_OBJECT_WRITE_BUILD) && !repr) { - repr = sp_repr_new("svg:polygon"); + Inkscape::XML::Document *xml_doc = sp_document_repr_doc(SP_OBJECT_DOCUMENT(object)); + repr = xml_doc->createElement("svg:polygon"); } /* We can safely write points here, because all subclasses require it too (Lauris) */ @@ -137,7 +139,7 @@ static Inkscape::XML::Node *sp_polygon_write(SPObject *object, Inkscape::XML::No } -static bool polygon_get_value(gchar const **p, gdouble *v) +static gboolean polygon_get_value(gchar const **p, gdouble *v) { while (**p != '\0' && (**p == ',' || **p == '\x20' || **p == '\x9' || **p == '\xD' || **p == '\xA')) { (*p)++; @@ -170,7 +172,7 @@ static void sp_polygon_set(SPObject *object, unsigned int key, const gchar *valu break; } SPCurve *curve = sp_curve_new(); - bool hascpt = FALSE; + gboolean hascpt = FALSE; gchar const *cptr = value; bool has_error = false;