From 2d3f862c97fdd6fdb17368933377370886375a2d Mon Sep 17 00:00:00 2001 From: Markus Engel Date: Sat, 18 Aug 2012 23:51:06 +0200 Subject: Added "virtual pad" to SPStar. (bzr r11608.1.11) --- src/sp-star.cpp | 129 +++++++++++++++++++++++++++++++++++++++++--------------- 1 file changed, 96 insertions(+), 33 deletions(-) (limited to 'src/sp-star.cpp') diff --git a/src/sp-star.cpp b/src/sp-star.cpp index e0f05d0f4..aead51b8b 100644 --- a/src/sp-star.cpp +++ b/src/sp-star.cpp @@ -91,9 +91,23 @@ static void sp_star_class_init(SPStarClass *klass) shape_class->set_shape = sp_star_set_shape; } +CStar::CStar(SPStar* star) : CPolygon(star) { + this->spstar = star; +} + +CStar::~CStar() { +} + static void sp_star_init (SPStar * star) { + star->cstar = new CStar(star); + star->cpolygon = star->cstar; + star->cshape = star->cstar; + star->clpeitem = star->cstar; + star->citem = star->cstar; + star->cobject = star->cstar; + star->sides = 5; star->center = Geom::Point(0, 0); star->r[0] = 1.0; @@ -104,11 +118,11 @@ sp_star_init (SPStar * star) star->randomized = 0.0; } -static void -sp_star_build (SPObject * object, SPDocument * document, Inkscape::XML::Node * repr) -{ - if (((SPObjectClass *) parent_class)->build) - ((SPObjectClass *) parent_class)->build (object, document, repr); +void CStar::onBuild(SPDocument * document, Inkscape::XML::Node * repr) { + SPStar* object = this->spstar; + + // CPPIFY: see header file + CShape::onBuild(document, repr); object->readAttr( "sodipodi:cx" ); object->readAttr( "sodipodi:cy" ); @@ -122,10 +136,16 @@ sp_star_build (SPObject * object, SPDocument * document, Inkscape::XML::Node * r object->readAttr( "inkscape:randomized" ); } -static Inkscape::XML::Node * -sp_star_write (SPObject *object, Inkscape::XML::Document *xml_doc, Inkscape::XML::Node *repr, guint flags) +// CPPIFY: remove +static void +sp_star_build (SPObject * object, SPDocument * document, Inkscape::XML::Node * repr) { - SPStar *star = SP_STAR (object); + ((SPStar*)object)->cstar->onBuild(document, repr); +} + +Inkscape::XML::Node* CStar::onWrite(Inkscape::XML::Document *xml_doc, Inkscape::XML::Node *repr, guint flags) { + SPStar* object = this->spstar; + SPStar *star = object; if ((flags & SP_OBJECT_WRITE_BUILD) && !repr) { repr = xml_doc->createElement("svg:path"); @@ -150,18 +170,24 @@ sp_star_write (SPObject *object, Inkscape::XML::Document *xml_doc, Inkscape::XML repr->setAttribute("d", d); g_free (d); - if (((SPObjectClass *) (parent_class))->write) - ((SPObjectClass *) (parent_class))->write (object, xml_doc, repr, flags); + // CPPIFY: see header file + CShape::onWrite(xml_doc, repr, flags); return repr; } -static void -sp_star_set (SPObject *object, unsigned int key, const gchar *value) +// CPPIFY: remove +static Inkscape::XML::Node * +sp_star_write (SPObject *object, Inkscape::XML::Document *xml_doc, Inkscape::XML::Node *repr, guint flags) { - SVGLength::Unit unit; + return ((SPStar*)object)->cstar->onWrite(xml_doc, repr, flags); +} + +void CStar::onSet(unsigned int key, const gchar* value) { + SPStar* object = this->spstar; + SPStar *star = object; - SPStar *star = SP_STAR (object); + SVGLength::Unit unit; /* fixme: we should really collect updates */ switch (key) { @@ -250,29 +276,43 @@ sp_star_set (SPObject *object, unsigned int key, const gchar *value) object->requestDisplayUpdate(SP_OBJECT_MODIFIED_FLAG); break; default: - if (((SPObjectClass *) parent_class)->set) - ((SPObjectClass *) parent_class)->set (object, key, value); + // CPPIFY: see header file + CShape::onSet(key, value); break; } } +// CPPIFY: remove static void -sp_star_update (SPObject *object, SPCtx *ctx, guint flags) +sp_star_set (SPObject *object, unsigned int key, const gchar *value) { + ((SPStar*)object)->cstar->onSet(key, value); +} + +void CStar::onUpdate(SPCtx *ctx, guint flags) { + SPStar* object = this->spstar; + if (flags & (SP_OBJECT_MODIFIED_FLAG | SP_OBJECT_STYLE_MODIFIED_FLAG | SP_OBJECT_VIEWPORT_MODIFIED_FLAG)) { ((SPShape *) object)->setShape (); } - if (((SPObjectClass *) parent_class)->update) - ((SPObjectClass *) parent_class)->update (object, ctx, flags); + // CPPIFY: see header file + CShape::onUpdate(ctx, flags); } +// CPPIFY: remove static void -sp_star_update_patheffect(SPLPEItem *lpeitem, bool write) +sp_star_update (SPObject *object, SPCtx *ctx, guint flags) { + ((SPStar*)object)->cstar->onUpdate(ctx, flags); +} + +void CStar::onUpdatePatheffect(bool write) { + SPStar* lpeitem = this->spstar; SPShape *shape = (SPShape *) lpeitem; + sp_star_set_shape(shape); if (write) { @@ -289,10 +329,15 @@ sp_star_update_patheffect(SPLPEItem *lpeitem, bool write) ((SPObject *)shape)->requestDisplayUpdate(SP_OBJECT_MODIFIED_FLAG); } -static gchar * -sp_star_description (SPItem *item) +// CPPIFY: remove +static void +sp_star_update_patheffect(SPLPEItem *lpeitem, bool write) { - SPStar *star = SP_STAR (item); + ((SPStar*)lpeitem)->cstar->onUpdatePatheffect(write); +} + +gchar* CStar::onDescription() { + SPStar *star = this->spstar; // while there will never be less than 3 vertices, we still need to // make calls to ngettext because the pluralization may be different @@ -307,6 +352,13 @@ sp_star_description (SPItem *item) star->sides), star->sides); } +// CPPIFY: remove +static gchar * +sp_star_description (SPItem *item) +{ + return ((SPStar*)item)->cstar->onDescription(); +} + /** Returns a unit-length vector at 90 degrees to the direction from o to n */ @@ -413,14 +465,12 @@ sp_star_get_curvepoint (SPStar *star, SPStarPoint point, gint index, bool previ) } } - #define NEXT false #define PREV true -static void -sp_star_set_shape (SPShape *shape) -{ - SPStar *star = SP_STAR (shape); +void CStar::onSetShape() { + SPStar* shape = this->spstar; + SPStar *star = shape; // perhaps we should convert all our shapes into LPEs without source path // and with knotholders for parameters, then this situation will be handled automatically @@ -515,6 +565,13 @@ sp_star_set_shape (SPShape *shape) c->unref(); } +// CPPIFY: remove +static void +sp_star_set_shape (SPShape *shape) +{ + ((SPStar*)shape)->cstar->onSetShape(); +} + void sp_star_position_set (SPStar *star, gint sides, Geom::Point center, gdouble r1, gdouble r2, gdouble arg1, gdouble arg2, bool isflat, double rounded, double randomized) { @@ -537,16 +594,16 @@ sp_star_position_set (SPStar *star, gint sides, Geom::Point center, gdouble r1, star->requestDisplayUpdate(SP_OBJECT_MODIFIED_FLAG); } -static void sp_star_snappoints(SPItem const *item, std::vector &p, Inkscape::SnapPreferences const *snapprefs) -{ +void CStar::onSnappoints(std::vector &p, Inkscape::SnapPreferences const *snapprefs) { + SPStar* item = this->spstar; + // We will determine the star's midpoint ourselves, instead of trusting on the base class // Therefore snapping to object midpoints is temporarily disabled Inkscape::SnapPreferences local_snapprefs = *snapprefs; local_snapprefs.setTargetSnappable(Inkscape::SNAPTARGET_OBJECT_MIDPOINT, false); - if (((SPItemClass *) parent_class)->snappoints) { - ((SPItemClass *) parent_class)->snappoints (item, p, &local_snapprefs); - } + // CPPIFY: see header file + CShape::onSnappoints(p, &local_snapprefs); if (snapprefs->isTargetSnappable(Inkscape::SNAPTARGET_OBJECT_MIDPOINT)) { Geom::Affine const i2dt (item->i2dt_affine ()); @@ -554,6 +611,12 @@ static void sp_star_snappoints(SPItem const *item, std::vector &p, Inkscape::SnapPreferences const *snapprefs) +{ + ((SPStar const*)item)->cstar->onSnappoints(p, snapprefs); +} + /** * sp_star_get_xy: Get X-Y value as item coordinate system * @star: star item -- cgit v1.2.3 From 260c7156ca920232cca2e829782373a805d59cae Mon Sep 17 00:00:00 2001 From: Markus Engel Date: Sat, 29 Sep 2012 17:43:15 +0200 Subject: Removed old calls to set_shape and update_patheffect. (bzr r11608.1.45) --- src/sp-star.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/sp-star.cpp') diff --git a/src/sp-star.cpp b/src/sp-star.cpp index aead51b8b..fca4d6f35 100644 --- a/src/sp-star.cpp +++ b/src/sp-star.cpp @@ -86,9 +86,9 @@ static void sp_star_class_init(SPStarClass *klass) item_class->description = sp_star_description; item_class->snappoints = sp_star_snappoints; - lpe_item_class->update_patheffect = sp_star_update_patheffect; + //lpe_item_class->update_patheffect = sp_star_update_patheffect; - shape_class->set_shape = sp_star_set_shape; + //shape_class->set_shape = sp_star_set_shape; } CStar::CStar(SPStar* star) : CPolygon(star) { -- cgit v1.2.3 From 99cb30e28d4ee193f39e23464abbd7630cac8a2d Mon Sep 17 00:00:00 2001 From: Markus Engel Date: Sat, 6 Oct 2012 23:56:27 +0200 Subject: Added virtual pad to SPFlowtext; removed old calls to virtual SPItem methods. (bzr r11608.1.46) --- src/sp-star.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/sp-star.cpp') diff --git a/src/sp-star.cpp b/src/sp-star.cpp index fca4d6f35..cbc4d4520 100644 --- a/src/sp-star.cpp +++ b/src/sp-star.cpp @@ -83,8 +83,8 @@ static void sp_star_class_init(SPStarClass *klass) sp_object_class->set = sp_star_set; sp_object_class->update = sp_star_update; - item_class->description = sp_star_description; - item_class->snappoints = sp_star_snappoints; +// item_class->description = sp_star_description; +// item_class->snappoints = sp_star_snappoints; //lpe_item_class->update_patheffect = sp_star_update_patheffect; -- cgit v1.2.3 From a0a8d020201e0e38a63d9aa3dce228d7d9e6fb35 Mon Sep 17 00:00:00 2001 From: Markus Engel Date: Thu, 14 Mar 2013 12:42:39 +0100 Subject: Various changes. (bzr r11608.1.48) --- src/sp-star.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/sp-star.cpp') diff --git a/src/sp-star.cpp b/src/sp-star.cpp index cbc4d4520..489702167 100644 --- a/src/sp-star.cpp +++ b/src/sp-star.cpp @@ -78,7 +78,7 @@ static void sp_star_class_init(SPStarClass *klass) parent_class = reinterpret_cast(g_type_class_ref(SP_TYPE_SHAPE)); - sp_object_class->build = sp_star_build; + //sp_object_class->build = sp_star_build; sp_object_class->write = sp_star_write; sp_object_class->set = sp_star_set; sp_object_class->update = sp_star_update; -- cgit v1.2.3 From 957c3e4b7909d42c5a13f1b1dd583f877fc32259 Mon Sep 17 00:00:00 2001 From: Markus Engel Date: Sat, 30 Mar 2013 00:46:57 +0100 Subject: Removed function pointers from SPObject and subclasses. Added some missing virtual pads for classes that were hidden by preprocessor macros. (bzr r11608.1.55) --- src/sp-star.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/sp-star.cpp') diff --git a/src/sp-star.cpp b/src/sp-star.cpp index 489702167..29a5fa55a 100644 --- a/src/sp-star.cpp +++ b/src/sp-star.cpp @@ -79,9 +79,9 @@ static void sp_star_class_init(SPStarClass *klass) parent_class = reinterpret_cast(g_type_class_ref(SP_TYPE_SHAPE)); //sp_object_class->build = sp_star_build; - sp_object_class->write = sp_star_write; - sp_object_class->set = sp_star_set; - sp_object_class->update = sp_star_update; +// sp_object_class->write = sp_star_write; +// sp_object_class->set = sp_star_set; +// sp_object_class->update = sp_star_update; // item_class->description = sp_star_description; // item_class->snappoints = sp_star_snappoints; -- cgit v1.2.3 From 7df6616da5ea2debb86838366ddf746841549cdb Mon Sep 17 00:00:00 2001 From: Markus Engel Date: Sat, 30 Mar 2013 00:56:13 +0100 Subject: Renamed virtual function names. (bzr r11608.1.57) --- src/sp-star.cpp | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'src/sp-star.cpp') diff --git a/src/sp-star.cpp b/src/sp-star.cpp index 03c3e9046..7d22484cf 100644 --- a/src/sp-star.cpp +++ b/src/sp-star.cpp @@ -67,11 +67,11 @@ sp_star_init (SPStar * star) star->randomized = 0.0; } -void CStar::onBuild(SPDocument * document, Inkscape::XML::Node * repr) { +void CStar::build(SPDocument * document, Inkscape::XML::Node * repr) { SPStar* object = this->spstar; // CPPIFY: see header file - CShape::onBuild(document, repr); + CShape::build(document, repr); object->readAttr( "sodipodi:cx" ); object->readAttr( "sodipodi:cy" ); @@ -85,7 +85,7 @@ void CStar::onBuild(SPDocument * document, Inkscape::XML::Node * repr) { object->readAttr( "inkscape:randomized" ); } -Inkscape::XML::Node* CStar::onWrite(Inkscape::XML::Document *xml_doc, Inkscape::XML::Node *repr, guint flags) { +Inkscape::XML::Node* CStar::write(Inkscape::XML::Document *xml_doc, Inkscape::XML::Node *repr, guint flags) { SPStar* object = this->spstar; SPStar *star = object; @@ -107,18 +107,18 @@ Inkscape::XML::Node* CStar::onWrite(Inkscape::XML::Document *xml_doc, Inkscape:: sp_repr_set_svg_double(repr, "inkscape:randomized", star->randomized); } - this->onSetShape(); + this->set_shape(); char *d = sp_svg_write_path (star->_curve->get_pathvector()); repr->setAttribute("d", d); g_free (d); // CPPIFY: see header file - CShape::onWrite(xml_doc, repr, flags); + CShape::write(xml_doc, repr, flags); return repr; } -void CStar::onSet(unsigned int key, const gchar* value) { +void CStar::set(unsigned int key, const gchar* value) { SPStar* object = this->spstar; SPStar *star = object; @@ -212,12 +212,12 @@ void CStar::onSet(unsigned int key, const gchar* value) { break; default: // CPPIFY: see header file - CShape::onSet(key, value); + CShape::set(key, value); break; } } -void CStar::onUpdate(SPCtx *ctx, guint flags) { +void CStar::update(SPCtx *ctx, guint flags) { SPStar* object = this->spstar; if (flags & (SP_OBJECT_MODIFIED_FLAG | @@ -227,14 +227,14 @@ void CStar::onUpdate(SPCtx *ctx, guint flags) { } // CPPIFY: see header file - CShape::onUpdate(ctx, flags); + CShape::update(ctx, flags); } -void CStar::onUpdatePatheffect(bool write) { +void CStar::update_patheffect(bool write) { SPStar* lpeitem = this->spstar; SPShape *shape = (SPShape *) lpeitem; - this->onSetShape(); + this->set_shape(); if (write) { Inkscape::XML::Node *repr = shape->getRepr(); @@ -250,7 +250,7 @@ void CStar::onUpdatePatheffect(bool write) { ((SPObject *)shape)->requestDisplayUpdate(SP_OBJECT_MODIFIED_FLAG); } -gchar* CStar::onDescription() { +gchar* CStar::description() { SPStar *star = this->spstar; // while there will never be less than 3 vertices, we still need to @@ -375,7 +375,7 @@ sp_star_get_curvepoint (SPStar *star, SPStarPoint point, gint index, bool previ) #define NEXT false #define PREV true -void CStar::onSetShape() { +void CStar::set_shape() { SPStar* shape = this->spstar; SPStar *star = shape; @@ -494,7 +494,7 @@ sp_star_position_set (SPStar *star, gint sides, Geom::Point center, gdouble r1, star->requestDisplayUpdate(SP_OBJECT_MODIFIED_FLAG); } -void CStar::onSnappoints(std::vector &p, Inkscape::SnapPreferences const *snapprefs) { +void CStar::snappoints(std::vector &p, Inkscape::SnapPreferences const *snapprefs) { SPStar* item = this->spstar; // We will determine the star's midpoint ourselves, instead of trusting on the base class @@ -503,7 +503,7 @@ void CStar::onSnappoints(std::vector &p, Inkscape: local_snapprefs.setTargetSnappable(Inkscape::SNAPTARGET_OBJECT_MIDPOINT, false); // CPPIFY: see header file - CShape::onSnappoints(p, &local_snapprefs); + CShape::snappoints(p, &local_snapprefs); if (snapprefs->isTargetSnappable(Inkscape::SNAPTARGET_OBJECT_MIDPOINT)) { Geom::Affine const i2dt (item->i2dt_affine ()); -- cgit v1.2.3 From a5d6e692d661f0bf7648e64e8fcb04588bb8f3ab Mon Sep 17 00:00:00 2001 From: Markus Engel Date: Mon, 1 Apr 2013 00:07:00 +0200 Subject: Prepared exchange of casting macros. (bzr r11608.1.63) --- src/sp-star.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src/sp-star.cpp') diff --git a/src/sp-star.cpp b/src/sp-star.cpp index 7d22484cf..0b89ed10c 100644 --- a/src/sp-star.cpp +++ b/src/sp-star.cpp @@ -49,6 +49,7 @@ static void sp_star_init (SPStar * star) { star->cstar = new CStar(star); + star->typeHierarchy.insert(typeid(SPStar)); delete star->cpolygon; star->cpolygon = star->cstar; -- cgit v1.2.3 From 69f3b6f1abb2bb422935d43262e1e99aab359954 Mon Sep 17 00:00:00 2001 From: Markus Engel Date: Tue, 2 Apr 2013 01:41:30 +0200 Subject: Added constructors to SP classes. (bzr r11608.1.67) --- src/sp-star.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'src/sp-star.cpp') diff --git a/src/sp-star.cpp b/src/sp-star.cpp index 0b89ed10c..11e367faf 100644 --- a/src/sp-star.cpp +++ b/src/sp-star.cpp @@ -32,7 +32,7 @@ #include "sp-star.h" -G_DEFINE_TYPE(SPStar, sp_star, SP_TYPE_SHAPE); +G_DEFINE_TYPE(SPStar, sp_star, G_TYPE_OBJECT); static void sp_star_class_init(SPStarClass *klass) { @@ -45,9 +45,9 @@ CStar::CStar(SPStar* star) : CPolygon(star) { CStar::~CStar() { } -static void -sp_star_init (SPStar * star) -{ +SPStar::SPStar() : SPPolygon() { + SPStar* star = this; + star->cstar = new CStar(star); star->typeHierarchy.insert(typeid(SPStar)); @@ -68,6 +68,12 @@ sp_star_init (SPStar * star) star->randomized = 0.0; } +static void +sp_star_init (SPStar * star) +{ + new (star) SPStar(); +} + void CStar::build(SPDocument * document, Inkscape::XML::Node * repr) { SPStar* object = this->spstar; -- cgit v1.2.3 From d1af3566872dfff2aeec84859c87f1f8d13f79df Mon Sep 17 00:00:00 2001 From: Markus Engel Date: Tue, 2 Apr 2013 19:14:36 +0200 Subject: Registered classes with new factory. Hkern, Vkern and FeFuncX have to be rewritten, as they aren't real classes. (bzr r11608.1.69) --- src/sp-star.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/sp-star.cpp') diff --git a/src/sp-star.cpp b/src/sp-star.cpp index 11e367faf..741591479 100644 --- a/src/sp-star.cpp +++ b/src/sp-star.cpp @@ -32,6 +32,16 @@ #include "sp-star.h" +#include "sp-factory.h" + +namespace { + SPObject* createStar() { + return new SPStar(); + } + + bool starRegistered = SPFactory::instance().registerObject("star", createStar); +} + G_DEFINE_TYPE(SPStar, sp_star, G_TYPE_OBJECT); static void sp_star_class_init(SPStarClass *klass) -- cgit v1.2.3 From 8443720ce6429b9beec839e60b8a808595f4ba72 Mon Sep 17 00:00:00 2001 From: Markus Engel Date: Tue, 2 Apr 2013 23:01:45 +0200 Subject: Cleaned up a bit. Uses some C++11 features. (bzr r11608.1.72) --- src/sp-star.cpp | 12 ------------ 1 file changed, 12 deletions(-) (limited to 'src/sp-star.cpp') diff --git a/src/sp-star.cpp b/src/sp-star.cpp index 741591479..b6a6132a4 100644 --- a/src/sp-star.cpp +++ b/src/sp-star.cpp @@ -42,12 +42,6 @@ namespace { bool starRegistered = SPFactory::instance().registerObject("star", createStar); } -G_DEFINE_TYPE(SPStar, sp_star, G_TYPE_OBJECT); - -static void sp_star_class_init(SPStarClass *klass) -{ -} - CStar::CStar(SPStar* star) : CPolygon(star) { this->spstar = star; } @@ -78,12 +72,6 @@ SPStar::SPStar() : SPPolygon() { star->randomized = 0.0; } -static void -sp_star_init (SPStar * star) -{ - new (star) SPStar(); -} - void CStar::build(SPDocument * document, Inkscape::XML::Node * repr) { SPStar* object = this->spstar; -- cgit v1.2.3 From 748ffce08bb6250c87adabb64f45bff02509e9e7 Mon Sep 17 00:00:00 2001 From: Markus Engel Date: Fri, 5 Apr 2013 00:27:58 +0200 Subject: Combined some classes. (bzr r11608.1.75) --- src/sp-star.cpp | 329 ++++++++++++++++++++++++++++---------------------------- 1 file changed, 166 insertions(+), 163 deletions(-) (limited to 'src/sp-star.cpp') diff --git a/src/sp-star.cpp b/src/sp-star.cpp index b6a6132a4..8414c6d9a 100644 --- a/src/sp-star.cpp +++ b/src/sp-star.cpp @@ -42,80 +42,65 @@ namespace { bool starRegistered = SPFactory::instance().registerObject("star", createStar); } -CStar::CStar(SPStar* star) : CPolygon(star) { - this->spstar = star; -} - -CStar::~CStar() { -} - SPStar::SPStar() : SPPolygon() { - SPStar* star = this; - - star->cstar = new CStar(star); - star->typeHierarchy.insert(typeid(SPStar)); - - delete star->cpolygon; - star->cpolygon = star->cstar; - star->cshape = star->cstar; - star->clpeitem = star->cstar; - star->citem = star->cstar; - star->cobject = star->cstar; - - star->sides = 5; - star->center = Geom::Point(0, 0); - star->r[0] = 1.0; - star->r[1] = 0.001; - star->arg[0] = star->arg[1] = 0.0; - star->flatsided = 0; - star->rounded = 0.0; - star->randomized = 0.0; + this->cshape = this; + this->clpeitem = this; + this->citem = this; + this->cobject = this; + + this->sides = 5; + this->center = Geom::Point(0, 0); + this->r[0] = 1.0; + this->r[1] = 0.001; + this->arg[0] = this->arg[1] = 0.0; + this->flatsided = 0; + this->rounded = 0.0; + this->randomized = 0.0; } -void CStar::build(SPDocument * document, Inkscape::XML::Node * repr) { - SPStar* object = this->spstar; +SPStar::~SPStar() { +} +void SPStar::build(SPDocument * document, Inkscape::XML::Node * repr) { // CPPIFY: see header file CShape::build(document, repr); - object->readAttr( "sodipodi:cx" ); - object->readAttr( "sodipodi:cy" ); - object->readAttr( "sodipodi:sides" ); - object->readAttr( "sodipodi:r1" ); - object->readAttr( "sodipodi:r2" ); - object->readAttr( "sodipodi:arg1" ); - object->readAttr( "sodipodi:arg2" ); - object->readAttr( "inkscape:flatsided" ); - object->readAttr( "inkscape:rounded" ); - object->readAttr( "inkscape:randomized" ); + this->readAttr( "sodipodi:cx" ); + this->readAttr( "sodipodi:cy" ); + this->readAttr( "sodipodi:sides" ); + this->readAttr( "sodipodi:r1" ); + this->readAttr( "sodipodi:r2" ); + this->readAttr( "sodipodi:arg1" ); + this->readAttr( "sodipodi:arg2" ); + this->readAttr( "inkscape:flatsided" ); + this->readAttr( "inkscape:rounded" ); + this->readAttr( "inkscape:randomized" ); } -Inkscape::XML::Node* CStar::write(Inkscape::XML::Document *xml_doc, Inkscape::XML::Node *repr, guint flags) { - SPStar* object = this->spstar; - SPStar *star = object; - +Inkscape::XML::Node* SPStar::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", "star"); - sp_repr_set_int (repr, "sodipodi:sides", star->sides); - sp_repr_set_svg_double(repr, "sodipodi:cx", star->center[Geom::X]); - sp_repr_set_svg_double(repr, "sodipodi:cy", star->center[Geom::Y]); - sp_repr_set_svg_double(repr, "sodipodi:r1", star->r[0]); - sp_repr_set_svg_double(repr, "sodipodi:r2", star->r[1]); - sp_repr_set_svg_double(repr, "sodipodi:arg1", star->arg[0]); - sp_repr_set_svg_double(repr, "sodipodi:arg2", star->arg[1]); - sp_repr_set_boolean (repr, "inkscape:flatsided", star->flatsided); - sp_repr_set_svg_double(repr, "inkscape:rounded", star->rounded); - sp_repr_set_svg_double(repr, "inkscape:randomized", star->randomized); + sp_repr_set_int (repr, "sodipodi:sides", this->sides); + sp_repr_set_svg_double(repr, "sodipodi:cx", this->center[Geom::X]); + sp_repr_set_svg_double(repr, "sodipodi:cy", this->center[Geom::Y]); + sp_repr_set_svg_double(repr, "sodipodi:r1", this->r[0]); + sp_repr_set_svg_double(repr, "sodipodi:r2", this->r[1]); + sp_repr_set_svg_double(repr, "sodipodi:arg1", this->arg[0]); + sp_repr_set_svg_double(repr, "sodipodi:arg2", this->arg[1]); + sp_repr_set_boolean (repr, "inkscape:flatsided", this->flatsided); + sp_repr_set_svg_double(repr, "inkscape:rounded", this->rounded); + sp_repr_set_svg_double(repr, "inkscape:randomized", this->randomized); } this->set_shape(); - char *d = sp_svg_write_path (star->_curve->get_pathvector()); + + char *d = sp_svg_write_path (this->_curve->get_pathvector()); repr->setAttribute("d", d); - g_free (d); + g_free(d); // CPPIFY: see header file CShape::write(xml_doc, repr, flags); @@ -123,98 +108,117 @@ Inkscape::XML::Node* CStar::write(Inkscape::XML::Document *xml_doc, Inkscape::XM return repr; } -void CStar::set(unsigned int key, const gchar* value) { - SPStar* object = this->spstar; - SPStar *star = object; - +void SPStar::set(unsigned int key, const gchar* value) { SVGLength::Unit unit; /* fixme: we should really collect updates */ switch (key) { case SP_ATTR_SODIPODI_SIDES: if (value) { - star->sides = atoi (value); - star->sides = CLAMP(star->sides, 3, 1024); + this->sides = atoi (value); + this->sides = CLAMP(this->sides, 3, 1024); } else { - star->sides = 5; + this->sides = 5; } - object->requestDisplayUpdate(SP_OBJECT_MODIFIED_FLAG); + + this->requestDisplayUpdate(SP_OBJECT_MODIFIED_FLAG); break; + case SP_ATTR_SODIPODI_CX: - if (!sp_svg_length_read_ldd (value, &unit, NULL, &star->center[Geom::X]) || + if (!sp_svg_length_read_ldd (value, &unit, NULL, &this->center[Geom::X]) || (unit == SVGLength::EM) || (unit == SVGLength::EX) || (unit == SVGLength::PERCENT)) { - star->center[Geom::X] = 0.0; + this->center[Geom::X] = 0.0; } - object->requestDisplayUpdate(SP_OBJECT_MODIFIED_FLAG); + + this->requestDisplayUpdate(SP_OBJECT_MODIFIED_FLAG); break; + case SP_ATTR_SODIPODI_CY: - if (!sp_svg_length_read_ldd (value, &unit, NULL, &star->center[Geom::Y]) || + if (!sp_svg_length_read_ldd (value, &unit, NULL, &this->center[Geom::Y]) || (unit == SVGLength::EM) || (unit == SVGLength::EX) || (unit == SVGLength::PERCENT)) { - star->center[Geom::Y] = 0.0; + this->center[Geom::Y] = 0.0; } - object->requestDisplayUpdate(SP_OBJECT_MODIFIED_FLAG); + + this->requestDisplayUpdate(SP_OBJECT_MODIFIED_FLAG); break; + case SP_ATTR_SODIPODI_R1: - if (!sp_svg_length_read_ldd (value, &unit, NULL, &star->r[0]) || + if (!sp_svg_length_read_ldd (value, &unit, NULL, &this->r[0]) || (unit == SVGLength::EM) || (unit == SVGLength::EX) || (unit == SVGLength::PERCENT)) { - star->r[0] = 1.0; + this->r[0] = 1.0; } + /* fixme: Need CLAMP (Lauris) */ - object->requestDisplayUpdate(SP_OBJECT_MODIFIED_FLAG); + this->requestDisplayUpdate(SP_OBJECT_MODIFIED_FLAG); break; + case SP_ATTR_SODIPODI_R2: - if (!sp_svg_length_read_ldd (value, &unit, NULL, &star->r[1]) || + if (!sp_svg_length_read_ldd (value, &unit, NULL, &this->r[1]) || (unit == SVGLength::EM) || (unit == SVGLength::EX) || (unit == SVGLength::PERCENT)) { - star->r[1] = 0.0; + this->r[1] = 0.0; } - object->requestDisplayUpdate(SP_OBJECT_MODIFIED_FLAG); + + this->requestDisplayUpdate(SP_OBJECT_MODIFIED_FLAG); return; + case SP_ATTR_SODIPODI_ARG1: if (value) { - star->arg[0] = g_ascii_strtod (value, NULL); + this->arg[0] = g_ascii_strtod (value, NULL); } else { - star->arg[0] = 0.0; + this->arg[0] = 0.0; } - object->requestDisplayUpdate(SP_OBJECT_MODIFIED_FLAG); + + this->requestDisplayUpdate(SP_OBJECT_MODIFIED_FLAG); break; + case SP_ATTR_SODIPODI_ARG2: if (value) { - star->arg[1] = g_ascii_strtod (value, NULL); + this->arg[1] = g_ascii_strtod (value, NULL); } else { - star->arg[1] = 0.0; + this->arg[1] = 0.0; } - object->requestDisplayUpdate(SP_OBJECT_MODIFIED_FLAG); + + this->requestDisplayUpdate(SP_OBJECT_MODIFIED_FLAG); break; + case SP_ATTR_INKSCAPE_FLATSIDED: - if (value && !strcmp (value, "true")) - star->flatsided = true; - else star->flatsided = false; - object->requestDisplayUpdate(SP_OBJECT_MODIFIED_FLAG); + if (value && !strcmp(value, "true")) { + this->flatsided = true; + } else { + this->flatsided = false; + } + + this->requestDisplayUpdate(SP_OBJECT_MODIFIED_FLAG); break; + case SP_ATTR_INKSCAPE_ROUNDED: if (value) { - star->rounded = g_ascii_strtod (value, NULL); + this->rounded = g_ascii_strtod (value, NULL); } else { - star->rounded = 0.0; + this->rounded = 0.0; } - object->requestDisplayUpdate(SP_OBJECT_MODIFIED_FLAG); + + this->requestDisplayUpdate(SP_OBJECT_MODIFIED_FLAG); break; + case SP_ATTR_INKSCAPE_RANDOMIZED: if (value) { - star->randomized = g_ascii_strtod (value, NULL); + this->randomized = g_ascii_strtod (value, NULL); } else { - star->randomized = 0.0; + this->randomized = 0.0; } - object->requestDisplayUpdate(SP_OBJECT_MODIFIED_FLAG); + + this->requestDisplayUpdate(SP_OBJECT_MODIFIED_FLAG); break; + default: // CPPIFY: see header file CShape::set(key, value); @@ -222,29 +226,26 @@ void CStar::set(unsigned int key, const gchar* value) { } } -void CStar::update(SPCtx *ctx, guint flags) { - SPStar* object = this->spstar; - +void SPStar::update(SPCtx *ctx, guint flags) { if (flags & (SP_OBJECT_MODIFIED_FLAG | SP_OBJECT_STYLE_MODIFIED_FLAG | SP_OBJECT_VIEWPORT_MODIFIED_FLAG)) { - ((SPShape *) object)->setShape (); + + this->setShape(); } // CPPIFY: see header file CShape::update(ctx, flags); } -void CStar::update_patheffect(bool write) { - SPStar* lpeitem = this->spstar; - SPShape *shape = (SPShape *) lpeitem; - +void SPStar::update_patheffect(bool write) { this->set_shape(); if (write) { - Inkscape::XML::Node *repr = shape->getRepr(); - if ( shape->_curve != NULL ) { - gchar *str = sp_svg_write_path(shape->_curve->get_pathvector()); + 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 { @@ -252,23 +253,22 @@ void CStar::update_patheffect(bool write) { } } - ((SPObject *)shape)->requestDisplayUpdate(SP_OBJECT_MODIFIED_FLAG); + this->requestDisplayUpdate(SP_OBJECT_MODIFIED_FLAG); } -gchar* CStar::description() { - SPStar *star = this->spstar; - +gchar* SPStar::description() { // while there will never be less than 3 vertices, we still need to // make calls to ngettext because the pluralization may be different // for various numbers >=3. The singular form is used as the index. - if (star->flatsided == false ) - return g_strdup_printf (ngettext("Star with %d vertex", + if (this->flatsided == false) { + return g_strdup_printf (ngettext("Star with %d vertex", "Star with %d vertices", - star->sides), star->sides); - else + this->sides), this->sides); + } else { return g_strdup_printf (ngettext("Polygon with %d vertex", "Polygon with %d vertices", - star->sides), star->sides); + this->sides), this->sides); + } } /** @@ -380,100 +380,104 @@ sp_star_get_curvepoint (SPStar *star, SPStarPoint point, gint index, bool previ) #define NEXT false #define PREV true -void CStar::set_shape() { - SPStar* shape = this->spstar; - SPStar *star = shape; - +void SPStar::set_shape() { // perhaps we should convert all our shapes into LPEs without source path // and with knotholders for parameters, then this situation will be handled automatically // by disabling the entire stack (including the shape LPE) - if (sp_lpe_item_has_broken_path_effect(SP_LPE_ITEM(shape))) { + if (sp_lpe_item_has_broken_path_effect(SP_LPE_ITEM(this))) { g_warning ("The star shape has unknown LPE on it! Convert to path to make it editable preserving the appearance; editing it as star will remove the bad LPE"); - if (shape->getRepr()->attribute("d")) { + + if (this->getRepr()->attribute("d")) { // unconditionally read the curve from d, if any, to preserve appearance - Geom::PathVector pv = sp_svg_read_pathv(shape->getRepr()->attribute("d")); + Geom::PathVector pv = sp_svg_read_pathv(this->getRepr()->attribute("d")); SPCurve *cold = new SPCurve(pv); - shape->setCurveInsync( cold, TRUE); - shape->setCurveBeforeLPE(cold); + this->setCurveInsync( cold, TRUE); + this->setCurveBeforeLPE(cold); cold->unref(); } + return; } SPCurve *c = new SPCurve (); - gint sides = star->sides; - bool not_rounded = (fabs (star->rounded) < 1e-4); + gint sides = this->sides; + bool not_rounded = (fabs (this->rounded) < 1e-4); // note that we pass randomized=true to sp_star_get_xy, because the curve must be randomized; // other places that call that function (e.g. the knotholder) need the exact point // draw 1st segment - c->moveto(sp_star_get_xy (star, SP_STAR_POINT_KNOT1, 0, true)); - if (star->flatsided == false) { + c->moveto(sp_star_get_xy (this, SP_STAR_POINT_KNOT1, 0, true)); + + if (this->flatsided == false) { if (not_rounded) { - c->lineto(sp_star_get_xy (star, SP_STAR_POINT_KNOT2, 0, true)); + c->lineto(sp_star_get_xy (this, SP_STAR_POINT_KNOT2, 0, true)); } else { - c->curveto(sp_star_get_curvepoint (star, SP_STAR_POINT_KNOT1, 0, NEXT), - sp_star_get_curvepoint (star, SP_STAR_POINT_KNOT2, 0, PREV), - sp_star_get_xy (star, SP_STAR_POINT_KNOT2, 0, true)); + c->curveto(sp_star_get_curvepoint (this, SP_STAR_POINT_KNOT1, 0, NEXT), + sp_star_get_curvepoint (this, SP_STAR_POINT_KNOT2, 0, PREV), + sp_star_get_xy (this, SP_STAR_POINT_KNOT2, 0, true)); } } // draw all middle segments for (gint i = 1; i < sides; i++) { if (not_rounded) { - c->lineto(sp_star_get_xy (star, SP_STAR_POINT_KNOT1, i, true)); + c->lineto(sp_star_get_xy (this, SP_STAR_POINT_KNOT1, i, true)); } else { - if (star->flatsided == false) { - c->curveto(sp_star_get_curvepoint (star, SP_STAR_POINT_KNOT2, i - 1, NEXT), - sp_star_get_curvepoint (star, SP_STAR_POINT_KNOT1, i, PREV), - sp_star_get_xy (star, SP_STAR_POINT_KNOT1, i, true)); + if (this->flatsided == false) { + c->curveto(sp_star_get_curvepoint (this, SP_STAR_POINT_KNOT2, i - 1, NEXT), + sp_star_get_curvepoint (this, SP_STAR_POINT_KNOT1, i, PREV), + sp_star_get_xy (this, SP_STAR_POINT_KNOT1, i, true)); } else { - c->curveto(sp_star_get_curvepoint (star, SP_STAR_POINT_KNOT1, i - 1, NEXT), - sp_star_get_curvepoint (star, SP_STAR_POINT_KNOT1, i, PREV), - sp_star_get_xy (star, SP_STAR_POINT_KNOT1, i, true)); + c->curveto(sp_star_get_curvepoint (this, SP_STAR_POINT_KNOT1, i - 1, NEXT), + sp_star_get_curvepoint (this, SP_STAR_POINT_KNOT1, i, PREV), + sp_star_get_xy (this, SP_STAR_POINT_KNOT1, i, true)); } } - if (star->flatsided == false) { + if (this->flatsided == false) { if (not_rounded) { - c->lineto(sp_star_get_xy (star, SP_STAR_POINT_KNOT2, i, true)); + c->lineto(sp_star_get_xy (this, SP_STAR_POINT_KNOT2, i, true)); } else { - c->curveto(sp_star_get_curvepoint (star, SP_STAR_POINT_KNOT1, i, NEXT), - sp_star_get_curvepoint (star, SP_STAR_POINT_KNOT2, i, PREV), - sp_star_get_xy (star, SP_STAR_POINT_KNOT2, i, true)); + c->curveto(sp_star_get_curvepoint (this, SP_STAR_POINT_KNOT1, i, NEXT), + sp_star_get_curvepoint (this, SP_STAR_POINT_KNOT2, i, PREV), + sp_star_get_xy (this, SP_STAR_POINT_KNOT2, i, true)); } } } // draw last segment - if (!not_rounded) { - if (star->flatsided == false) { - c->curveto(sp_star_get_curvepoint (star, SP_STAR_POINT_KNOT2, sides - 1, NEXT), - sp_star_get_curvepoint (star, SP_STAR_POINT_KNOT1, 0, PREV), - sp_star_get_xy (star, SP_STAR_POINT_KNOT1, 0, true)); - } else { - c->curveto(sp_star_get_curvepoint (star, SP_STAR_POINT_KNOT1, sides - 1, NEXT), - sp_star_get_curvepoint (star, SP_STAR_POINT_KNOT1, 0, PREV), - sp_star_get_xy (star, SP_STAR_POINT_KNOT1, 0, true)); - } - } + if (!not_rounded) { + if (this->flatsided == false) { + c->curveto(sp_star_get_curvepoint (this, SP_STAR_POINT_KNOT2, sides - 1, NEXT), + sp_star_get_curvepoint (this, SP_STAR_POINT_KNOT1, 0, PREV), + sp_star_get_xy (this, SP_STAR_POINT_KNOT1, 0, true)); + } else { + c->curveto(sp_star_get_curvepoint (this, SP_STAR_POINT_KNOT1, sides - 1, NEXT), + sp_star_get_curvepoint (this, SP_STAR_POINT_KNOT1, 0, PREV), + sp_star_get_xy (this, SP_STAR_POINT_KNOT1, 0, true)); + } + } c->closepath(); /* Reset the shape'scurve to the "original_curve" * This is very important for LPEs to work properly! (the bbox might be recalculated depending on the curve in shape)*/ - shape->setCurveInsync( c, TRUE); - shape->setCurveBeforeLPE( c ); - if (sp_lpe_item_has_path_effect(SP_LPE_ITEM(shape)) && sp_lpe_item_path_effects_enabled(SP_LPE_ITEM(shape))) { + this->setCurveInsync( c, TRUE); + this->setCurveBeforeLPE( c ); + + if (sp_lpe_item_has_path_effect(SP_LPE_ITEM(this)) && sp_lpe_item_path_effects_enabled(SP_LPE_ITEM(this))) { SPCurve *c_lpe = c->copy(); - bool success = sp_lpe_item_perform_path_effect(SP_LPE_ITEM (shape), c_lpe); + bool success = sp_lpe_item_perform_path_effect(SP_LPE_ITEM (this), c_lpe); + if (success) { - shape->setCurveInsync( c_lpe, TRUE); + this->setCurveInsync( c_lpe, TRUE); } + c_lpe->unref(); } + c->unref(); } @@ -486,11 +490,13 @@ sp_star_position_set (SPStar *star, gint sides, Geom::Point center, gdouble r1, star->sides = CLAMP(sides, 3, 1024); star->center = center; star->r[0] = MAX (r1, 0.001); + if (isflat == false) { star->r[1] = CLAMP(r2, 0.0, star->r[0]); } else { star->r[1] = CLAMP( r1*cos(M_PI/sides) ,0.0, star->r[0] ); } + star->arg[0] = arg1; star->arg[1] = arg2; star->flatsided = isflat; @@ -499,9 +505,7 @@ sp_star_position_set (SPStar *star, gint sides, Geom::Point center, gdouble r1, star->requestDisplayUpdate(SP_OBJECT_MODIFIED_FLAG); } -void CStar::snappoints(std::vector &p, Inkscape::SnapPreferences const *snapprefs) { - SPStar* item = this->spstar; - +void SPStar::snappoints(std::vector &p, Inkscape::SnapPreferences const *snapprefs) { // We will determine the star's midpoint ourselves, instead of trusting on the base class // Therefore snapping to object midpoints is temporarily disabled Inkscape::SnapPreferences local_snapprefs = *snapprefs; @@ -511,8 +515,8 @@ void CStar::snappoints(std::vector &p, Inkscape::S CShape::snappoints(p, &local_snapprefs); if (snapprefs->isTargetSnappable(Inkscape::SNAPTARGET_OBJECT_MIDPOINT)) { - Geom::Affine const i2dt (item->i2dt_affine ()); - p.push_back(Inkscape::SnapCandidatePoint(SP_STAR(item)->center * i2dt,Inkscape::SNAPSOURCE_OBJECT_MIDPOINT, Inkscape::SNAPTARGET_OBJECT_MIDPOINT)); + Geom::Affine const i2dt (this->i2dt_affine ()); + p.push_back(Inkscape::SnapCandidatePoint(this->center * i2dt,Inkscape::SNAPSOURCE_OBJECT_MIDPOINT, Inkscape::SNAPTARGET_OBJECT_MIDPOINT)); } } @@ -526,7 +530,6 @@ void CStar::snappoints(std::vector &p, Inkscape::S * * Initial item coordinate system is same as document coordinate system. */ - Geom::Point sp_star_get_xy (SPStar const *star, SPStarPoint point, gint index, bool randomized) { -- cgit v1.2.3 From cfe48de7f071e2e07a1f2f2ace3456f7b410e93b Mon Sep 17 00:00:00 2001 From: Markus Engel Date: Fri, 5 Apr 2013 15:37:33 +0200 Subject: Merged Shape and subclasses. Cleaned up a bit. (bzr r11608.1.76) --- src/sp-star.cpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'src/sp-star.cpp') diff --git a/src/sp-star.cpp b/src/sp-star.cpp index 8414c6d9a..68e85c1fd 100644 --- a/src/sp-star.cpp +++ b/src/sp-star.cpp @@ -43,7 +43,6 @@ namespace { } SPStar::SPStar() : SPPolygon() { - this->cshape = this; this->clpeitem = this; this->citem = this; this->cobject = this; @@ -63,7 +62,7 @@ SPStar::~SPStar() { void SPStar::build(SPDocument * document, Inkscape::XML::Node * repr) { // CPPIFY: see header file - CShape::build(document, repr); + SPShape::build(document, repr); this->readAttr( "sodipodi:cx" ); this->readAttr( "sodipodi:cy" ); @@ -103,7 +102,7 @@ Inkscape::XML::Node* SPStar::write(Inkscape::XML::Document *xml_doc, Inkscape::X g_free(d); // CPPIFY: see header file - CShape::write(xml_doc, repr, flags); + SPShape::write(xml_doc, repr, flags); return repr; } @@ -221,7 +220,7 @@ void SPStar::set(unsigned int key, const gchar* value) { default: // CPPIFY: see header file - CShape::set(key, value); + SPShape::set(key, value); break; } } @@ -231,11 +230,11 @@ void SPStar::update(SPCtx *ctx, guint flags) { SP_OBJECT_STYLE_MODIFIED_FLAG | SP_OBJECT_VIEWPORT_MODIFIED_FLAG)) { - this->setShape(); + this->set_shape(); } // CPPIFY: see header file - CShape::update(ctx, flags); + SPShape::update(ctx, flags); } void SPStar::update_patheffect(bool write) { @@ -512,7 +511,7 @@ void SPStar::snappoints(std::vector &p, Inkscape:: local_snapprefs.setTargetSnappable(Inkscape::SNAPTARGET_OBJECT_MIDPOINT, false); // CPPIFY: see header file - CShape::snappoints(p, &local_snapprefs); + SPShape::snappoints(p, &local_snapprefs); if (snapprefs->isTargetSnappable(Inkscape::SNAPTARGET_OBJECT_MIDPOINT)) { Geom::Affine const i2dt (this->i2dt_affine ()); -- cgit v1.2.3 From 19d00efa85cfc42ccae9bd17ef575602f0d22c50 Mon Sep 17 00:00:00 2001 From: Markus Engel Date: Fri, 5 Apr 2013 19:42:32 +0200 Subject: Merged more classes. (bzr r11608.1.78) --- src/sp-star.cpp | 1 - 1 file changed, 1 deletion(-) (limited to 'src/sp-star.cpp') diff --git a/src/sp-star.cpp b/src/sp-star.cpp index 68e85c1fd..8c7ebaf52 100644 --- a/src/sp-star.cpp +++ b/src/sp-star.cpp @@ -43,7 +43,6 @@ namespace { } SPStar::SPStar() : SPPolygon() { - this->clpeitem = this; this->citem = this; this->cobject = this; -- cgit v1.2.3 From 8073924aacdda310fb7492750f78d5389b3186af Mon Sep 17 00:00:00 2001 From: Markus Engel Date: Fri, 5 Apr 2013 22:45:01 +0200 Subject: Merged Item. (bzr r11608.1.81) --- src/sp-star.cpp | 1 - 1 file changed, 1 deletion(-) (limited to 'src/sp-star.cpp') diff --git a/src/sp-star.cpp b/src/sp-star.cpp index 8c7ebaf52..489c896b9 100644 --- a/src/sp-star.cpp +++ b/src/sp-star.cpp @@ -43,7 +43,6 @@ namespace { } SPStar::SPStar() : SPPolygon() { - this->citem = this; this->cobject = this; this->sides = 5; -- cgit v1.2.3 From 27e2102f96a5554bcd5310ec11435d155773b279 Mon Sep 17 00:00:00 2001 From: Markus Engel Date: Sun, 7 Apr 2013 18:28:22 +0200 Subject: Merge Object and subclasses. Merging of SP- and C-classes complete. (bzr r11608.1.86) --- src/sp-star.cpp | 2 -- 1 file changed, 2 deletions(-) (limited to 'src/sp-star.cpp') diff --git a/src/sp-star.cpp b/src/sp-star.cpp index 489c896b9..4a3a8cbe3 100644 --- a/src/sp-star.cpp +++ b/src/sp-star.cpp @@ -43,8 +43,6 @@ namespace { } SPStar::SPStar() : SPPolygon() { - this->cobject = this; - this->sides = 5; this->center = Geom::Point(0, 0); this->r[0] = 1.0; -- cgit v1.2.3