summaryrefslogtreecommitdiffstats
path: root/src/sp-clippath.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-clippath.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-clippath.cpp')
-rw-r--r--src/sp-clippath.cpp14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/sp-clippath.cpp b/src/sp-clippath.cpp
index 3263bbb58..ff12f9678 100644
--- a/src/sp-clippath.cpp
+++ b/src/sp-clippath.cpp
@@ -40,7 +40,7 @@ struct SPClipPathView {
static SPClipPathView* sp_clippath_view_new_prepend(SPClipPathView *list, unsigned int key, Inkscape::DrawingItem *arenaitem);
static SPClipPathView* sp_clippath_view_list_remove(SPClipPathView *list, SPClipPathView *view);
-G_DEFINE_TYPE(SPClipPath, sp_clippath, SP_TYPE_OBJECTGROUP);
+G_DEFINE_TYPE(SPClipPath, sp_clippath, G_TYPE_OBJECT);
static void
sp_clippath_class_init(SPClipPathClass *klass)
@@ -54,9 +54,9 @@ CClipPath::CClipPath(SPClipPath* clippath) : CObjectGroup(clippath) {
CClipPath::~CClipPath() {
}
-static void
-sp_clippath_init(SPClipPath *cp)
-{
+SPClipPath::SPClipPath() : SPObjectGroup() {
+ SPClipPath* cp = this;
+
cp->cclippath = new CClipPath(cp);
cp->typeHierarchy.insert(typeid(SPClipPath));
@@ -70,6 +70,12 @@ sp_clippath_init(SPClipPath *cp)
cp->display = NULL;
}
+static void
+sp_clippath_init(SPClipPath *cp)
+{
+ new (cp) SPClipPath();
+}
+
void CClipPath::build(SPDocument* doc, Inkscape::XML::Node* repr) {
SPClipPath* object = this->spclippath;