lcl: add overload for TRemovedPropertyList.IndexOf

git-svn-id: trunk@17741 -
This commit is contained in:
paul 2008-12-09 04:46:43 +00:00
parent 5a7173ef9a
commit ebfa9fcc57
2 changed files with 13 additions and 3 deletions

View File

@ -2266,7 +2266,7 @@ procedure TCustomFormEditor.JITListPropertyNotFound(Sender: TObject;
var
Index: Integer;
begin
Index := RemovedProperties.IndexOf(TPersistentClass(Instance.ClassType), PropName);
Index := RemovedProperties.IndexOf(Instance, PropName);
if Index >= 0 then
begin
Skip := True;

View File

@ -368,7 +368,8 @@ type
procedure DoPropertyNotFound(Reader: TReader; Instance: TPersistent;
var PropName: string; IsPath: boolean; var Handled, Skip: Boolean);
public
function IndexOf(AClass: TPersistentClass; APropertyName: String): Integer;
function IndexOf(AInstance: TPersistent; APropertyName: String): Integer; overload;
function IndexOf(AClass: TPersistentClass; APropertyName: String): Integer; overload;
function Add(APersistentClass: TPersistentClass; APropertyName, ANote,
AHelpKeyWord: string): Integer; reintroduce;
property Items[AIndex: Integer]: PRemovedProperty read GetItem write SetItem;
@ -569,10 +570,19 @@ end;
procedure TRemovedPropertyList.DoPropertyNotFound(Reader: TReader; Instance: TPersistent;
var PropName: string; IsPath: boolean; var Handled, Skip: Boolean);
begin
Skip := IndexOf(TPersistentClass(Instance.ClassType), PropName) >= 0;
Skip := IndexOf(Instance, PropName) >= 0;
Handled := Skip;
end;
function TRemovedPropertyList.IndexOf(AInstance: TPersistent;
APropertyName: String): Integer;
begin
if AInstance <> nil then
Result := IndexOf(TPersistentClass(AInstance.ClassType), APropertyName)
else
Result := -1;
end;
function TRemovedPropertyList.IndexOf(AClass: TPersistentClass;
APropertyName: String): Integer;
var