ide: cleanup, formatting

git-svn-id: trunk@19680 -
This commit is contained in:
paul 2009-04-29 01:18:30 +00:00
parent 4da3ebbcdd
commit d90d0bff54
2 changed files with 18 additions and 13 deletions

View File

@ -14321,22 +14321,27 @@ end;
function TMainIDE.OnPropHookMethodExists(const AMethodName: String;
TypeData: PTypeData;
var MethodIsCompatible,MethodIsPublished,IdentIsMethod: boolean): boolean;
var ActiveSrcEdit: TSourceEditor;
var
ActiveSrcEdit: TSourceEditor;
ActiveUnitInfo: TUnitInfo;
//D: DWord;
begin
if not BeginCodeTool(ActiveSrcEdit,ActiveUnitInfo,[ctfSwitchToFormSource])
then exit;
if not BeginCodeTool(ActiveSrcEdit,ActiveUnitInfo,[ctfSwitchToFormSource]) then
Exit;
{$IFDEF IDE_DEBUG}
writeln('');
writeln('[TMainIDE.OnPropHookMethodExists] ************ ',AMethodName);
WriteLn('');
WriteLn('[TMainIDE.OnPropHookMethodExists] ************ ',AMethodName);
{$ENDIF}
Result:=CodeToolBoss.PublishedMethodExists(ActiveUnitInfo.Source,
ActiveUnitInfo.Component.ClassName,AMethodName,TypeData,
MethodIsCompatible,MethodIsPublished,IdentIsMethod);
if CodeToolBoss.ErrorMessage<>'' then begin
//D := GetTickCount;
Result := CodeToolBoss.PublishedMethodExists(ActiveUnitInfo.Source,
ActiveUnitInfo.Component.ClassName, AMethodName, TypeData,
MethodIsCompatible, MethodIsPublished, IdentIsMethod);
//D := GetTickCount - D;
//WriteLn('CodeToolBoss.PublishedMethodExists takes ', D, ' ms');
if CodeToolBoss.ErrorMessage <> '' then
begin
DoJumpToCodeToolBossError;
raise Exception.Create(lisUnableToFindMethodPleaseFixTheErrorShownInTheMessage
);
raise Exception.Create(lisUnableToFindMethodPleaseFixTheErrorShownInTheMessage);
end;
end;

View File

@ -4112,13 +4112,13 @@ var
NewMethodName: shortstring;
begin
NewMethodName:=GetValue;
DebugLn('### TMethodPropertyEditor.Edit A OldValue=',NewMethodName);
//DebugLn('### TMethodPropertyEditor.Edit A OldValue=',NewMethodName);
if (not IsValidIdent(NewMethodName))
or PropertyHook.MethodFromAncestor(GetMethodValue) then begin
// the current method is from the ancestor
// -> add an override with the default name
NewMethodName := GetFormMethodName;
DebugLn('### TMethodPropertyEditor.Edit B FormMethodName=',NewMethodName);
//DebugLn('### TMethodPropertyEditor.Edit B FormMethodName=',NewMethodName);
if not IsValidIdent(NewMethodName) then
raise EPropertyError.Create('Method name "'+NewMethodName+'" must be an identifier');
SetValue(NewMethodName); // this will jump to the method