summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMarkus Engel <markus.engel@tum.de>2012-08-21 12:41:57 +0000
committerMarkus Engel <markus.engel@tum.de>2012-08-21 12:41:57 +0000
commita6ee236472ac07f5719e41bc396163d485757dc6 (patch)
tree4a5e56a8d30fd47cb056bff81627298928557b14 /src
parentAdded "virtual pad" to (diff)
downloadinkscape-a6ee236472ac07f5719e41bc396163d485757dc6.tar.gz
inkscape-a6ee236472ac07f5719e41bc396163d485757dc6.zip
Fixed some virtual function calls in SPItem and SPUse that led to crashes as they were not implemented in the base class.
(bzr r11608.1.36)
Diffstat (limited to 'src')
-rw-r--r--src/sp-item.cpp11
-rw-r--r--src/sp-use.cpp7
2 files changed, 15 insertions, 3 deletions
diff --git a/src/sp-item.cpp b/src/sp-item.cpp
index e6cc563f6..ea78e2e99 100644
--- a/src/sp-item.cpp
+++ b/src/sp-item.cpp
@@ -1374,9 +1374,11 @@ void SPItem::adjust_livepatheffect (Geom::Affine const &postmul, bool set)
}
}
-// CPPIFY:: make pure virtual
+// CPPIFY:: make pure virtual?
+// Not all SPItems must necessarily have a set transform method!
Geom::Affine CItem::onSetTransform(Geom::Affine const &transform) {
- throw;
+// throw;
+ return transform;
}
/**
@@ -1443,6 +1445,11 @@ void SPItem::doWriteTransform(Inkscape::XML::Node *repr, Geom::Affine const &tra
gint preserve = prefs->getBool("/options/preservetransform/value", 0);
Geom::Affine transform_attr (transform);
+
+ // CPPIFY: check this code.
+ // If onSetTransform is not overridden, CItem::onSetTransform will return the transform it was given as a parameter.
+ // onSetTransform cannot be pure due to the fact that not all visible Items are transformable.
+
if ( // run the object's set_transform (i.e. embed transform) only if:
!preserve && // user did not chose to preserve all transforms
!clip_ref->getObject() && // the object does not have a clippath
diff --git a/src/sp-use.cpp b/src/sp-use.cpp
index eb089612b..1abda0d05 100644
--- a/src/sp-use.cpp
+++ b/src/sp-use.cpp
@@ -412,7 +412,12 @@ void CUse::onHide(unsigned int key) {
SP_ITEM(use->child)->invoke_hide(key);
}
- CItem::onHide(key);
+ // CPPIFY: This doesn't make no sense.
+ // CItem::onHide is pure. What was the idea behind these lines?
+// if (((SPItemClass *) parent_class)->hide) {
+// ((SPItemClass *) parent_class)->hide(item, key);
+// }
+// CItem::onHide(key);
}
static void