<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Helvetica,sans-serif;" dir="ltr">
<p>Hi all, I think I found a bug in the TableLayout when used in connection with #disableLayout.</p>
<p><br>
</p>
<p><b>Example to reproduce:</b></p>
<span style="font-size: 12pt;">m := Morph new.</span><br>
<span style="font-size: 12pt;">m</span><br>
<span style="font-size: 12pt; white-space: pre;"></span><span style="font-size: 12pt;">changeTableLayout;</span><br>
<span style="font-size: 12pt; white-space: pre;"></span><span style="font-size: 12pt;">listDirection: #rightToLeft;</span><br>
<span style="font-size: 12pt; white-space: pre;"></span><span style="font-size: 12pt;">wrapCentering: #center.</span><br>
<span style="font-size: 12pt;">n := Morph new color: Color red.</span><br>
<span style="font-size: 12pt;">n</span><br>
<span style="font-size: 12pt; white-space: pre;"></span><span style="font-size: 12pt;">visible: false;</span><br>
<span style="font-size: 12pt; white-space: pre;"></span><span style="font-size: 12pt;">disableLayout: true.</span><br>
<span style="font-size: 12pt;">m addMorph: n.</span><br>
<p></p>
<div>m fullBounds.</div>
<p></p>
<p><b><br>
</b></p>
<p></p>
<div><b></b></div>
<b>Expected output:</b>
<p></p>
<p>Same as [n fullBounds].</p>
<p><br>
</p>
<p><b>Actual output:</b></p>
<p>Error: subscript is out of bounds: 1 in <span>TableLayout >> #computeExtraSpacing:in:horizontal:target:</span><b></b><br>
</p>
<p><span><br>
</span></p>
<p><span><b>Problem:</b></span></p>
<p><span>arrangement is nil.</span></p>
<p><span>In <span>#layout:in:, cells is <span>0@0->#(). This is an invalid state, isn't it?</span></span></span></p>
<p><span><span><span>The bug could have occurred because the initial <span>#hasSubmorphs check in #layout:in: does not work if the only submorphs have #disableLayout set.</span></span></span></span></p>
<p>Would it be an appropriate solution to exit the method after step 1, if cells value isEmpty?</p>
<p><br>
</p>
<p>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! :-)</p>
<p><br>
</p>
<p>Best,</p>
<p>Christoph</p>
<div id="Signature">
<div id="divtagdefaultwrapper" dir="ltr" style="font-size: 12pt; color: rgb(0, 0, 0); font-family: Calibri, Helvetica, sans-serif, EmojiFont, "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols;">
<div name="divtagdefaultwrapper" style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:; margin:0">
<div>
<div class="_rp_T4" id="Item.MessagePartBody">
<div class="_rp_U4 ms-font-weight-regular ms-font-color-neutralDark rpHighlightAllClass rpHighlightBodyClass" id="Item.MessageUniqueBody" style="font-family:wf_segoe-ui_normal,"Segoe UI","Segoe WP",Tahoma,Arial,sans-serif,serif,EmojiFont">
<div dir="ltr">
<div id="divtagdefaultwrapper"><font face="Calibri,Helvetica,sans-serif,EmojiFont,Apple Color Emoji,Segoe UI Emoji,NotoColorEmoji,Segoe UI Symbol,Android Emoji,EmojiSymbols">
<div id="Signature">
<div style="margin:0px"><font style="font-family:Calibri,Arial,Helvetica,sans-serif,serif,EmojiFont"></font></div>
</div>
</font></div>
</div>
</div>
</div>
</div>
<div><font size="2" color="#808080"></font></div>
</div>
</div>
</div>
</div>
</body>
</html>