LazUtils: XmlConfig, fix saving default (delete) for enum values

This commit is contained in:
Martin 2024-03-11 21:23:38 +01:00
parent b1847337ca
commit 7fc68aa656

View File

@ -623,7 +623,7 @@ procedure TXMLConfig.SetDeleteValue(const APath: String; const AValue,
DefValue; const APTypeInfo: PTypeInfo); DefValue; const APTypeInfo: PTypeInfo);
begin begin
if CompareMem(@AValue, @DefValue, SizeOfTypeInfo(APTypeInfo)) then if CompareMem(@AValue, @DefValue, SizeOfTypeInfo(APTypeInfo)) then
DeletePath(APath) DeleteValue(APath)
else else
SetValue(APath, ValueWithTypeInfoToString(AValue, APTypeInfo)); SetValue(APath, ValueWithTypeInfoToString(AValue, APTypeInfo));
end; end;
@ -641,7 +641,7 @@ begin
else t := False; else t := False;
end; end;
if t then if t then
DeletePath(APath) DeleteValue(APath)
else else
SetValue(APath, AValue, APTypeInfo); SetValue(APath, AValue, APTypeInfo);
end; end;