<div dir="ltr"><div><div><div><div><div><div><div><div><div>Ah yes, but it&#39;s a multiple .mcz saga whose goal is to:<br>Remove the Multilingual specific classes for composing text layout.<br><br></div>And this episode is specifically about removal of presentation as said...<br>
</div>What is a presentation/presentationText/presentationLines ?<br></div>It is an artifact containing precomposed unicode produced by some Multi*Scanner.<br></div>Why to remove it?<br>Because we can compose/display/scan decomposed unicode and recompose on the fly without exhibiting the artifact.<br>
</div>But it yet remains to be implemented...<br></div><div>Anyway, the feature was broken and deconnected some years ago, so it seems that we have time to re-think how to implement it.<br></div><div><br></div>Generally it&#39;s a good thing to have self sufficient comments, so you are absolutely right.<br>
But sometimes there are long discussions associated in the mailing list which are hard to transcribe.<br></div>A reference to a bug report containing some discussion could be a good thing in this case, ...<br>... but we&#39;re getting lazy and have a lighter trunk process for some years.<br>
Can we have the cake and eat it too?<br></div>I know this is not a good excuse, but you must also consider that after 10 commits on the same subject, the saturated commiter&#39;s mind is getting facetious ;)<br></div>That&#39;s my case at least.<br>
<div><div><div><div><div><div><div><div><div><br></div></div></div></div></div></div></div></div></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">2013/9/30 Chris Muller <span dir="ltr">&lt;<a href="mailto:asqueaker@gmail.com" target="_blank">asqueaker@gmail.com</a>&gt;</span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">These version comments are redundant with the code-diff; we can see<br>
that &#39;presenatation&#39; vars are being removed, so could you also please<br>
explain _why_ changes are being made in version comments?<br>
<br>
Is this a cleanup?  And may we expect no impact to any paragraph /<br>
text-editor behaviors?<br>
<div class="HOEnZb"><div class="h5"><br>
On Tue, Sep 24, 2013 at 3:40 PM,  &lt;<a href="mailto:commits@source.squeak.org">commits@source.squeak.org</a>&gt; wrote:<br>
&gt; Nicolas Cellier uploaded a new version of Morphic to project The Trunk:<br>
&gt; <a href="http://source.squeak.org/trunk/Morphic-nice.687.mcz" target="_blank">http://source.squeak.org/trunk/Morphic-nice.687.mcz</a><br>
&gt;<br>
&gt; ==================== Summary ====================<br>
&gt;<br>
&gt; Name: Morphic-nice.687<br>
&gt; Author: nice<br>
&gt; Time: 24 September 2013, 10:40:04.266 pm<br>
&gt; UUID: a0a8b7f9-f0a3-4071-b95b-06124aa146a4<br>
&gt; Ancestors: Morphic-nice.686<br>
&gt;<br>
&gt; Expunge presentation* from MultiNewParagraph &amp; MultiTextComposer.<br>
&gt; Also remove those methods same as super.<br>
&gt; Note the small difference in displaying method: NewPragraph has offset truncated.<br>
&gt; Prepare MultiNewParagraph funerals by mutating its instances -&gt; NewParagraph<br>
&gt;<br>
&gt; =============== Diff against Morphic-nice.686 ===============<br>
&gt;<br>
&gt; Item was changed:<br>
&gt;   NewParagraph subclass: #MultiNewParagraph<br>
&gt; +       instanceVariableNames: &#39;&#39;<br>
&gt; -       instanceVariableNames: &#39;presentationText presentationLines&#39;<br>
&gt;         classVariableNames: &#39;&#39;<br>
&gt;         poolDictionaries: &#39;TextConstants&#39;<br>
&gt;         category: &#39;Morphic-Multilingual&#39;!<br>
&gt;<br>
&gt; Item was added:<br>
&gt; + ----- Method: MultiNewParagraph class&gt;&gt;initialize (in category &#39;class initialization&#39;) -----<br>
&gt; + initialize<br>
&gt; +       &quot;Prepare our own funeral&quot;<br>
&gt; +<br>
&gt; +       MultiNewParagraph allInstancesDo:[:mnp| mnp becomeForward: (mnp as: NewParagraph)]!<br>
&gt;<br>
&gt; Item was removed:<br>
&gt; - ----- Method: MultiNewParagraph&gt;&gt;multiComposeLinesFrom:to:delta:into:priorLines:atY: (in category &#39;composition&#39;) -----<br>
&gt; - multiComposeLinesFrom: start to: stop delta: delta into: lineColl priorLines: priorLines<br>
&gt; -       atY: startingY<br>
&gt; -       &quot;While the section from start to stop has changed, composition may ripple all the way to the end of the text.  However in a rectangular container, if we ever find a line beginning with the same character as before (ie corresponding to delta in the old lines), then we can just copy the old lines from there to the end of the container, with adjusted indices and y-values&quot;<br>

&gt; -<br>
&gt; -       | newResult composer presentationInfo |<br>
&gt; -<br>
&gt; -       composer := MultiTextComposer new.<br>
&gt; -       presentationLines := nil.<br>
&gt; -       presentationText := nil.<br>
&gt; -       newResult := composer<br>
&gt; -               multiComposeLinesFrom: start<br>
&gt; -               to: stop<br>
&gt; -               delta: delta<br>
&gt; -               into: lineColl<br>
&gt; -               priorLines: priorLines<br>
&gt; -               atY: startingY<br>
&gt; -               textStyle: textStyle<br>
&gt; -               text: text<br>
&gt; -               container: container<br>
&gt; -               wantsColumnBreaks: wantsColumnBreaks == true.<br>
&gt; -       lines := newResult first asArray.<br>
&gt; -       maxRightX := newResult second.<br>
&gt; -       presentationInfo := composer getPresentationInfo.<br>
&gt; -       presentationLines := presentationInfo first asArray.<br>
&gt; -       presentationText := presentationInfo second.<br>
&gt; -       &quot;maxRightX printString displayAt: 0@0.&quot;<br>
&gt; -       ^maxRightX<br>
&gt; - !<br>
&gt;<br>
&gt; Item was removed:<br>
&gt; - ----- Method: MultiNewParagraph&gt;&gt;presentationLines (in category &#39;accessing&#39;) -----<br>
&gt; - presentationLines<br>
&gt; -<br>
&gt; -       ^ presentationLines.<br>
&gt; - !<br>
&gt;<br>
&gt; Item was removed:<br>
&gt; - ----- Method: MultiNewParagraph&gt;&gt;presentationText (in category &#39;accessing&#39;) -----<br>
&gt; - presentationText<br>
&gt; -<br>
&gt; -       ^ presentationText.<br>
&gt; - !<br>
&gt;<br>
&gt; Item was changed:<br>
&gt;   TextComposer subclass: #MultiTextComposer<br>
&gt; +       instanceVariableNames: &#39;&#39;<br>
&gt; -       instanceVariableNames: &#39;presentation presentationLines&#39;<br>
&gt;         classVariableNames: &#39;&#39;<br>
&gt;         poolDictionaries: &#39;TextConstants&#39;<br>
&gt;         category: &#39;Morphic-Multilingual&#39;!<br>
&gt;<br>
&gt; Item was removed:<br>
&gt; - ----- Method: MultiTextComposer&gt;&gt;composeEachRectangleIn: (in category &#39;as yet unclassified&#39;) -----<br>
&gt; - composeEachRectangleIn: rectangles<br>
&gt; -<br>
&gt; -       | myLine lastChar |<br>
&gt; -<br>
&gt; -       1 to: rectangles size do: [:i |<br>
&gt; -               currCharIndex &lt;= theText size ifFalse: [^false].<br>
&gt; -               myLine := scanner<br>
&gt; -                       composeFrom: currCharIndex<br>
&gt; -                       inRectangle: (rectangles at: i)<br>
&gt; -                       firstLine: isFirstLine<br>
&gt; -                       leftSide: i=1<br>
&gt; -                       rightSide: i=rectangles size.<br>
&gt; -               lines addLast: myLine.<br>
&gt; -               presentationLines addLast: scanner getPresentationLine.<br>
&gt; -               presentation ifNil: [presentation := scanner getPresentation]<br>
&gt; -                       ifNotNil: [presentation := presentation, scanner getPresentation].<br>
&gt; -               actualHeight := actualHeight max: myLine lineHeight.  &quot;includes font changes&quot;<br>
&gt; -               currCharIndex := myLine last + 1.<br>
&gt; -               lastChar := theText at: myLine last.<br>
&gt; -               (CharacterSet crlf includes: lastChar) ifTrue: [^#cr].<br>
&gt; -               wantsColumnBreaks ifTrue: [<br>
&gt; -                       lastChar = TextComposer characterForColumnBreak ifTrue: [^#columnBreak].<br>
&gt; -               ].<br>
&gt; -       ].<br>
&gt; -       ^false!<br>
&gt;<br>
&gt; Item was removed:<br>
&gt; - ----- Method: MultiTextComposer&gt;&gt;getPresentationInfo (in category &#39;as yet unclassified&#39;) -----<br>
&gt; - getPresentationInfo<br>
&gt; -<br>
&gt; -       ^ Array with: presentationLines with: presentation.<br>
&gt; - !<br>
&gt;<br>
&gt; Item was changed:<br>
&gt;   ----- Method: MultiTextComposer&gt;&gt;multiComposeLinesFrom:to:delta:into:priorLines:atY:textStyle:text:container:wantsColumnBreaks: (in category &#39;as yet unclassified&#39;) -----<br>
&gt;   multiComposeLinesFrom: argStart to: argStop delta: argDelta into: argLinesCollection priorLines: argPriorLines atY: argStartY textStyle: argTextStyle text: argText container: argContainer wantsColumnBreaks: argWantsColumnBreaks<br>

&gt;<br>
&gt;         wantsColumnBreaks := argWantsColumnBreaks.<br>
&gt;         lines := argLinesCollection.<br>
&gt; -       presentationLines := argLinesCollection copy.<br>
&gt;         theTextStyle := argTextStyle.<br>
&gt;         theText := argText.<br>
&gt;         theContainer := argContainer.<br>
&gt;         deltaCharIndex := argDelta.<br>
&gt;         currCharIndex := startCharIndex := argStart.<br>
&gt;         stopCharIndex := argStop.<br>
&gt;         prevLines := argPriorLines.<br>
&gt;         currentY := argStartY.<br>
&gt;         defaultLineHeight := theTextStyle lineGrid.<br>
&gt;         maxRightX := theContainer left.<br>
&gt;         possibleSlide := stopCharIndex &lt; theText size and: [theContainer isMemberOf: Rectangle].<br>
&gt;         nowSliding := false.<br>
&gt;         prevIndex := 1.<br>
&gt;         scanner := MultiCompositionScanner new text: theText textStyle: theTextStyle.<br>
&gt;         scanner wantsColumnBreaks: wantsColumnBreaks.<br>
&gt;         isFirstLine := true.<br>
&gt;         self composeAllLines.<br>
&gt;         isFirstLine ifTrue: [&quot;No space in container or empty text&quot;<br>
&gt;                 self<br>
&gt;                         addNullLineWithIndex: startCharIndex<br>
&gt;                         andRectangle: (theContainer topLeft extent: 0@defaultLineHeight)<br>
&gt;         ] ifFalse: [<br>
&gt;                 self fixupLastLineIfCR<br>
&gt;         ].<br>
&gt;         ^{lines asArray. maxRightX}<br>
&gt;<br>
&gt;   !<br>
&gt;<br>
&gt; Item was removed:<br>
&gt; - ----- Method: NewParagraph&gt;&gt;testNewComposeAll3 (in category &#39;composition&#39;) -----<br>
&gt; - testNewComposeAll3<br>
&gt; -       | newResult |<br>
&gt; -       newResult := TextComposer new<br>
&gt; -               multiComposeLinesFrom: firstCharacterIndex<br>
&gt; -               to: text size<br>
&gt; -               delta: 0<br>
&gt; -               into: OrderedCollection new<br>
&gt; -               priorLines: Array new<br>
&gt; -               atY: container top<br>
&gt; -               textStyle: textStyle<br>
&gt; -               text: text<br>
&gt; -               container: (0@0 extent: 31@60)<br>
&gt; -               wantsColumnBreaks: false.<br>
&gt; -       ^{newResult. {lines. maxRightX}}<br>
&gt; - !<br>
&gt;<br>
&gt;<br>
<br>
</div></div></blockquote></div><br></div>