summaryrefslogtreecommitdiffstats
path: root/src/sp-title.cpp
diff options
context:
space:
mode:
authorMarkus Engel <markus.engel@tum.de>2012-08-20 21:48:42 +0000
committerMarkus Engel <markus.engel@tum.de>2012-08-20 21:48:42 +0000
commitfa1b664180baa1ec99b8d5b9ec7c8b21c7203c9f (patch)
treeda8223be6032c272ad1331fab1b297c35d1b5600 /src/sp-title.cpp
parentAs all subclasses of SPItem now have "virtual pads" with correct inheritance,... (diff)
downloadinkscape-fa1b664180baa1ec99b8d5b9ec7c8b21c7203c9f.tar.gz
inkscape-fa1b664180baa1ec99b8d5b9ec7c8b21c7203c9f.zip
Added "virtual pad" to SPTitle.
(bzr r11608.1.31)
Diffstat (limited to 'src/sp-title.cpp')
-rw-r--r--src/sp-title.cpp33
1 files changed, 23 insertions, 10 deletions
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);
+}