mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-22 00:59:30 +02:00
ide: cleanup, formatting
git-svn-id: trunk@19680 -
This commit is contained in:
parent
4da3ebbcdd
commit
d90d0bff54
27
ide/main.pp
27
ide/main.pp
@ -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;
|
||||
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user