Package: calligra / 1:2.8.5+dfsg-1

channelFlags_logic_change Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
Index: calligra/krita/image/tests/kis_layer_test.cpp
===================================================================
--- calligra.orig/krita/image/tests/kis_layer_test.cpp	2014-07-12 18:40:22.912145877 +0200
+++ calligra/krita/image/tests/kis_layer_test.cpp	2014-07-12 18:47:50.727436635 +0200
@@ -63,11 +63,16 @@
     QBitArray channels(4);
     channels.fill(true);
     layer->setChannelFlags(channels);
-    QVERIFY(layer->channelFlags().count() == 4);
-    QCOMPARE(layer->channelFlags().at(0), true);
-    QCOMPARE(layer->channelFlags().at(1), true);
-    QCOMPARE(layer->channelFlags().at(2), true);
-    QCOMPARE(layer->channelFlags().at(3), true);
+    QBitArray layerChannelFlags = layer->channelFlags();
+    if (layerChannelFlags.isEmpty()) {
+        layerChannelFlags =
+            QBitArray(layer->colorSpace()->channelCount(), true);
+    }
+    QVERIFY(layerChannelFlags.count() == 4);
+    QCOMPARE(layerChannelFlags.at(0), true);
+    QCOMPARE(layerChannelFlags.at(1), true);
+    QCOMPARE(layerChannelFlags.at(2), true);
+    QCOMPARE(layerChannelFlags.at(3), true);
 
 
     layer->setOpacity(OPACITY_TRANSPARENT_U8);