diff options
| author | Markus Engel <markus.engel@tum.de> | 2013-04-01 23:41:30 +0000 |
|---|---|---|
| committer | Markus Engel <markus.engel@tum.de> | 2013-04-01 23:41:30 +0000 |
| commit | 69f3b6f1abb2bb422935d43262e1e99aab359954 (patch) | |
| tree | e1e2d2b0504d22e81b04501155995f5694a4cd7b /src/live_effects/lpeobject.cpp | |
| parent | Added experimental constructor to SPRect. Memory leaks because of non-virtual... (diff) | |
| download | inkscape-69f3b6f1abb2bb422935d43262e1e99aab359954.tar.gz inkscape-69f3b6f1abb2bb422935d43262e1e99aab359954.zip | |
Added constructors to SP classes.
(bzr r11608.1.67)
Diffstat (limited to 'src/live_effects/lpeobject.cpp')
| -rw-r--r-- | src/live_effects/lpeobject.cpp | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/src/live_effects/lpeobject.cpp b/src/live_effects/lpeobject.cpp index d404b9743..15a8a26b6 100644 --- a/src/live_effects/lpeobject.cpp +++ b/src/live_effects/lpeobject.cpp @@ -35,14 +35,14 @@ LivePathEffectObject::livepatheffect_get_type () GTypeInfo livepatheffect_info = { sizeof (LivePathEffectObjectClass), NULL, NULL, - (GClassInitFunc) LivePathEffectObject::livepatheffect_class_init, + 0,//(GClassInitFunc) LivePathEffectObject::livepatheffect_class_init, NULL, NULL, sizeof (LivePathEffectObject), 16, (GInstanceInitFunc) LivePathEffectObject::livepatheffect_init, NULL, }; - livepatheffect_type = g_type_register_static (SP_TYPE_OBJECT, "LivePathEffectObject", &livepatheffect_info, (GTypeFlags)0); + livepatheffect_type = g_type_register_static (G_TYPE_OBJECT, "LivePathEffectObject", &livepatheffect_info, (GTypeFlags)0); } return livepatheffect_type; } @@ -74,12 +74,9 @@ CLivePathEffectObject::CLivePathEffectObject(LivePathEffectObject* lpeo) : CObje CLivePathEffectObject::~CLivePathEffectObject() { } -/** - * Callback to initialize livepatheffect object. - */ -void -LivePathEffectObject::livepatheffect_init(LivePathEffectObject *lpeobj) -{ +LivePathEffectObject::LivePathEffectObject() : SPObject() { + LivePathEffectObject* lpeobj = this; + #ifdef LIVEPATHEFFECT_VERBOSE g_message("Init livepatheffectobject"); #endif @@ -97,6 +94,15 @@ LivePathEffectObject::livepatheffect_init(LivePathEffectObject *lpeobj) } /** + * Callback to initialize livepatheffect object. + */ +void +LivePathEffectObject::livepatheffect_init(LivePathEffectObject *lpeobj) +{ + new (lpeobj) LivePathEffectObject(); +} + +/** * Virtual build: set livepatheffect attributes from its associated XML node. */ void CLivePathEffectObject::build(SPDocument *document, Inkscape::XML::Node *repr) { |
