summaryrefslogtreecommitdiffstats
path: root/src/sp-tref.cpp
diff options
context:
space:
mode:
authorMarkus Engel <markus.engel@tum.de>2013-04-01 23:41:30 +0000
committerMarkus Engel <markus.engel@tum.de>2013-04-01 23:41:30 +0000
commit69f3b6f1abb2bb422935d43262e1e99aab359954 (patch)
treee1e2d2b0504d22e81b04501155995f5694a4cd7b /src/sp-tref.cpp
parentAdded experimental constructor to SPRect. Memory leaks because of non-virtual... (diff)
downloadinkscape-69f3b6f1abb2bb422935d43262e1e99aab359954.tar.gz
inkscape-69f3b6f1abb2bb422935d43262e1e99aab359954.zip
Added constructors to SP classes.
(bzr r11608.1.67)
Diffstat (limited to 'src/sp-tref.cpp')
-rw-r--r--src/sp-tref.cpp16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/sp-tref.cpp b/src/sp-tref.cpp
index 398304e4c..83b0746d8 100644
--- a/src/sp-tref.cpp
+++ b/src/sp-tref.cpp
@@ -57,7 +57,7 @@ static void sp_tref_finalize(GObject *obj);
static void sp_tref_href_changed(SPObject *old_ref, SPObject *ref, SPTRef *tref);
static void sp_tref_delete_self(SPObject *deleted, SPTRef *self);
-G_DEFINE_TYPE(SPTRef, sp_tref, SP_TYPE_ITEM);
+G_DEFINE_TYPE(SPTRef, sp_tref, G_TYPE_OBJECT);
static void
sp_tref_class_init(SPTRefClass *tref_class)
@@ -73,9 +73,9 @@ CTRef::CTRef(SPTRef* tref) : CItem(tref) {
CTRef::~CTRef() {
}
-static void
-sp_tref_init(SPTRef *tref)
-{
+SPTRef::SPTRef() : SPItem() {
+ SPTRef* tref = this;
+
tref->ctref = new CTRef(tref);
tref->typeHierarchy.insert(typeid(SPTRef));
@@ -83,6 +83,8 @@ sp_tref_init(SPTRef *tref)
tref->citem = tref->ctref;
tref->cobject = tref->ctref;
+ tref->stringChild = NULL;
+
new (&tref->attributes) TextTagAttributes;
tref->href = NULL;
@@ -95,6 +97,12 @@ sp_tref_init(SPTRef *tref)
}
static void
+sp_tref_init(SPTRef *tref)
+{
+ new (tref) SPTRef();
+}
+
+static void
sp_tref_finalize(GObject *obj)
{
SPTRef *tref = (SPTRef *) obj;