fixed Extract Proc flags not used in selection

git-svn-id: trunk@5816 -
This commit is contained in:
mattias 2004-08-18 11:32:12 +00:00
parent 387847f395
commit a3c5113732

View File

@ -233,7 +233,7 @@ var
UsedInNonSelection: Boolean; UsedInNonSelection: Boolean;
begin begin
{$IFDEF CTDebug} {$IFDEF CTDebug}
DebugLn('AddVariableToTree A IsInSelection=',dbgs(IsInSelection),' IsParameter=',dbgs(IsParameter)); DebugLn('AddVariableToTree A Ident=',GetIdentifier(@Src[VarNode.StartPos]),' IsInSelection=',dbgs(IsInSelection),' IsParameter=',dbgs(IsParameter));
{$ENDIF} {$ENDIF}
UsedInNonSelection:=(not IsInSelection) or IsParameter; UsedInNonSelection:=(not IsInSelection) or IsParameter;
if VarTree=nil then if VarTree=nil then
@ -242,7 +242,7 @@ var
if AVLNode<>nil then begin if AVLNode<>nil then begin
ProcVar:=TExtractedProcVariable(AVLNode.Data); ProcVar:=TExtractedProcVariable(AVLNode.Data);
ProcVar.UsedInSelection:=ProcVar.UsedInSelection or IsInSelection; ProcVar.UsedInSelection:=ProcVar.UsedInSelection or IsInSelection;
ProcVar.UsedInNonSelection:=ProcVar.UsedInSelection or UsedInNonSelection; ProcVar.UsedInNonSelection:=ProcVar.UsedInNonSelection or UsedInNonSelection;
end else begin end else begin
NewProcVar:=TExtractedProcVariable.Create; NewProcVar:=TExtractedProcVariable.Create;
NewProcVar.Node:=VarNode; NewProcVar.Node:=VarNode;
@ -280,11 +280,11 @@ var
// ToDo: Params.OnTopLvlIdentifierFound:=@OnTopLvlIdentifierFound; // ToDo: Params.OnTopLvlIdentifierFound:=@OnTopLvlIdentifierFound;
Params.SetIdentifier(Self,@Src[VarStartPos],@CheckSrcIdentifier); Params.SetIdentifier(Self,@Src[VarStartPos],@CheckSrcIdentifier);
{$IFDEF CTDebug} {$IFDEF CTDebug}
DebugLn('AddVariableAtCursor A ',GetIdentifier(Params.Identifier)); DebugLn('AddVariableAtCursor Searching ',GetIdentifier(Params.Identifier));
{$ENDIF} {$ENDIF}
if not FindDeclarationOfIdentAtCursor(Params) then begin if not FindDeclarationOfIdentAtCursor(Params) then begin
{$IFDEF CTDebug} {$IFDEF CTDebug}
DebugLn('AddVariableAtCursor B found'); DebugLn('AddVariableAtCursor B not found');
{$ENDIF} {$ENDIF}
exit; exit;
end; end;
@ -344,7 +344,7 @@ var
ChildNode: TCodeTreeNode; ChildNode: TCodeTreeNode;
begin begin
{$IFDEF CTDebug} {$IFDEF CTDebug}
DebugLn('TExtractProcTool.ScanNodesForVariables A ',StartNode.DescAsString); DebugLn('TExtractProcTool.ScanNodesForVariables A Node=',StartNode.DescAsString);
{$ENDIF} {$ENDIF}
Result:=false; Result:=false;
ChildNode:=StartNode.FirstChild; ChildNode:=StartNode.FirstChild;
@ -679,11 +679,11 @@ var
VariableName:=GetIdentifier(@Src[ProcVar.Node.StartPos]); VariableName:=GetIdentifier(@Src[ProcVar.Node.StartPos]);
VarTypeNode:=FindTypeNodeOfDefinition(ProcVar.Node); VarTypeNode:=FindTypeNodeOfDefinition(ProcVar.Node);
{$IFDEF CTDebug} {$IFDEF CTDebug}
DebugLn('AAA1 VarTypeNode=',copy(Src,VarTypeNode.StartPos,VarTypeNode.EndPos-VarTypeNode.StartPos)); DebugLn('TExtractProcTool.CreateProcVarSection VarTypeNode=',copy(Src,VarTypeNode.StartPos,VarTypeNode.EndPos-VarTypeNode.StartPos));
{$ENDIF} {$ENDIF}
TypeDefEndPos:=FindLineEndOrCodeAfterPosition(VarTypeNode.EndPos); TypeDefEndPos:=FindLineEndOrCodeAfterPosition(VarTypeNode.EndPos);
{$IFDEF CTDebug} {$IFDEF CTDebug}
DebugLn('AAA2 PlusComment=',copy(Src,VarTypeNode.StartPos,TypeDefEndPos-VarTypeNode.StartPos)); DebugLn('TExtractProcTool.CreateProcVarSection PlusComment=',copy(Src,VarTypeNode.StartPos,TypeDefEndPos-VarTypeNode.StartPos));
{$ENDIF} {$ENDIF}
VariableTypeCode:=copy(Src,VarTypeNode.StartPos, VariableTypeCode:=copy(Src,VarTypeNode.StartPos,
TypeDefEndPos-VarTypeNode.StartPos); TypeDefEndPos-VarTypeNode.StartPos);