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-switch.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'src/sp-switch.cpp') diff --git a/src/sp-switch.cpp b/src/sp-switch.cpp index 68f021fda..fe5ae1db5 100644 --- a/src/sp-switch.cpp +++ b/src/sp-switch.cpp @@ -25,7 +25,7 @@ #include #include -G_DEFINE_TYPE(SPSwitch, sp_switch, SP_TYPE_GROUP); +G_DEFINE_TYPE(SPSwitch, sp_switch, G_TYPE_OBJECT); static void sp_switch_class_init (SPSwitchClass *) @@ -39,8 +39,9 @@ CSwitch::CSwitch(SPSwitch* sw) : CGroup(sw) { CSwitch::~CSwitch() { } -static void sp_switch_init (SPSwitch *sw) -{ +SPSwitch::SPSwitch() : SPGroup() { + SPSwitch* sw = this; + sw->cswitch = new CSwitch(sw); sw->typeHierarchy.insert(typeid(SPSwitch)); @@ -53,6 +54,11 @@ static void sp_switch_init (SPSwitch *sw) sw->_cached_item = 0; } +static void sp_switch_init (SPSwitch *sw) +{ + new (sw) SPSwitch(); +} + SPObject *SPSwitch::_evaluateFirst() { SPObject *first = 0; for (SPObject *child = this->firstChild() ; child && !first ; child = child->getNext() ) { -- cgit v1.2.3