[squeak-dev] The Trunk: Morphic-ct.2058.mcz

commits at source.squeak.org commits at source.squeak.org
Wed Jan 11 12:50:27 UTC 2023


Marcel Taeumel uploaded a new version of Morphic to project The Trunk:
http://source.squeak.org/trunk/Morphic-ct.2058.mcz

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

Name: Morphic-ct.2058
Author: ct
Time: 1 January 2023, 9:21:31.503211 pm
UUID: 02727fdc-2e41-be4a-92b1-7758d88ca11a
Ancestors: Morphic-ct.2056

Fixes dangling formatting of IndentingListItemMorph labels when the previous label was a text and is now replaced with a string. 
You can reproduce this behavior by inserting the following before the last line in FontImporterTool>>#labelOf::
	(label runs anySatisfy: #notEmpty) ifFalse: [label := label asString].

=============== Diff against Morphic-ct.2056 ===============

Item was added:
+ ----- Method: IndentingListItemMorph>>contents: (in category 'initialization') -----
+ contents: newContents
+ 
+ 	(newContents isText not and: [self hasAnyAttributeFromText]) ifTrue: [
+ 		"Make sure to reset attributes from previous label text."
+ 		^ self contents: newContents asText].
+ 	^ super contents: newContents!

Item was added:
+ ----- Method: IndentingListItemMorph>>hasAnyAttributeFromText (in category 'testing') -----
+ hasAnyAttributeFromText
+ 
+ 	^ (self valueOfProperty: #hasFontFromText ifAbsent: [false])
+ 		or: [self valueOfProperty: #hasEmphasisFromText ifAbsent: [false]]
+ 		or: [self valueOfProperty: #hasColorFromText ifAbsent: [false]]!

Item was changed:
  ----- Method: IndentingListItemMorph>>initializeFromText: (in category 'initialization') -----
  initializeFromText: aText
  	"Overridden to keep track of text-based attributes."
  	
  	| priorFont priorEmphasis priorColor |
  	priorFont := self font.
  	priorEmphasis := self emphasis.
  	priorColor := self color.
  	
  	super initializeFromText: aText.
  	
+ 	self setProperty: #hasFontFromText toValue: priorFont ~~ self font.
+ 	self setProperty: #hasEmphasisFromText toValue: priorFont ~~ self emphasis.
+ 	self setProperty: #hasColorFromText toValue: priorColor ~~ self color.!
- 	priorFont == self font
- 		ifFalse: [self setProperty: #hasFontFromText toValue: true].
- 	priorFont == self emphasis
- 		ifFalse: [self setProperty: #hasEmphasisFromText toValue: true].
- 	priorColor == self color
- 		ifFalse: [self setProperty: #hasColorFromText toValue: true].!



More information about the Squeak-dev mailing list