[squeak-dev] Exporting 4.4 projects to 4.5

Stéphane Rollandin lecteur at zogotounga.net
Sat Mar 8 23:49:33 UTC 2014


> If I save an empty project in 4.4 loading it in 4.5 complains about
> missing MultiNewParagraph.

What I did in my case, for transfering complex Morphs (not full 
projects) from 4.4 to 4.5, was simply to file-in the attached file in 
the 4.5 image.

Stef
-------------- next part --------------
'From Squeak4.1 of 17 April 2010 [latest update: #9956] on 10 October 2013 at 2:52:05 pm'!
NewParagraph subclass: #MultiNewParagraph
	instanceVariableNames: 'presentationText presentationLines'
	classVariableNames: ''
	poolDictionaries: 'TextConstants'
	category: 'Multilingual-Scanning'!

!MultiNewParagraph methodsFor: 'fonts-display' stamp: 'yo 1/23/2003 16:09'!
displayOn: aCanvas using: displayScanner at: somePosition
	"Send all visible lines to the displayScanner for display"

	| visibleRectangle offset leftInRun line |
	visibleRectangle := aCanvas clipRect.
	offset := somePosition - positionWhenComposed.
	leftInRun := 0.
	(self lineIndexForPoint: visibleRectangle topLeft)
		to: (self lineIndexForPoint: visibleRectangle bottomRight)
		do: [:i | line := lines at: i.
			self displaySelectionInLine: line on: aCanvas.
			line first <= line last ifTrue:
				[leftInRun := displayScanner displayLine: line
								offset: offset leftInRun: leftInRun]].
! !

!MultiNewParagraph methodsFor: 'fonts-display' stamp: 'yo 1/23/2003 22:33'!
displayOnTest: aCanvas using: displayScanner at: somePosition
	"Send all visible lines to the displayScanner for display"

	| visibleRectangle offset leftInRun line |
	(presentationText isNil or: [presentationLines isNil]) ifTrue: [
		^ self displayOn: aCanvas using: displayScanner at: somePosition.
	].
	visibleRectangle := aCanvas clipRect.
	offset := somePosition - positionWhenComposed.
	leftInRun := 0.
	(self lineIndexForPoint: visibleRectangle topLeft)
		to: (self lineIndexForPoint: visibleRectangle bottomRight)
		do: [:i | line := presentationLines at: i.
			self displaySelectionInLine: line on: aCanvas.
			line first <= line last ifTrue:
				[leftInRun := displayScanner displayLine: line
								offset: offset leftInRun: leftInRun]].
! !


!MultiNewParagraph methodsFor: 'composition' stamp: 'yo 1/23/2003 12:53'!
multiComposeLinesFrom: start to: stop delta: delta into: lineColl priorLines: priorLines
	atY: startingY
	"While the section from start to stop has changed, composition may ripple all the way to the end of the text.  However in a rectangular container, if we ever find a line beginning with the same character as before (ie corresponding to delta in the old lines), then we can just copy the old lines from there to the end of the container, with adjusted indices and y-values"

	| newResult composer presentationInfo |

	composer := MultiTextComposer new.
	presentationLines := nil.
	presentationText := nil.
	newResult := composer
		multiComposeLinesFrom: start 
		to: stop 
		delta: delta 
		into: lineColl 
		priorLines: priorLines
		atY: startingY
		textStyle: textStyle 
		text: text 
		container: container
		wantsColumnBreaks: wantsColumnBreaks == true.
	lines := newResult first asArray.
	maxRightX := newResult second.
	presentationInfo := composer getPresentationInfo.
	presentationLines := presentationInfo first asArray.
	presentationText := presentationInfo second.
	"maxRightX printString displayAt: 0 at 0."
	^maxRightX
! !


!MultiNewParagraph methodsFor: 'accessing' stamp: 'yo 1/23/2003 17:31'!
presentationLines

	^ presentationLines.
! !

!MultiNewParagraph methodsFor: 'accessing' stamp: 'yo 1/23/2003 17:31'!
presentationText

	^ presentationText.
! !


More information about the Squeak-dev mailing list