links to this page:    
View this PageEdit this PageUploads to this PageHistory of this PageTop of the SwikiRecent ChangesSearch the SwikiHelp Guide
How is an incoming object from a project file converted to the current version?
Last updated at 7:31 pm UTC on 25 May 2018
ProjectLoading involves using a SmartRefStream to load pr files (Project files).

In case objects need to be converted this is done by a method


    #convertToCurrentVersion: varDict refStream: smartRefStrm

This methods allows for changes to be made to the instance variables. For example if a class has a new instance variable the instance variable may be initialized.

Quite a number of classes implement this method but as a whole the amount is limited.
Most of the methods are from 2000 and 2001. As of 2018 they probably need to be checked to ensure project loading from early Squeak versions works.


Some recently updated methods

Note: varDict = variable dictionary

 convertToCurrentVersion: varDict refStream: smartRefStrm
	"If we're reading in an old version with a pixelSize instance variable, convert it to a point size."

	"Deal with the change from pixelSize to pointSize, assuming the current monitor dpi."
	varDict at: 'pixelSize' ifPresent: [ :x | 
		pointSize := (TextStyle pixelsToPoints: x) rounded.
	self releaseCachedState.
	^super convertToCurrentVersion: varDict refStream: smartRefStrm.

(updated 17th May 2018)

 convertToCurrentVersion: varDict refStream: smartRefStrm
	self borderWidth ifNil: [
		self borderWidth: 0.
		self removeProperty: #fillStyle].
	self releaseParagraphReally.
	^ super convertToCurrentVersion: varDict refStream: smartRefStrm.
(updated 20th May 2018)

These methods are called during the execution of
"The main program for project loading"