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/sp-switch.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/sp-switch.cpp')
| -rw-r--r-- | src/sp-switch.cpp | 12 |
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() ) { |
