The Trunk: Multilingual-nice.60.mcz

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

The Trunk: Multilingual-nice.60.mcz

commits-2
Nicolas Cellier uploaded a new version of Multilingual to project The Trunk:
http://source.squeak.org/trunk/Multilingual-nice.60.mcz

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

Name: Multilingual-nice.60
Author: nice
Time: 16 November 2009, 3:17:46 am
UUID: d5d6538b-609c-414a-85ac-40a6c23c6807
Ancestors: Multilingual-nice.59

Hack to handle crlf pair composition and display

=============== Diff against Multilingual-nice.59 ===============

Item was changed:
  ----- Method: MultiCompositionScanner>>cr (in category 'stop conditions') -----
  cr
  "Answer true. Set up values for the text line interval currently being
  composed."
 
  pendingKernX := 0.
+ (lastIndex < text size and: [(text at: lastIndex) = CR and: [(text at: lastIndex+1) = Character lf]]) ifTrue: [lastIndex := lastIndex + 1].
  line stop: lastIndex.
  presentationLine stop: lastIndex - numOfComposition.
  spaceX := destX.
  line paddingWidth: rightMargin - spaceX.
  presentationLine paddingWidth: rightMargin - spaceX.
  ^true!

Item was changed:
  ----- Method: MultiDisplayScanner>>cr (in category 'stop conditions') -----
  cr
  "When a carriage return is encountered, simply increment the pointer
  into the paragraph."
 
- lastIndex:= lastIndex + 1.
  pendingKernX := 0.
+ (lastIndex < text size and: [(text at: lastIndex) = CR and: [(text at: lastIndex+1) = Character lf]])
+ ifTrue: [lastIndex := lastIndex + 2]
+ ifFalse: [lastIndex := lastIndex + 1].
  ^false!

Item was changed:
  ----- Method: MultiCanvasCharacterScanner>>cr (in category 'stop conditions') -----
  cr
  "When a carriage return is encountered, simply increment the pointer
  into the paragraph."
 
  pendingKernX := 0.
+ (lastIndex < text size and: [(text at: lastIndex) = CR and: [(text at: lastIndex+1) = Character lf]])
+ ifTrue: [lastIndex := lastIndex + 2]
+ ifFalse: [lastIndex := lastIndex + 1].
- lastIndex:= lastIndex + 1.
  ^false!

Item was changed:
  ----- Method: MultiCharacterBlockScanner>>cr (in category 'stop conditions') -----
  cr
  "Answer a CharacterBlock that specifies the current location of the mouse
  relative to a carriage return stop condition that has just been
  encountered. The ParagraphEditor convention is to denote selections by
  CharacterBlocks, sometimes including the carriage return (cursor is at
  the end) and sometimes not (cursor is in the middle of the text)."
 
  ((characterIndex ~= nil
  and: [characterIndex > text size])
  or: [(line last = text size)
  and: [(destY + line lineHeight) < characterPoint y]])
  ifTrue: ["When off end of string, give data for next character"
  destY := destY +  line lineHeight.
  baselineY := line lineHeight.
  lastCharacter := nil.
  characterPoint := (nextLeftMargin ifNil: [leftMargin]) @ destY.
+ (lastIndex < text size and: [(text at: lastIndex) = CR and: [(text at: lastIndex+1) = Character lf]])
+ ifTrue: [lastIndex := lastIndex + 2]
+ ifFalse: [lastIndex := lastIndex + 1].
- lastIndex := lastIndex + 1.
  self lastCharacterExtentSetX: 0.
  ^ true].
  lastCharacter := CR.
  characterPoint := destX @ destY.
  self lastCharacterExtentSetX: rightMargin - destX.
  ^true!

Item was changed:
  ----- Method: MultiCharacterScanner class>>initialize (in category 'class initialization') -----
  initialize
  "
  MultiCharacterScanner initialize
  "
  | a |
  a := Array new: 258.
  a at: 1 + 1 put: #embeddedObject.
  a at: Tab asciiValue + 1 put: #tab.
  a at: CR asciiValue + 1 put: #cr.
+ a at: Character lf asciiValue + 1 put: #cr.
  a at: EndOfRun put: #endOfRun.
  a at: CrossedX put: #crossedX.
  NilCondition := a copy.
  DefaultStopConditions := a copy.
 
  PaddedSpaceCondition := a copy.
  PaddedSpaceCondition at: Space asciiValue + 1 put: #paddedSpace.
 
  SpaceCondition := a copy.
  SpaceCondition at: Space asciiValue + 1 put: #space.
  !