X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=src%2Fsp-star.cpp;h=96bc9180a9f9ff197411ee0b3f939470ae48ea97;hb=96c274534e3b260291098b7da1875695fe5b30a7;hp=4c5f9623b0f525e917c33375a0a146c076f30fd6;hpb=ff10ef00a3847886fff81e690d2f329f5eba2253;p=inkscape.git diff --git a/src/sp-star.cpp b/src/sp-star.cpp index 4c5f9623b..96bc9180a 100644 --- a/src/sp-star.cpp +++ b/src/sp-star.cpp @@ -34,7 +34,7 @@ static void sp_star_class_init (SPStarClass *klass); static void sp_star_init (SPStar *star); static void sp_star_build (SPObject * object, SPDocument * document, Inkscape::XML::Node * repr); -static Inkscape::XML::Node *sp_star_write (SPObject *object, Inkscape::XML::Node *repr, guint flags); +static Inkscape::XML::Node *sp_star_write (SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags); static void sp_star_set (SPObject *object, unsigned int key, const gchar *value); static void sp_star_update (SPObject *object, SPCtx *ctx, guint flags); @@ -129,12 +129,11 @@ sp_star_build (SPObject * object, SPDocument * document, Inkscape::XML::Node * r } static Inkscape::XML::Node * -sp_star_write (SPObject *object, Inkscape::XML::Node *repr, guint flags) +sp_star_write (SPObject *object, Inkscape::XML::Document *xml_doc, Inkscape::XML::Node *repr, guint flags) { SPStar *star = SP_STAR (object); if ((flags & SP_OBJECT_WRITE_BUILD) && !repr) { - Inkscape::XML::Document *xml_doc = sp_document_repr_doc(SP_OBJECT_DOCUMENT(object)); repr = xml_doc->createElement("svg:path"); } @@ -152,13 +151,13 @@ sp_star_write (SPObject *object, Inkscape::XML::Node *repr, guint flags) sp_repr_set_svg_double(repr, "inkscape:randomized", star->randomized); } - sp_star_set_shape ((SPShape *) star); - char *d = sp_svg_write_path (SP_CURVE_BPATH(((SPShape *) star)->curve)); - repr->setAttribute("d", d); - g_free (d); + sp_star_set_shape ((SPShape *) star); + char *d = sp_svg_write_path (((SPShape *) star)->curve->get_pathvector()); + repr->setAttribute("d", d); + g_free (d); if (((SPObjectClass *) (parent_class))->write) - ((SPObjectClass *) (parent_class))->write (object, repr, flags); + ((SPObjectClass *) (parent_class))->write (object, xml_doc, repr, flags); return repr; } @@ -285,14 +284,9 @@ sp_star_update_patheffect(SPLPEItem *lpeitem, bool write) if (write) { Inkscape::XML::Node *repr = SP_OBJECT_REPR(shape); if ( shape->curve != NULL ) { - NArtBpath *abp = shape->curve->first_bpath(); - if (abp) { - gchar *str = sp_svg_write_path(abp); - repr->setAttribute("d", str); - g_free(str); - } else { - repr->setAttribute("d", ""); - } + gchar *str = sp_svg_write_path(shape->curve->get_pathvector()); + repr->setAttribute("d", str); + g_free(str); } else { repr->setAttribute("d", NULL); }