The Trunk: Multilingual-cmm.106.mcz

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

The Trunk: Multilingual-cmm.106.mcz

commits-2
Chris Muller uploaded a new version of Multilingual to project The Trunk:
http://source.squeak.org/trunk/Multilingual-cmm.106.mcz

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

Name: Multilingual-cmm.106
Author: cmm
Time: 23 March 2010, 2:07:45.842 pm
UUID: 5df01747-88b8-4df7-80ad-dd2d3d263a04
Ancestors: Multilingual-nice.105

Fix for potential stack-overflow when trying to embed a Morph into a TextMorph.

=============== Diff against Multilingual-nice.105 ===============

Item was changed:
  ----- Method: MultiCharacterScanner>>placeEmbeddedObject: (in category 'scanning') -----
  placeEmbeddedObject: anchoredMorph
  "Place the anchoredMorph or return false if it cannot be placed.
  In any event, advance destX by its width."
  | w |
  "Workaround: The following should really use #textAnchorType"
  anchoredMorph relativeTextAnchorPosition ifNotNil:[^true].
+ destX _ destX + (w _ anchoredMorph width).
- destX := destX + (w := anchoredMorph width).
  (destX > rightMargin and: [(leftMargin + w) <= rightMargin])
  ifTrue: ["Won't fit, but would on next line"
  ^ false].
+ lastIndex _ lastIndex + 1.
+ "self setFont."  "Force recalculation of emphasis for next run"
- lastIndex := lastIndex + 1.
- self setFont.  "Force recalculation of emphasis for next run"
  ^ true!


Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: Multilingual-cmm.106.mcz

Karl Ramberg
Small nit,
shouldn't the assigment be := ?

Karl

On Tue, Mar 23, 2010 at 7:09 PM,  <[hidden email]> wrote:

> Chris Muller uploaded a new version of Multilingual to project The Trunk:
> http://source.squeak.org/trunk/Multilingual-cmm.106.mcz
>
> ==================== Summary ====================
>
> Name: Multilingual-cmm.106
> Author: cmm
> Time: 23 March 2010, 2:07:45.842 pm
> UUID: 5df01747-88b8-4df7-80ad-dd2d3d263a04
> Ancestors: Multilingual-nice.105
>
> Fix for potential stack-overflow when trying to embed a Morph into a TextMorph.
>
> =============== Diff against Multilingual-nice.105 ===============
>
> Item was changed:
>  ----- Method: MultiCharacterScanner>>placeEmbeddedObject: (in category 'scanning') -----
>  placeEmbeddedObject: anchoredMorph
>        "Place the anchoredMorph or return false if it cannot be placed.
>        In any event, advance destX by its width."
>        | w |
>        "Workaround: The following should really use #textAnchorType"
>        anchoredMorph relativeTextAnchorPosition ifNotNil:[^true].
> +       destX _ destX + (w _ anchoredMorph width).
> -       destX := destX + (w := anchoredMorph width).
>        (destX > rightMargin and: [(leftMargin + w) <= rightMargin])
>                ifTrue: ["Won't fit, but would on next line"
>                                ^ false].
> +       lastIndex _ lastIndex + 1.
> +       "self setFont."  "Force recalculation of emphasis for next run"
> -       lastIndex := lastIndex + 1.
> -       self setFont.  "Force recalculation of emphasis for next run"
>        ^ true!
>
>
>

Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: Multilingual-cmm.106.mcz

Josh Gargus
On Mar 23, 2010, at 12:28 PM, karl ramberg wrote:

> Small nit,
> shouldn't the assigment be := ?
>


I was about to ask the same question.  

Also, what are the implications of not sending #setFont?  Can this introduce visual glitches?

Cheers,
Josh



> Karl
>
> On Tue, Mar 23, 2010 at 7:09 PM,  <[hidden email]> wrote:
>> Chris Muller uploaded a new version of Multilingual to project The Trunk:
>> http://source.squeak.org/trunk/Multilingual-cmm.106.mcz
>>
>> ==================== Summary ====================
>>
>> Name: Multilingual-cmm.106
>> Author: cmm
>> Time: 23 March 2010, 2:07:45.842 pm
>> UUID: 5df01747-88b8-4df7-80ad-dd2d3d263a04
>> Ancestors: Multilingual-nice.105
>>
>> Fix for potential stack-overflow when trying to embed a Morph into a TextMorph.
>>
>> =============== Diff against Multilingual-nice.105 ===============
>>
>> Item was changed:
>>  ----- Method: MultiCharacterScanner>>placeEmbeddedObject: (in category 'scanning') -----
>>  placeEmbeddedObject: anchoredMorph
>>        "Place the anchoredMorph or return false if it cannot be placed.
>>        In any event, advance destX by its width."
>>        | w |
>>        "Workaround: The following should really use #textAnchorType"
>>        anchoredMorph relativeTextAnchorPosition ifNotNil:[^true].
>> +       destX _ destX + (w _ anchoredMorph width).
>> -       destX := destX + (w := anchoredMorph width).
>>        (destX > rightMargin and: [(leftMargin + w) <= rightMargin])
>>                ifTrue: ["Won't fit, but would on next line"
>>                                ^ false].
>> +       lastIndex _ lastIndex + 1.
>> +       "self setFont."  "Force recalculation of emphasis for next run"
>> -       lastIndex := lastIndex + 1.
>> -       self setFont.  "Force recalculation of emphasis for next run"
>>        ^ true!
>>
>>
>>
>


Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: Multilingual-cmm.106.mcz

laza
In reply to this post by Karl Ramberg
And how about those?

SystemNavigation default browseMethodsWithSourceString: ' _ '

Alex

On Tue, Mar 23, 2010 at 20:28, karl ramberg <[hidden email]> wrote:
Small nit,
shouldn't the assigment be := ?

Karl

On Tue, Mar 23, 2010 at 7:09 PM,  <[hidden email]> wrote:
> Chris Muller uploaded a new version of Multilingual to project The Trunk:
> http://source.squeak.org/trunk/Multilingual-cmm.106.mcz
>
> ==================== Summary ====================
>
> Name: Multilingual-cmm.106
> Author: cmm
> Time: 23 March 2010, 2:07:45.842 pm
> UUID: 5df01747-88b8-4df7-80ad-dd2d3d263a04
> Ancestors: Multilingual-nice.105
>
> Fix for potential stack-overflow when trying to embed a Morph into a TextMorph.
>
> =============== Diff against Multilingual-nice.105 ===============
>
> Item was changed:
>  ----- Method: MultiCharacterScanner>>placeEmbeddedObject: (in category 'scanning') -----
>  placeEmbeddedObject: anchoredMorph
>        "Place the anchoredMorph or return false if it cannot be placed.
>        In any event, advance destX by its width."
>        | w |
>        "Workaround: The following should really use #textAnchorType"
>        anchoredMorph relativeTextAnchorPosition ifNotNil:[^true].
> +       destX _ destX + (w _ anchoredMorph width).
> -       destX := destX + (w := anchoredMorph width).
>        (destX > rightMargin and: [(leftMargin + w) <= rightMargin])
>                ifTrue: ["Won't fit, but would on next line"
>                                ^ false].
> +       lastIndex _ lastIndex + 1.
> +       "self setFont."  "Force recalculation of emphasis for next run"
> -       lastIndex := lastIndex + 1.
> -       self setFont.  "Force recalculation of emphasis for next run"
>        ^ true!
>
>
>




Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: Multilingual-cmm.106.mcz

Chris Muller-3
In reply to this post by Josh Gargus
I have been running with this code since 2007, and have not noticed
any visual glitches.  But here is a copy of the (interrupted) stack
overflow I get without this fix.



On Tue, Mar 23, 2010 at 2:32 PM, Josh Gargus <[hidden email]> wrote:

> On Mar 23, 2010, at 12:28 PM, karl ramberg wrote:
>
>> Small nit,
>> shouldn't the assigment be := ?
>>
>
>
> I was about to ask the same question.
>
> Also, what are the implications of not sending #setFont?  Can this introduce visual glitches?
>
> Cheers,
> Josh
>
>
>
>> Karl
>>
>> On Tue, Mar 23, 2010 at 7:09 PM,  <[hidden email]> wrote:
>>> Chris Muller uploaded a new version of Multilingual to project The Trunk:
>>> http://source.squeak.org/trunk/Multilingual-cmm.106.mcz
>>>
>>> ==================== Summary ====================
>>>
>>> Name: Multilingual-cmm.106
>>> Author: cmm
>>> Time: 23 March 2010, 2:07:45.842 pm
>>> UUID: 5df01747-88b8-4df7-80ad-dd2d3d263a04
>>> Ancestors: Multilingual-nice.105
>>>
>>> Fix for potential stack-overflow when trying to embed a Morph into a TextMorph.
>>>
>>> =============== Diff against Multilingual-nice.105 ===============
>>>
>>> Item was changed:
>>>  ----- Method: MultiCharacterScanner>>placeEmbeddedObject: (in category 'scanning') -----
>>>  placeEmbeddedObject: anchoredMorph
>>>        "Place the anchoredMorph or return false if it cannot be placed.
>>>        In any event, advance destX by its width."
>>>        | w |
>>>        "Workaround: The following should really use #textAnchorType"
>>>        anchoredMorph relativeTextAnchorPosition ifNotNil:[^true].
>>> +       destX _ destX + (w _ anchoredMorph width).
>>> -       destX := destX + (w := anchoredMorph width).
>>>        (destX > rightMargin and: [(leftMargin + w) <= rightMargin])
>>>                ifTrue: ["Won't fit, but would on next line"
>>>                                ^ false].
>>> +       lastIndex _ lastIndex + 1.
>>> +       "self setFont."  "Force recalculation of emphasis for next run"
>>> -       lastIndex := lastIndex + 1.
>>> -       self setFont.  "Force recalculation of emphasis for next run"
>>>        ^ true!
>>>
>>>
>>>
>>
>
>
>



stackOverflow.txt (5K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: Multilingual-cmm.106.mcz

Josh Gargus
On Mar 23, 2010, at 12:51 PM, Chris Muller wrote:

> I have been running with this code since 2007, and have not noticed
> any visual glitches.  But here is a copy of the (interrupted) stack
> overflow I get without this fix.
>


I was just curious.  Even if there were artifacts, that would still beat a crash.  And even if there were, it wouldn't bother me, because I don't embed many morphs in text these days (I used to, a lot).  Are you still working on Maui?

Cheers,
Josh



>
>
> On Tue, Mar 23, 2010 at 2:32 PM, Josh Gargus <[hidden email]> wrote:
>> On Mar 23, 2010, at 12:28 PM, karl ramberg wrote:
>>
>>> Small nit,
>>> shouldn't the assigment be := ?
>>>
>>
>>
>> I was about to ask the same question.
>>
>> Also, what are the implications of not sending #setFont?  Can this introduce visual glitches?
>>
>> Cheers,
>> Josh
>>
>>
>>
>>> Karl
>>>
>>> On Tue, Mar 23, 2010 at 7:09 PM,  <[hidden email]> wrote:
>>>> Chris Muller uploaded a new version of Multilingual to project The Trunk:
>>>> http://source.squeak.org/trunk/Multilingual-cmm.106.mcz
>>>>
>>>> ==================== Summary ====================
>>>>
>>>> Name: Multilingual-cmm.106
>>>> Author: cmm
>>>> Time: 23 March 2010, 2:07:45.842 pm
>>>> UUID: 5df01747-88b8-4df7-80ad-dd2d3d263a04
>>>> Ancestors: Multilingual-nice.105
>>>>
>>>> Fix for potential stack-overflow when trying to embed a Morph into a TextMorph.
>>>>
>>>> =============== Diff against Multilingual-nice.105 ===============
>>>>
>>>> Item was changed:
>>>>  ----- Method: MultiCharacterScanner>>placeEmbeddedObject: (in category 'scanning') -----
>>>>  placeEmbeddedObject: anchoredMorph
>>>>        "Place the anchoredMorph or return false if it cannot be placed.
>>>>        In any event, advance destX by its width."
>>>>        | w |
>>>>        "Workaround: The following should really use #textAnchorType"
>>>>        anchoredMorph relativeTextAnchorPosition ifNotNil:[^true].
>>>> +       destX _ destX + (w _ anchoredMorph width).
>>>> -       destX := destX + (w := anchoredMorph width).
>>>>        (destX > rightMargin and: [(leftMargin + w) <= rightMargin])
>>>>                ifTrue: ["Won't fit, but would on next line"
>>>>                                ^ false].
>>>> +       lastIndex _ lastIndex + 1.
>>>> +       "self setFont."  "Force recalculation of emphasis for next run"
>>>> -       lastIndex := lastIndex + 1.
>>>> -       self setFont.  "Force recalculation of emphasis for next run"
>>>>        ^ true!
>>>>
>>>>
>>>>
>>>
>>
>>
>>
> <stackOverflow.txt>


Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: Multilingual-cmm.106.mcz

Chris Muller-3
Yes, Maui has been developed to a high level of refinement.  I'm still
testing, but it looks like I now have it working in the trunk image.
I'll send an announcement when I get the new version posted..

On Tue, Mar 23, 2010 at 3:45 PM, Josh Gargus <[hidden email]> wrote:

> On Mar 23, 2010, at 12:51 PM, Chris Muller wrote:
>
>> I have been running with this code since 2007, and have not noticed
>> any visual glitches.  But here is a copy of the (interrupted) stack
>> overflow I get without this fix.
>>
>
>
> I was just curious.  Even if there were artifacts, that would still beat a crash.  And even if there were, it wouldn't bother me, because I don't embed many morphs in text these days (I used to, a lot).  Are you still working on Maui?
>
> Cheers,
> Josh
>
>
>
>>
>>
>> On Tue, Mar 23, 2010 at 2:32 PM, Josh Gargus <[hidden email]> wrote:
>>> On Mar 23, 2010, at 12:28 PM, karl ramberg wrote:
>>>
>>>> Small nit,
>>>> shouldn't the assigment be := ?
>>>>
>>>
>>>
>>> I was about to ask the same question.
>>>
>>> Also, what are the implications of not sending #setFont?  Can this introduce visual glitches?
>>>
>>> Cheers,
>>> Josh
>>>
>>>
>>>
>>>> Karl
>>>>
>>>> On Tue, Mar 23, 2010 at 7:09 PM,  <[hidden email]> wrote:
>>>>> Chris Muller uploaded a new version of Multilingual to project The Trunk:
>>>>> http://source.squeak.org/trunk/Multilingual-cmm.106.mcz
>>>>>
>>>>> ==================== Summary ====================
>>>>>
>>>>> Name: Multilingual-cmm.106
>>>>> Author: cmm
>>>>> Time: 23 March 2010, 2:07:45.842 pm
>>>>> UUID: 5df01747-88b8-4df7-80ad-dd2d3d263a04
>>>>> Ancestors: Multilingual-nice.105
>>>>>
>>>>> Fix for potential stack-overflow when trying to embed a Morph into a TextMorph.
>>>>>
>>>>> =============== Diff against Multilingual-nice.105 ===============
>>>>>
>>>>> Item was changed:
>>>>>  ----- Method: MultiCharacterScanner>>placeEmbeddedObject: (in category 'scanning') -----
>>>>>  placeEmbeddedObject: anchoredMorph
>>>>>        "Place the anchoredMorph or return false if it cannot be placed.
>>>>>        In any event, advance destX by its width."
>>>>>        | w |
>>>>>        "Workaround: The following should really use #textAnchorType"
>>>>>        anchoredMorph relativeTextAnchorPosition ifNotNil:[^true].
>>>>> +       destX _ destX + (w _ anchoredMorph width).
>>>>> -       destX := destX + (w := anchoredMorph width).
>>>>>        (destX > rightMargin and: [(leftMargin + w) <= rightMargin])
>>>>>                ifTrue: ["Won't fit, but would on next line"
>>>>>                                ^ false].
>>>>> +       lastIndex _ lastIndex + 1.
>>>>> +       "self setFont."  "Force recalculation of emphasis for next run"
>>>>> -       lastIndex := lastIndex + 1.
>>>>> -       self setFont.  "Force recalculation of emphasis for next run"
>>>>>        ^ true!
>>>>>
>>>>>
>>>>>
>>>>
>>>
>>>
>>>
>> <stackOverflow.txt>
>
>
>