Commit 8f1d38f5 authored by Dmitry Kazakov's avatar Dmitry Kazakov

Don't crash when saving artistic text and text shapes

WARNING: it means that from now on, both types of text
         shapes can *NOT* be saved into *ANY* format

Otherwise I would need to implement cloneShape() for both of
the shapes which is not a trivial task.
parent a06dc1b5
......@@ -309,6 +309,7 @@ KoShape::~KoShape()
KoShape *KoShape::cloneShape() const
{
KIS_SAFE_ASSERT_RECOVER_NOOP(0 && "not implemented!");
return 0;
}
......
......@@ -172,7 +172,9 @@ KisShapeLayer::KisShapeLayer(const KisShapeLayer& _rhs, KoShapeBasedDocumentBase
initShapeLayer(controller, _rhs.m_d->paintDevice);
Q_FOREACH (KoShape *shape, _rhs.shapes()) {
addShape(shape->cloneShape());
KoShape *clonedShape = shape->cloneShape();
KIS_SAFE_ASSERT_RECOVER(clonedShape) { continue; }
addShape(clonedShape);
}
}
......@@ -188,12 +190,16 @@ KisShapeLayer::KisShapeLayer(const KisShapeLayer& _rhs, const KisShapeLayer &_ad
// copy in _rhs's shapes
Q_FOREACH (KoShape *shape, _rhs.shapes()) {
addShape(shape->cloneShape());
KoShape *clonedShape = shape->cloneShape();
KIS_SAFE_ASSERT_RECOVER(clonedShape) { continue; }
addShape(clonedShape);
}
// copy in _addShapes's shapes
Q_FOREACH (KoShape *shape, _addShapes.shapes()) {
addShape(shape->cloneShape());
KoShape *clonedShape = shape->cloneShape();
KIS_SAFE_ASSERT_RECOVER(clonedShape) { continue; }
addShape(clonedShape);
}
}
......
......@@ -99,7 +99,9 @@ KisShapeSelection::KisShapeSelection(const KisShapeSelection& rhs, KisSelection*
m_canvas->shapeManager()->addShape(this);
Q_FOREACH (KoShape *shape, rhs.shapes()) {
this->addShape(shape->cloneShape());
KoShape *clonedShape = shape->cloneShape();
KIS_SAFE_ASSERT_RECOVER(clonedShape) { continue; }
this->addShape(clonedShape);
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment