IdeIntf: propedits: always write property values to objects. The property setter method has to decide about the need of update, not the propedit code.

git-svn-id: trunk@54954 -
This commit is contained in:
ondrej 2017-05-17 14:57:07 +00:00
parent fa6f0296b6
commit 697a3ee6fa

View File

@ -2984,13 +2984,7 @@ end;
procedure TPropertyEditor.SetFloatValue(const NewValue: Extended);
var
I: Integer;
Changed: boolean;
begin
Changed:=false;
for I:=0 to FPropCount-1 do
with FPropList^[I] do
Changed:=Changed or (GetFloatProp(Instance,PropInfo)<>NewValue);
if Changed then
for I:=0 to FPropCount-1 do
with FPropList^[I] do begin
SetFloatProp(Instance,PropInfo,NewValue);
@ -3001,16 +2995,7 @@ end;
procedure TPropertyEditor.SetMethodValue(const NewValue: TMethod);
var
I: Integer;
Changed: boolean;
AMethod: TMethod;
begin
Changed:=false;
for I:=0 to FPropCount-1 do
with FPropList^[I] do begin
AMethod:=LazGetMethodProp(Instance,PropInfo);
Changed:=Changed or not CompareMem(@AMethod,@NewValue,SizeOf(TMethod));
end;
if Changed then
for I:=0 to FPropCount-1 do
with FPropList^[I] do begin
LazSetMethodProp(Instance,PropInfo,NewValue);
@ -3021,13 +3006,7 @@ end;
procedure TPropertyEditor.SetInt64Value(const NewValue: Int64);
var
I: Integer;
Changed: boolean;
begin
Changed:=false;
for I:=0 to FPropCount-1 do
with FPropList^[I] do
Changed:=Changed or (GetInt64Prop(Instance,PropInfo)<>NewValue);
if Changed then
for I:=0 to FPropCount-1 do
with FPropList^[I] do begin
SetInt64Prop(Instance,PropInfo,NewValue);
@ -3038,13 +3017,7 @@ end;
procedure TPropertyEditor.SetIntfValue(const NewValue: IInterface);
var
I: Integer;
Changed: boolean;
begin
Changed := False;
for I := 0 to FPropCount - 1 do
with FPropList^[I] do
Changed := Changed or (GetInterfaceProp(Instance, PropInfo) <> NewValue);
if Changed then
for I := 0 to FPropCount - 1 do
with FPropList^[I] do begin
SetInterfaceProp(Instance, PropInfo, NewValue);
@ -3055,13 +3028,7 @@ end;
procedure TPropertyEditor.SetOrdValue(const NewValue: Longint);
var
I: Integer;
Changed: boolean;
begin
Changed := False;
for I := 0 to FPropCount - 1 do
with FPropList^[I] do
Changed := Changed or (GetOrdProp(Instance, PropInfo) <> NewValue);
if Changed then
for I := 0 to FPropCount - 1 do
with FPropList^[I] do begin
SetOrdProp(Instance, PropInfo, NewValue);
@ -3072,13 +3039,7 @@ end;
procedure TPropertyEditor.SetPtrValue(const NewValue: Pointer);
var
I: Integer;
Changed: boolean;
begin
Changed := False;
for I := 0 to FPropCount - 1 do
with FPropList^[I] do
Changed := Changed or (GetOrdProp(Instance, PropInfo) <> PtrInt({%H-}PtrUInt(NewValue)));
if Changed then
for I := 0 to FPropCount - 1 do
with FPropList^[I] do begin
SetOrdProp(Instance, PropInfo, PtrInt({%H-}PtrUInt(NewValue)));
@ -3089,13 +3050,7 @@ end;
procedure TPropertyEditor.SetStrValue(const NewValue: AnsiString);
var
I: Integer;
Changed: boolean;
begin
Changed:=false;
for I:=0 to FPropCount-1 do
with FPropList^[I] do
Changed:=Changed or (GetStrProp(Instance,PropInfo)<>NewValue);
if Changed then
for I:=0 to FPropCount-1 do
with FPropList^[I] do begin
SetStrProp(Instance,PropInfo,NewValue);
@ -3106,13 +3061,7 @@ end;
procedure TPropertyEditor.SetWideStrValue(const NewValue: WideString);
var
I: Integer;
Changed: boolean;
begin
Changed:=false;
for I:=0 to FPropCount-1 do
with FPropList^[I] do
Changed:=Changed or (GetWideStrProp(Instance,PropInfo)<>NewValue);
if Changed then
for I:=0 to FPropCount-1 do
with FPropList^[I] do begin
SetWideStrProp(Instance,PropInfo,NewValue);
@ -3123,13 +3072,7 @@ end;
procedure TPropertyEditor.SetUnicodeStrValue(const NewValue: UnicodeString);
var
I: Integer;
Changed: boolean;
begin
Changed:=false;
for I:=0 to FPropCount-1 do
with FPropList^[I] do
Changed:=Changed or (GetUnicodeStrProp(Instance,PropInfo)<>NewValue);
if Changed then
for I:=0 to FPropCount-1 do
with FPropList^[I] do begin
SetUnicodeStrProp(Instance,PropInfo,NewValue);
@ -3140,14 +3083,7 @@ end;
procedure TPropertyEditor.SetVarValue(const NewValue: Variant);
var
I: Integer;
Changed: boolean;
begin
Changed:=false;
for I:=0 to FPropCount-1 do
with FPropList^[I] do
Changed:=Changed or (GetVariantProp(Instance,PropInfo)<>NewValue)
or (VarType(GetVariantProp(Instance,PropInfo))<>VarType(NewValue));
if Changed then
for I:=0 to FPropCount-1 do
with FPropList^[I] do begin
SetVariantProp(Instance,PropInfo,NewValue);