MG: added if oldvalue=newvalue then exit; line to codecompletion

git-svn-id: trunk@3133 -
This commit is contained in:
lazarus 2002-08-18 16:49:45 +00:00
parent f17cd838b1
commit e316b51886

View File

@ -686,13 +686,25 @@ var AccessParam, AccessParamPrefix, CleanAccessFunc, AccessFunc,
'procedure '+AccessParam
+'(const '+SetPropertyVariablename+': '+PropType+');';
if VariableName<>'' then begin
// read spec is a variable -> add simple assign code to body
{ read spec is a variable -> add simple assign code to body
For example:
procedure SetMyInt(AValue: integer);
begin
if FMyInt=AValue then exit;
FMyInt:=AValue;
end;
}
ProcBody:=
'procedure '
+ExtractClassName(PropNode.Parent.Parent,false)+'.'+AccessParam
+'(const '+SetPropertyVariablename+': '+PropType+');'
+BeautifyCodeOpts.LineEnd
+'begin'+BeautifyCodeOpts.LineEnd
+GetIndentStr(BeautifyCodeOpts.Indent)+
+'if '+VariableName+'='+SetPropertyVariablename+' then exit;'
+BeautifyCodeOpts.LineEnd
+GetIndentStr(BeautifyCodeOpts.Indent)+
+VariableName+':='+SetPropertyVariablename+';'
+BeautifyCodeOpts.LineEnd
@ -791,13 +803,13 @@ begin
ReadPropertyKeywordAndName;
ReadPropertyParamList;
{$IFDEF CTDEBUG}
writeln('[TCodeCompletionCodeTool.CompleteProperty] Checking Property ',GetAtom);
{$ENDIF}
{$IFDEF CTDEBUG}
writeln('[TCodeCompletionCodeTool.CompleteProperty] Checking Property ',GetAtom);
{$ENDIF}
if not AtomIsChar(':') then begin
{$IFDEF CTDEBUG}
writeln('[TCodeCompletionCodeTool.CompleteProperty] no type : found -> ignore property');
{$ENDIF}
{$IFDEF CTDEBUG}
writeln('[TCodeCompletionCodeTool.CompleteProperty] no type : found -> ignore property');
{$ENDIF}
// no type -> ignore this property
Result:=true;
exit;