Commit b9637823 authored by Dmitry Kazakov's avatar Dmitry Kazakov

Fix crash on OSX because of wrong implementation of KoShape::compareShapeZIndex()

Compare function should return false when comparing an item with itself

BUG:394068
parent 4e120525
......@@ -575,6 +575,14 @@ bool KoShape::compareShapeZIndex(KoShape *s1, KoShape *s2)
* inside KoShapeCreateCommand.
*/
/**
* The algorithm below doesn't correctly handel the case when the two pointers actually
* point to the same shape. So just check it is advance to guarantee strict weak ordering
* relation requirement
*/
if (s1 == s2) return false;
// First sort according to runThrough which is sort of a master level
KoShape *parentShapeS1 = s1->parent();
KoShape *parentShapeS2 = s2->parent();
......
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