From: <fas...@us...> - 2006-11-29 10:42:30
|
Revision: 728 http://svn.sourceforge.net/instantobjects/revision/?rev=728&view=rev Author: fastbike2 Date: 2006-11-29 02:42:28 -0800 (Wed, 29 Nov 2006) Log Message: ----------- Changes to ensure backward compatibility of Object Foundry addin expert with MM 6.20 Modified Paths: -------------- trunk/Source/ObjectFoundry/OFClasses.pas trunk/Source/ObjectFoundry/OFExpert.pas trunk/Source/ObjectFoundry/OFUtils.pas Modified: trunk/Source/ObjectFoundry/OFClasses.pas =================================================================== --- trunk/Source/ObjectFoundry/OFClasses.pas 2006-11-29 05:41:29 UTC (rev 727) +++ trunk/Source/ObjectFoundry/OFClasses.pas 2006-11-29 10:42:28 UTC (rev 728) @@ -24,7 +24,7 @@ * the Initial Developer. All Rights Reserved. * * Contributor(s): - * Steven Mitchell + * Steven Mitchell, David Moorhouse * * ***** END LICENSE BLOCK ***** *) @@ -82,6 +82,11 @@ procedure Refresh; end; +{$IFNDEF MM7+} // i.e. redefine for MM 6.20 +type + IMMClassifier = IMMClassBase; +{$ENDIF} + implementation uses @@ -495,11 +500,15 @@ FieldTypeName: string; begin Name := Prop.Name; +{$IFDEF MM7+} {$IFDEF MM9} Visibility := MMVisibilityToInstantCodeVisibility(Prop.Visibility); {$ELSE} Visibility := TInstantCodeVisibility(Prop.V9Visibility); {$ENDIF} +{$ELSE} + Visibility := TInstantCodeVisibility(Prop.Visibility); +{$ENDIF} if Attribute.IsIOAttribute then begin { If the type of attribute field is Integer (which is considered Modified: trunk/Source/ObjectFoundry/OFExpert.pas =================================================================== --- trunk/Source/ObjectFoundry/OFExpert.pas 2006-11-29 05:41:29 UTC (rev 727) +++ trunk/Source/ObjectFoundry/OFExpert.pas 2006-11-29 10:42:28 UTC (rev 728) @@ -159,7 +159,11 @@ AClass := CodeModel.Classes[I]; if IsInstantObjectClass(AClass) and (not PersistentOnly or + {$IFDEF MM7+} (PersistentOnly and (AClass.Persistency = cpPersistent))) then + {$ELSE} + (PersistentOnly and ((AClass as IMMV9ClassBase).Persistency = cpPersistent))) then + {$ENDIF} Items.Add(AClass.Name); end; end; { if } @@ -179,7 +183,11 @@ begin lClass := CodeModel.Classes[I]; if IsInstantObjectClass(lClass) and SameText(AClassName, lClass.Name) then + {$IFDEF MM7+} IsPersistent := lClass.Persistency = cpPersistent; + {$ELSE} + IsPersistent := (lClass as IMMV9ClassBase).Persistency = cpPersistent; + {$ENDIF} end; end; { if } end; Modified: trunk/Source/ObjectFoundry/OFUtils.pas =================================================================== --- trunk/Source/ObjectFoundry/OFUtils.pas 2006-11-29 05:41:29 UTC (rev 727) +++ trunk/Source/ObjectFoundry/OFUtils.pas 2006-11-29 10:42:28 UTC (rev 728) @@ -24,7 +24,7 @@ * the Initial Developer. All Rights Reserved. * * Contributor(s): - * Steven Mitchell + * Steven Mitchell, David Moorhouse * * ***** END LICENSE BLOCK ***** *) @@ -146,9 +146,14 @@ function MMVisibilityToInstantCodeVisibility(const Value: TVisibility): TInstantCodeVisibility; const + {$IFDEF MM7+} Map: array[TVisibility] of TInstantCodeVisibility = (viDefault, viPrivate, viPrivate, viProtected, viProtected, viPublic, viPublished, viPublished); + {$ELSE} + Map: array[TVisibility] of TInstantCodeVisibility = + (viDefault, viPrivate, viProtected, viPublic, viPublished, viPublished); + {$ENDIF} begin Result := Map[Value]; end; |