From fa1b664180baa1ec99b8d5b9ec7c8b21c7203c9f Mon Sep 17 00:00:00 2001 From: Markus Engel Date: Mon, 20 Aug 2012 23:48:42 +0200 Subject: Added "virtual pad" to SPTitle. (bzr r11608.1.31) --- src/sp-title.cpp | 33 +++++++++++++++++++++++---------- 1 file changed, 23 insertions(+), 10 deletions(-) (limited to 'src/sp-title.cpp') diff --git a/src/sp-title.cpp b/src/sp-title.cpp index ddeccede2..c7739823c 100644 --- a/src/sp-title.cpp +++ b/src/sp-title.cpp @@ -52,23 +52,36 @@ sp_title_class_init(SPTitleClass *klass) sp_object_class->write = sp_title_write; } +CTitle::CTitle(SPTitle* title) : CObject(title) { + this->sptitle = title; +} + +CTitle::~CTitle() { +} + static void -sp_title_init(SPTitle */*desc*/) +sp_title_init(SPTitle *desc) { + desc->ctitle = new CTitle(desc); + desc->cobject = desc->ctitle; } -/** - * Writes it's settings to an incoming repr object, if any. - */ -static Inkscape::XML::Node *sp_title_write(SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags) -{ +Inkscape::XML::Node* CTitle::onWrite(Inkscape::XML::Document *xml_doc, Inkscape::XML::Node *repr, guint flags) { + SPTitle* object = this->sptitle; + if (!repr) { - repr = object->getRepr()->duplicate(doc); + repr = object->getRepr()->duplicate(xml_doc); } - if (((SPObjectClass *) title_parent_class)->write) { - ((SPObjectClass *) title_parent_class)->write(object, doc, repr, flags); - } + CObject::onWrite(xml_doc, repr, flags); return repr; } + +/** + * Writes it's settings to an incoming repr object, if any. + */ +static Inkscape::XML::Node *sp_title_write(SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags) +{ + return ((SPTitle*)object)->ctitle->onWrite(doc, repr, flags); +} -- cgit v1.2.3