summaryrefslogtreecommitdiffstats
path: root/src/sp-switch.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/sp-switch.cpp')
-rw-r--r--src/sp-switch.cpp12
1 files changed, 9 insertions, 3 deletions
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 <sigc++/functors/ptr_fun.h>
#include <sigc++/adaptors/bind.h>
-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() ) {