Formatting

git-svn-id: trunk@52021 -
This commit is contained in:
juha 2016-03-22 21:57:06 +00:00
parent 75791c984b
commit e5845a0818
5 changed files with 14 additions and 19 deletions

View File

@ -109,8 +109,7 @@ function FindNextIdentifier(const Source: string; StartPos, MaxPos: integer): in
function FindNextIdentifierSkipStrings(const Source: string; function FindNextIdentifierSkipStrings(const Source: string;
StartPos, MaxPos: integer): integer; StartPos, MaxPos: integer): integer;
function IsValidIdentPair(const NamePair: string): boolean; function IsValidIdentPair(const NamePair: string): boolean;
function IsValidIdentPair(const NamePair: string; function IsValidIdentPair(const NamePair: string; out First, Second: string): boolean;
out First, Second: string): boolean;
// line/code ends // line/code ends
function SrcPosToLineCol(const s: string; Position: integer; function SrcPosToLineCol(const s: string; Position: integer;

View File

@ -72,8 +72,7 @@ type
TypeData: PTypeData; const Proc: TGetStrProc): boolean; TypeData: PTypeData; const Proc: TGetStrProc): boolean;
function GetCompatiblePublishedMethods(ClassNode: TCodeTreeNode; function GetCompatiblePublishedMethods(ClassNode: TCodeTreeNode;
TypeData: PTypeData; const Proc: TGetStrProc): boolean; TypeData: PTypeData; const Proc: TGetStrProc): boolean;
function PublishedMethodExists(const AClassName: string; function PublishedMethodExists(const AClassName, AMethodName: string;
const AMethodName: string;
PropInstance: TPersistent; const PropName: string; PropInstance: TPersistent; const PropName: string;
out MethodIsCompatible, MethodIsPublished, IdentIsMethod: boolean out MethodIsCompatible, MethodIsPublished, IdentIsMethod: boolean
): boolean; ): boolean;
@ -362,8 +361,8 @@ begin
end; end;
end; end;
function TEventsCodeTool.PublishedMethodExists(const AClassName: string; function TEventsCodeTool.PublishedMethodExists(const AClassName, AMethodName: string;
const AMethodName: string; PropInstance: TPersistent; const PropName: string; PropInstance: TPersistent; const PropName: string;
out MethodIsCompatible, MethodIsPublished, IdentIsMethod: boolean): boolean; out MethodIsCompatible, MethodIsPublished, IdentIsMethod: boolean): boolean;
var var
FoundContext: TFindContext; FoundContext: TFindContext;
@ -594,8 +593,8 @@ begin
end; end;
end; end;
function TEventsCodeTool.PublishedMethodExists(const AClassName, function TEventsCodeTool.PublishedMethodExists(const AClassName, AMethodName: string;
AMethodName: string; TypeData: PTypeData; TypeData: PTypeData;
out MethodIsCompatible, MethodIsPublished, IdentIsMethod: boolean): boolean; out MethodIsCompatible, MethodIsPublished, IdentIsMethod: boolean): boolean;
var ClassNode: TCodeTreeNode; var ClassNode: TCodeTreeNode;
begin begin
@ -722,8 +721,7 @@ begin
exit; exit;
end; end;
SrcClassName:=SrcTool.ExtractClassName(ClassNode,true); SrcClassName:=SrcTool.ExtractClassName(ClassNode,true);
ANode:=SrcTool.FindMethodNodeInImplementation( ANode:=SrcTool.FindMethodNodeInImplementation(SrcClassName,AMethodName,false);
SrcClassName,AMethodName,false);
if ANode=nil then begin if ANode=nil then begin
if ErrorOnNotFound then if ErrorOnNotFound then
RaiseExceptionFmt('implementation of method "%s.%s" in %s', [AClassName,AMethodName,SrcTool.MainFilename]); RaiseExceptionFmt('implementation of method "%s.%s" in %s', [AClassName,AMethodName,SrcTool.MainFilename]);

View File

@ -3575,7 +3575,7 @@ var
Result:=false; Result:=false;
// the node cache is identifier based // the node cache is identifier based
if ([fdfCollect,fdfExtractOperand]*Flags<>[]) then exit; if ([fdfCollect,fdfExtractOperand]*Flags<>[]) then exit;
NodeCache:=GetNodeCache(ContextNode,false); NodeCache:=GetNodeCache(ContextNode,false);
if (NodeCache<>LastNodeCache) then begin if (NodeCache<>LastNodeCache) then begin
// NodeCache changed -> search nearest cache entry for the identifier // NodeCache changed -> search nearest cache entry for the identifier

View File

@ -5706,7 +5706,7 @@ begin
TPropHookRenameMethod(FHandlers[htRenameMethod][i])(CurName,NewName); TPropHookRenameMethod(FHandlers[htRenameMethod][i])(CurName,NewName);
end; end;
procedure TPropertyEditorHook.ShowMethod(const aName:String); procedure TPropertyEditorHook.ShowMethod(const aName: String);
// jump cursor to published method body // jump cursor to published method body
var var
i: Integer; i: Integer;

View File

@ -12470,10 +12470,8 @@ var
ActiveUnitInfo: TUnitInfo; ActiveUnitInfo: TUnitInfo;
NewSource: TCodeBuffer; NewSource: TCodeBuffer;
NewX, NewY, NewTopLine: integer; NewX, NewY, NewTopLine: integer;
AClassName: string; AClassName, AnInheritedClassName: string;
AInheritedMethodName: string; CurMethodName, AInheritedMethodName: string;
AnInheritedClassName: string;
CurMethodName: String;
begin begin
ActiveSrcEdit:=nil; ActiveSrcEdit:=nil;
if not BeginCodeTool(ActiveSrcEdit,ActiveUnitInfo,[ctfSwitchToFormSource]) if not BeginCodeTool(ActiveSrcEdit,ActiveUnitInfo,[ctfSwitchToFormSource])
@ -12501,8 +12499,7 @@ begin
end; end;
if CodeToolBoss.JumpToPublishedMethodBody(ActiveUnitInfo.Source, if CodeToolBoss.JumpToPublishedMethodBody(ActiveUnitInfo.Source,
AClassName,CurMethodName, AClassName, CurMethodName, NewSource, NewX, NewY, NewTopLine) then
NewSource,NewX,NewY,NewTopLine) then
begin begin
DoJumpToCodePosition(ActiveSrcEdit, ActiveUnitInfo, DoJumpToCodePosition(ActiveSrcEdit, ActiveUnitInfo,
NewSource, NewX, NewY, NewTopLine, [jfAddJumpPoint, jfFocusEditor]); NewSource, NewX, NewY, NewTopLine, [jfAddJumpPoint, jfFocusEditor]);
@ -12514,7 +12511,8 @@ begin
end; end;
procedure TMainIDE.OnPropHookRenameMethod(const CurName, NewName: String); procedure TMainIDE.OnPropHookRenameMethod(const CurName, NewName: String);
var ActiveSrcEdit: TSourceEditor; var
ActiveSrcEdit: TSourceEditor;
ActiveUnitInfo: TUnitInfo; ActiveUnitInfo: TUnitInfo;
BossResult: boolean; BossResult: boolean;
ErrorMsg: String; ErrorMsg: String;