From a6ee236472ac07f5719e41bc396163d485757dc6 Mon Sep 17 00:00:00 2001 From: Markus Engel Date: Tue, 21 Aug 2012 14:41:57 +0200 Subject: 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) --- src/sp-item.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'src/sp-item.cpp') 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 -- cgit v1.2.3