Frank Shearar uploaded a new version of Collections to project The Trunk:
http://source.squeak.org/trunk/Collections-fbs.556.mcz ==================== Summary ==================== Name: Collections-fbs.556 Author: fbs Time: 3 January 2014, 4:28:00.204 pm UUID: 80422ba6-f9b2-fc4f-acb2-27a911950eb9 Ancestors: Collections-fbs.555 While we debate whether we should even have an #ignoreStyleIfOnlyBold preference, make it a pragma preference. =============== Diff against Collections-fbs.555 =============== Item was changed: ArrayedCollection subclass: #Text instanceVariableNames: 'string runs' + classVariableNames: 'IgnoreStyleIfOnlyBold' - classVariableNames: '' poolDictionaries: 'TextConstants' category: 'Collections-Text'! !Text commentStamp: '<historical>' prior: 0! I represent a character string that has been marked with abstract changes in character appearance. Actual display is performed in the presence of a TextStyle which indicates, for each abstract code, an actual font to be used. A Text associates a set of TextAttributes with each character in its character string. These attributes may be font numbers, emphases such as bold or italic, or hyperling actions. Font numbers are interpreted relative to whatever textStyle appears, along with the text, in a Paragraph. Since most characters have the same attributes as their neighbors, the attributes are stored in a RunArray for efficiency. Each of my instances has string a String runs a RunArray! Item was added: + ----- Method: Text class>>ignoreStyleIfOnlyBold (in category 'preferences') ----- + ignoreStyleIfOnlyBold + <preference: 'Ignore style if only bold' category: 'browsing' description: 'If true, then any method submission in which the only style change is for bolding will be trated as a method with no style specifications.' type: #Boolean> + ^ IgnoreStyleIfOnlyBold ifNil: [true].! Item was added: + ----- Method: Text class>>ignoreStyleIfOnlyBold: (in category 'preferences') ----- + ignoreStyleIfOnlyBold: aBoolean + IgnoreStyleIfOnlyBold := aBoolean.! Item was changed: ----- Method: Text>>unembellished (in category 'attributes') ----- unembellished "Return true if the only emphases are the default font and bold" | font1 bold | font1 := TextFontChange defaultFontChange. bold := TextEmphasis bold. + Text ignoreStyleIfOnlyBold ifFalse: - Preferences ignoreStyleIfOnlyBold ifFalse: ["Ignore font1 only or font1-bold followed by font1-plain" ^ (runs values = (Array with: (Array with: font1))) or: [runs values = (Array with: (Array with: font1 with: bold) with: (Array with: font1))]]. "If preference is set, then ignore any combo of font1 and bold" runs withStartStopAndValueDo: [:start :stop :emphArray | emphArray do: [:emph | (font1 = emph or: [bold = emph]) ifFalse: [^ false]]]. ^ true! Item was changed: + (PackageInfo named: 'Collections') postscript: 'Text ignoreStyleIfOnlyBold: Preferences ignoreStyleIfOnlyBold. + Preferences removePreference: #ignoreStyleIfOnlyBold.'! - (PackageInfo named: 'Collections') postscript: 'LRUCache allInstancesDo: #migrate'! |
On 3 January 2014 16:29, <[hidden email]> wrote:
> Frank Shearar uploaded a new version of Collections to project The Trunk: > http://source.squeak.org/trunk/Collections-fbs.556.mcz > > ==================== Summary ==================== > > Name: Collections-fbs.556 > Author: fbs > Time: 3 January 2014, 4:28:00.204 pm > UUID: 80422ba6-f9b2-fc4f-acb2-27a911950eb9 > Ancestors: Collections-fbs.555 > > While we debate whether we should even have an #ignoreStyleIfOnlyBold preference, make it a pragma preference. > > =============== Diff against Collections-fbs.555 =============== > Item was added: > + ----- Method: Text class>>ignoreStyleIfOnlyBold (in category 'preferences') ----- > + ignoreStyleIfOnlyBold > + <preference: 'Ignore style if only bold' category: 'browsing' description: 'If true, then any method submission in which the only style change is for bolding will be trated as a method with no style specifications.' type: #Boolean> > + ^ IgnoreStyleIfOnlyBold ifNil: [true].! Gah! What does "trated" mean?! So if we decide to remove #askIfAddStyle:req: really soon, I'll fold fixing this into that removal. frank |
Free forum by Nabble | Edit this page |