The Trunk: Collections-kks.801.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

The Trunk: Collections-kks.801.mcz

commits-2
Levente Uzonyi uploaded a new version of Collections to project The Trunk:
http://source.squeak.org/trunk/Collections-kks.801.mcz

==================== Summary ====================

Name: Collections-kks.801
Author: kks
Time: 9 July 2018, 8:20:57.318092 pm
UUID: ad558efb-0fea-41e7-9f20-ef7477b20704
Ancestors: Collections-ul.800

Attempt to retain as much styling as possible while filing in text from streams where the runs may fall short or extend beyond the string.

Based on Bob's suggestions at http://lists.squeakfoundation.org/pipermail/squeak-dev/2018-July/199530.html

=============== Diff against Collections-ul.800 ===============

Item was changed:
  ----- Method: Text>>setString:setRunsChecking: (in category 'private') -----
  setString: aString setRunsChecking: aRunArray
+ | stringSize runsSize |
- "Check runs and do the best you can to make them fit..."
-
  string := aString.
- "check the runs"
  aRunArray ifNil: [^ aString asText].
- (aRunArray isKindOf: RunArray) ifFalse: [^ aString asText].
- aRunArray runs size = aRunArray values size ifFalse: [^ aString asText].
- aRunArray size = aString size ifFalse: [^ aString asText].
 
+ "Check runs and do the best you can to make them fit..."
+ runsSize := aRunArray runs size.
+ runsSize = aRunArray values size ifFalse: [^ aString asText]. "raise error here?"
+ stringSize := string size.
+ runs := stringSize = runsSize
+ ifTrue: [aRunArray]
+ ifFalse: [ stringSize > runsSize
+ ifTrue: [aRunArray  addLast: {} times: stringSize - runsSize]
+ ifFalse: [aRunArray copyFrom: 1 to: stringSize]].!
- runs := aRunArray.!


Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: Collections-kks.801.mcz

Karl Ramberg
This change cause the HelpBrowser not work

Best,
Karl



On Mon, Jul 9, 2018 at 5:15 PM <[hidden email]> wrote:
Levente Uzonyi uploaded a new version of Collections to project The Trunk:
http://source.squeak.org/trunk/Collections-kks.801.mcz

==================== Summary ====================

Name: Collections-kks.801
Author: kks
Time: 9 July 2018, 8:20:57.318092 pm
UUID: ad558efb-0fea-41e7-9f20-ef7477b20704
Ancestors: Collections-ul.800

Attempt to retain as much styling as possible while filing in text from streams where the runs may fall short or extend beyond the string.

Based on Bob's suggestions at http://lists.squeakfoundation.org/pipermail/squeak-dev/2018-July/199530.html

=============== Diff against Collections-ul.800 ===============

Item was changed:
  ----- Method: Text>>setString:setRunsChecking: (in category 'private') -----
  setString: aString setRunsChecking: aRunArray
+       | stringSize runsSize |
-       "Check runs and do the best you can to make them fit..."
-
        string := aString.
-       "check the runs"
        aRunArray ifNil: [^ aString asText].
-       (aRunArray isKindOf: RunArray) ifFalse: [^ aString asText].
-       aRunArray runs size = aRunArray values size ifFalse: [^ aString asText].
-       aRunArray size = aString size ifFalse: [^ aString asText].

+       "Check runs and do the best you can to make them fit..."
+       runsSize := aRunArray runs size.
+       runsSize = aRunArray values size ifFalse: [^ aString asText]. "raise error here?"
+       stringSize := string size.
+       runs := stringSize = runsSize
+                               ifTrue: [aRunArray]
+                               ifFalse: [ stringSize > runsSize
+                                               ifTrue: [aRunArray  addLast: {} times: stringSize - runsSize]
+                                               ifFalse: [aRunArray copyFrom: 1 to: stringSize]].!
-       runs := aRunArray.!




Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: Collections-kks.801.mcz

K K Subbu
In reply to this post by commits-2
On Monday 09 July 2018 03:15 PM, [hidden email] wrote:
> + runsSize := aRunArray runs size.
> + runsSize = aRunArray values size ifFalse: [^ aString asText]. "raise error here?"

This seems wrong. It should have been
    runsSize := aRunArray size.
    aRunArray runs size = aRunArray values size.

I will test this and send a new patch

Regards .. Subbu