[squeak-dev] [BUG] TableLayout & #disableLayout

Thiede, Christoph Christoph.Thiede at student.hpi.uni-potsdam.de
Fri Apr 3 18:30:59 UTC 2020


Hi all, I think I found a bug in the TableLayout when used in connection with #disableLayout.


Example to reproduce:

m := Morph new.
m
changeTableLayout;
listDirection: #rightToLeft;
wrapCentering: #center.
n := Morph new color: Color red.
n
visible: false;
disableLayout: true.
m addMorph: n.

m fullBounds.


Expected output:

Same as [n fullBounds].


Actual output:

Error: subscript is out of bounds: 1 in TableLayout >> #computeExtraSpacing:in:horizontal:target:


Problem:

arrangement is nil.

In #layout:in:, cells is 0 at 0->#(). This is an invalid state, isn't it?

The bug could have occurred because the initial #hasSubmorphs check in #layout:in: does not work if the only submorphs have #disableLayout set.

Would it be an appropriate solution to exit the method after step 1, if cells value isEmpty?


I never have worked with LayoutPolicies in detail, thus I likely only see a small part of the problem. I also don't see why listDirection #leftToRight is handled fundamentally differently than #rightToLeft. Any help is appreciated! :-)


Best,

Christoph
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20200403/62e3c019/attachment.html>


More information about the Squeak-dev mailing list