[squeak-dev] The Trunk: Multilingual-cmm.106.mcz

Chris Muller asqueaker at gmail.com
Tue Mar 23 19:51:23 UTC 2010


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 <josh at schwa.ca> 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,  <commits at source.squeak.org> 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!
>>>
>>>
>>>
>>
>
>
>
-------------- next part --------------
23 March 2010 1:34:21.488 pm

VM: unix - Smalltalk
Image: Squeak4.1alpha [latest update: #9765]

SecurityManager state:
Restricted: false
FileAccess: true
SocketAccess: true

MorphExtension>>valueOfProperty:
	Receiver: a MorphExtension (2044)
	Arguments and temporary variables: 
		aSymbol: 	#relativeTextAnchorPosition
	Receiver's instance variables: 
		locked: 	false
		visible: 	true
		sticky: 	false
		balloonText: 	nil
		balloonTextSelector: 	nil
		externalName: 	nil
		isPartsDonor: 	false
		actorState: 	nil
		player: 	nil
		eventHandler: 	nil
		otherProperties: 	nil

RectangleMorph(Morph)>>valueOfProperty:
	Receiver: a RectangleMorph(1016)
	Arguments and temporary variables: 
		aSymbol: 	#relativeTextAnchorPosition
	Receiver's instance variables: 
		bounds: 	0 at 0 corner: 228 at 56
		owner: 	nil
		submorphs: 	#()
		fullBounds: 	0 at 0 corner: 228 at 56
		color: 	Color transparent
		extension: 	a MorphExtension (2044)
		borderWidth: 	1
		borderColor: 	Color green

RectangleMorph(Morph)>>relativeTextAnchorPosition
	Receiver: a RectangleMorph(1016)
	Arguments and temporary variables: 

	Receiver's instance variables: 
		bounds: 	0 at 0 corner: 228 at 56
		owner: 	nil
		submorphs: 	#()
		fullBounds: 	0 at 0 corner: 228 at 56
		color: 	Color transparent
		extension: 	a MorphExtension (2044)
		borderWidth: 	1
		borderColor: 	Color green

CompositionScanner>>placeEmbeddedObject:
	Receiver: a CompositionScanner
	Arguments and temporary variables: 
		anchoredMorph: 	a RectangleMorph(1016)
		descent: 	nil
	Receiver's instance variables: 
		destX: 	23138127
		lastIndex: 	101573
		xTable: 	#(0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 4 7...etc...
		destY: 	51
		stopConditions: 	a TextStopConditions
		text: 	a Text for 'This is a test: 

to see whether the bugs related to dragging...etc...
		textStyle: 	a TextStyle Bitmap DejaVu Sans 9
		alignment: 	0
		leftMargin: 	687
		rightMargin: 	660
		font: 	nil
		line: 	a TextLine 93 to: 0
		runStopIndex: 	93
		spaceCount: 	0
		spaceWidth: 	4
		emphasisCode: 	0
		kern: 	0
		indentationLevel: 	0
		wantsColumnBreaks: 	false
		pendingKernX: 	0
		spaceX: 	3
		spaceIndex: 	88
		lineHeight: 	56
		baseline: 	53
		lineHeightAtSpace: 	14
		baselineAtSpace: 	11


--- The full stack ---
MorphExtension>>valueOfProperty:
RectangleMorph(Morph)>>valueOfProperty:
RectangleMorph(Morph)>>relativeTextAnchorPosition
CompositionScanner>>placeEmbeddedObject:
 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TextAnchor>>emphasizeScanner:
[] in CompositionScanner(CharacterScanner)>>setFont
Array(SequenceableCollection)>>do:
CompositionScanner(CharacterScanner)>>setFont
CompositionScanner>>setFont
CompositionScanner(CharacterScanner)>>placeEmbeddedObject:
CompositionScanner>>placeEmbeddedObject:
TextAnchor>>emphasizeScanner:
[] in CompositionScanner(CharacterScanner)>>setFont
Array(SequenceableCollection)>>do:
CompositionScanner(CharacterScanner)>>setFont
CompositionScanner>>setFont
CompositionScanner(CharacterScanner)>>placeEmbeddedObject:
CompositionScanner>>placeEmbeddedObject:
TextAnchor>>emphasizeScanner:
[] in CompositionScanner(CharacterScanner)>>setFont
Array(SequenceableCollection)>>do:
CompositionScanner(CharacterScanner)>>setFont
CompositionScanner>>setFont
CompositionScanner(CharacterScanner)>>placeEmbeddedObject:
CompositionScanner>>placeEmbeddedObject:
TextAnchor>>emphasizeScanner:
[] in CompositionScanner(CharacterScanner)>>setFont
Array(SequenceableCollection)>>do:
CompositionScanner(CharacterScanner)>>setFont
CompositionScanner>>setFont
CompositionScanner(CharacterScanner)>>placeEmbeddedObject:
CompositionScanner>>placeEmbeddedObject:
TextAnchor>>emphasizeScanner:
[] in CompositionScanner(CharacterScanner)>>setFont
Array(SequenceableCollection)>>do:
CompositionScanner(CharacterScanner)>>setFont
CompositionScanner>>setFont
CompositionScanner(CharacterScanner)>>placeEmbeddedObject:
CompositionScanner>>placeEmbeddedObject:
TextAnchor>>emphasizeScanner:
[] in CompositionScanner(CharacterScanner)>>setFont
Array(SequenceableCollection)>>do:
CompositionScanner(CharacterScanner)>>setFont
CompositionScanner>>setFont
CompositionScanner(CharacterScanner)>>placeEmbeddedObject:
...etc...


More information about the Squeak-dev mailing list