Empty check only simple types
This commit is contained in:
parent
e8ef5ff1bc
commit
3c9f47f80e
@ -1144,7 +1144,6 @@ var
|
|||||||
writeStream: Boolean;
|
writeStream: Boolean;
|
||||||
typeMapping: TTypeMapping;
|
typeMapping: TTypeMapping;
|
||||||
nodeType: TDelphiNodeType;
|
nodeType: TDelphiNodeType;
|
||||||
elementType: TDelphiElementType;
|
|
||||||
|
|
||||||
begin
|
begin
|
||||||
Result := False;
|
Result := False;
|
||||||
@ -1298,13 +1297,21 @@ begin
|
|||||||
WriteNewLine;
|
WriteNewLine;
|
||||||
|
|
||||||
if writeOptional then
|
if writeOptional then
|
||||||
if AProperty.IsAttribute then
|
begin
|
||||||
sourceCode.Add(IfThen(HasChecksEmpty, PropertyImplMethodGetOptionalAttrEmpty, PropertyImplMethodGetOptionalAttr))
|
if HasChecksEmpty and (AProperty.PropertyType = ptSimple) and (not Assigned(AProperty.Collection)) then
|
||||||
else
|
|
||||||
begin
|
begin
|
||||||
elementType := GetDelphiElementType(nodeType);
|
if AProperty.IsAttribute then
|
||||||
sourceCode.Add(IfThen(HasChecksEmpty, PropertyImplMethodGetOptionalEmpty[elementType], PropertyImplMethodGetOptional[elementType]));
|
sourceCode.Add(PropertyImplMethodGetOptionalAttrEmpty)
|
||||||
|
else
|
||||||
|
sourceCode.Add(PropertyImplMethodGetOptionalEmpty[GetDelphiElementType(nodeType)]);
|
||||||
|
end else
|
||||||
|
begin
|
||||||
|
if AProperty.IsAttribute then
|
||||||
|
sourceCode.Add(PropertyImplMethodGetOptionalAttr)
|
||||||
|
else
|
||||||
|
sourceCode.Add(PropertyImplMethodGetOptional[GetDelphiElementType(nodeType)]);
|
||||||
end;
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
if writeNil then
|
if writeNil then
|
||||||
sourceCode.Add(PropertyImplMethodGetNil[GetDelphiElementType(nodeType)]);
|
sourceCode.Add(PropertyImplMethodGetNil[GetDelphiElementType(nodeType)]);
|
||||||
|
Loading…
Reference in New Issue
Block a user