Commit 17ad4513 authored by Sebastian Sauer's avatar Sebastian Sauer

One more try to fix shape-sorting.

The reason for the latest problems was that run-through can have only two states; either
Foreground or Background whereas Foreground is always the default.

This fixes all testcases provided by Thorsten and Lassi while still keeps the other
testcase provided Thorsten, Uzak and myself working like before.
parent 3adf561c
......@@ -874,7 +874,7 @@ void KoShape::setTextRunAroundSide(TextRunAroundSide side, Through runThrought)
if (runThrought == Background) {
setRunThrough(-1);
} else {
setRunThrough(1);
setRunThrough(0); // run-through=Foreground is the default
}
} else {
setRunThrough(0);
......
......@@ -91,8 +91,8 @@ void TestShapeReorderCommand::testRunThroughSorting()
QCOMPARE(shapes.indexOf(&shape1), 2);
QCOMPARE(shapes.indexOf(&shape2), 0);
QCOMPARE(shapes.indexOf(&shape3), 4);
QCOMPARE(shapes.indexOf(&shape4), 3);
QCOMPARE(shapes.indexOf(&shape3), 3);
QCOMPARE(shapes.indexOf(&shape4), 4);
QCOMPARE(shapes.indexOf(&shape5), 1);
}
......@@ -144,17 +144,17 @@ void TestShapeReorderCommand::testParentChildSorting()
qSort(shapes.begin(), shapes.end(), KoShape::compareShapeZIndex);
QCOMPARE(shapes.indexOf(&shape1), 3);
QCOMPARE(shapes.indexOf(&shape2), 2);
QCOMPARE(shapes.indexOf(&shape3), 9);
QCOMPARE(shapes.indexOf(&shape4), 7);
QCOMPARE(shapes.indexOf(&shape5), 6);
QCOMPARE(shapes.indexOf(&shape6), 0);
QCOMPARE(shapes.indexOf(&shape7), 1);
QCOMPARE(shapes.indexOf(&container1), 8);
QCOMPARE(shapes.indexOf(&container2), 5);
QCOMPARE(shapes.indexOf(&container3), 4);
QCOMPARE(shapes.indexOf(&shape1), 2);
QCOMPARE(shapes.indexOf(&shape2), 0);
QCOMPARE(shapes.indexOf(&shape3), 7);
QCOMPARE(shapes.indexOf(&shape4), 6);
QCOMPARE(shapes.indexOf(&shape5), 5);
QCOMPARE(shapes.indexOf(&shape6), 8);
QCOMPARE(shapes.indexOf(&shape7), 9);
QCOMPARE(shapes.indexOf(&container1), 1);
QCOMPARE(shapes.indexOf(&container2), 4);
QCOMPARE(shapes.indexOf(&container3), 3);
}
void TestShapeReorderCommand::testBringToFront()
......
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