IDE: Add DebugLns to indicate how PropertyHook is Nil and causes the error. Issue #22322

git-svn-id: trunk@37806 -
This commit is contained in:
juha 2012-06-27 20:07:02 +00:00
parent ddad43e884
commit ab93fd6669
2 changed files with 11 additions and 7 deletions

View File

@ -1656,9 +1656,10 @@ begin
for a:=0 to FRows.Count-1 do Rows[a].Free;
FRows.Clear;
// get properties
GetPersistentProperties(
FSelection, FFilter + [tkClass], FPropertyEditorHook, @AddPropertyEditor,
@EditorFilter);
if FPropertyEditorHook=Nil then
debugln('TOICustomPropertyGrid.BuildPropertyList: FPropertyEditorHook=Nil');
GetPersistentProperties(FSelection, FFilter + [tkClass], FPropertyEditorHook,
@AddPropertyEditor, @EditorFilter);
// sort
FRows.Sort(@SortGridRows);
for a:=0 to FRows.Count-1 do begin

View File

@ -2202,12 +2202,13 @@ end;
{ TPropertyEditor }
constructor TPropertyEditor.Create(Hook: TPropertyEditorHook;
APropCount:Integer);
constructor TPropertyEditor.Create(Hook: TPropertyEditorHook; APropCount:Integer);
var
PropListSize: Integer;
begin
FPropertyHook:=Hook;
if not Assigned(FPropertyHook) then
debugln('TPropertyEditor.Create : Hook=Nil <- Wrong!');
PropListSize:=APropCount * SizeOf(TInstProp);
GetMem(FPropList,PropListSize);
FillChar(FPropList^,PropListSize,0);
@ -3950,8 +3951,10 @@ end;
function TMethodPropertyEditor.GetValue: ansistring;
begin
Result:=PropertyHook.GetMethodName(GetMethodValue,GetComponent(0));
//debugln(['TMethodPropertyEditor.GetValue Name=',GetName,' Result=',Result,' Data=',dbgs(GetMethodValue.Data)]);
if Assigned(PropertyHook) then
Result:=PropertyHook.GetMethodName(GetMethodValue,GetComponent(0))
else
debugln(['TMethodPropertyEditor.GetValue : PropertyHook=Nil Name=',GetName,' Data=',dbgs(GetMethodValue.Data)]);
end;
procedure TMethodPropertyEditor.GetValues(Proc: TGetStrProc);