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-text.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-text.cpp')
| -rw-r--r-- | src/sp-text.cpp | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/sp-text.cpp b/src/sp-text.cpp index 8db9b5be3..6d9cd105d 100644 --- a/src/sp-text.cpp +++ b/src/sp-text.cpp @@ -61,7 +61,7 @@ /*##################################################### # SPTEXT #####################################################*/ -G_DEFINE_TYPE(SPText, sp_text, SP_TYPE_ITEM); +G_DEFINE_TYPE(SPText, sp_text, G_TYPE_OBJECT); static void sp_text_class_init (SPTextClass *classname) @@ -75,9 +75,9 @@ CText::CText(SPText* text) : CItem(text) { CText::~CText() { } -static void -sp_text_init (SPText *text) -{ +SPText::SPText() : SPItem() { + SPText* text = this; + text->ctext = new CText(text); text->typeHierarchy.insert(typeid(SPText)); @@ -89,6 +89,12 @@ sp_text_init (SPText *text) new (&text->attributes) TextTagAttributes; } +static void +sp_text_init (SPText *text) +{ + new (text) SPText(); +} + void CText::release() { SPText* object = this->sptext; |
