summaryrefslogtreecommitdiffstats
path: root/src/sp-anchor.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-anchor.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-anchor.cpp')
-rw-r--r--src/sp-anchor.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/sp-anchor.cpp b/src/sp-anchor.cpp
index 2c955419f..8a1feb61d 100644
--- a/src/sp-anchor.cpp
+++ b/src/sp-anchor.cpp
@@ -25,7 +25,7 @@
#include "ui/view/view.h"
#include "document.h"
-G_DEFINE_TYPE(SPAnchor, sp_anchor, SP_TYPE_GROUP);
+G_DEFINE_TYPE(SPAnchor, sp_anchor, G_TYPE_OBJECT);
static void sp_anchor_class_init(SPAnchorClass *ac)
{
@@ -38,8 +38,9 @@ CAnchor::CAnchor(SPAnchor* anchor) : CGroup(anchor) {
CAnchor::~CAnchor() {
}
-static void sp_anchor_init(SPAnchor *anchor)
-{
+SPAnchor::SPAnchor() : SPGroup() {
+ SPAnchor* anchor = this;
+
anchor->canchor = new CAnchor(anchor);
anchor->typeHierarchy.insert(typeid(SPAnchor));
@@ -52,6 +53,11 @@ static void sp_anchor_init(SPAnchor *anchor)
anchor->href = NULL;
}
+static void sp_anchor_init(SPAnchor *anchor)
+{
+ new (anchor) SPAnchor();
+}
+
void CAnchor::build(SPDocument *document, Inkscape::XML::Node *repr) {
SPAnchor* object = this->spanchor;