summaryrefslogtreecommitdiffstats
path: root/src/sp-shape.cpp
diff options
context:
space:
mode:
authorMarkus Engel <markus.engel@tum.de>2013-04-02 21:01:45 +0000
committerMarkus Engel <markus.engel@tum.de>2013-04-02 21:01:45 +0000
commit8443720ce6429b9beec839e60b8a808595f4ba72 (patch)
tree3e08d3c631c2590a19481613a6e31cf09f6bed42 /src/sp-shape.cpp
parentReplaced some forgotten old casting macros. (diff)
downloadinkscape-8443720ce6429b9beec839e60b8a808595f4ba72.tar.gz
inkscape-8443720ce6429b9beec839e60b8a808595f4ba72.zip
Cleaned up a bit. Uses some C++11 features.
(bzr r11608.1.72)
Diffstat (limited to 'src/sp-shape.cpp')
-rw-r--r--src/sp-shape.cpp38
1 files changed, 3 insertions, 35 deletions
diff --git a/src/sp-shape.cpp b/src/sp-shape.cpp
index babb4f029..fc80defb3 100644
--- a/src/sp-shape.cpp
+++ b/src/sp-shape.cpp
@@ -56,18 +56,6 @@
static void sp_shape_finalize (GObject *object);
static void sp_shape_update_marker_view (SPShape *shape, Inkscape::DrawingItem *ai);
-G_DEFINE_TYPE(SPShape, sp_shape, G_TYPE_OBJECT);
-
-/**
- * Initializes a SPShapeClass object. Establishes the function pointers to the class'
- * member routines in the class vtable, and sets pointers to parent classes.
- */
-static void
-sp_shape_class_init(SPShapeClass *klass)
-{
- GObjectClass *gobject_class = G_OBJECT_CLASS(klass);
- gobject_class->finalize = sp_shape_finalize;
-}
CShape::CShape(SPShape* shape) : CLPEItem(shape) {
this->spshape = shape;
@@ -76,7 +64,6 @@ CShape::CShape(SPShape* shape) : CLPEItem(shape) {
CShape::~CShape() {
}
-
SPShape::SPShape() : SPLPEItem() {
SPShape* shape = this;
@@ -97,29 +84,10 @@ SPShape::SPShape() : SPLPEItem() {
shape->_curve_before_lpe = NULL;
}
-/**
- * Initializes an SPShape object.
- */
-static void
-sp_shape_init(SPShape *shape)
-{
- new (shape) SPShape();
-}
-
-static void
-sp_shape_finalize(GObject *object)
-{
- SPShape *shape=(SPShape *)object;
-
+SPShape::~SPShape() {
for ( int i = 0 ; i < SP_MARKER_LOC_QTY ; i++ ) {
- shape->_release_connect[i].disconnect();
- shape->_release_connect[i].~connection();
- shape->_modified_connect[i].disconnect();
- shape->_modified_connect[i].~connection();
- }
-
- if (((GObjectClass *) (sp_shape_parent_class))->finalize) {
- (* ((GObjectClass *) (sp_shape_parent_class))->finalize)(object);
+ this->_release_connect[i].disconnect();
+ this->_modified_connect[i].disconnect();
}
}