Fixed: SortChildNodes could cause "Line too long" error on large documents
This commit is contained in:
parent
aa29f0463e
commit
dc29a0ae51
@ -1549,7 +1549,13 @@ begin
|
|||||||
end;
|
end;
|
||||||
end else if not propertyItem.IsNodeValue then
|
end else if not propertyItem.IsNodeValue then
|
||||||
begin
|
begin
|
||||||
elementSortOrder := elementSortOrder + ', ' + QuotedStr(propertyItem.Name);
|
elementSortOrder := elementSortOrder + ', ';
|
||||||
|
|
||||||
|
{ Prevent "Line too long" on large elements }
|
||||||
|
if (elementSortCount > 0) and (elementSortCount mod 5 = 0) then
|
||||||
|
elementSortOrder := elementSortOrder + XSDValidateMethodImplementationSortNewLine;
|
||||||
|
|
||||||
|
elementSortOrder := elementSortOrder + QuotedStr(propertyItem.Name);
|
||||||
Inc(elementSortCount);
|
Inc(elementSortCount);
|
||||||
|
|
||||||
if (not propertyItem.IsOptional) and (not propertyItem.IsRepeating) then
|
if (not propertyItem.IsOptional) and (not propertyItem.IsRepeating) then
|
||||||
|
@ -108,6 +108,7 @@ const
|
|||||||
XSDValidateMethodImplementationComplex = ' Get%<Name>:s;';
|
XSDValidateMethodImplementationComplex = ' Get%<Name>:s;';
|
||||||
XSDValidateMethodImplementationAttrib = ' CreateRequiredAttributes(Self, [%<RequiredAttributes>:s]);';
|
XSDValidateMethodImplementationAttrib = ' CreateRequiredAttributes(Self, [%<RequiredAttributes>:s]);';
|
||||||
XSDValidateMethodImplementationSort = ' SortChildNodes(Self, [%<SortOrder>:s]);';
|
XSDValidateMethodImplementationSort = ' SortChildNodes(Self, [%<SortOrder>:s]);';
|
||||||
|
XSDValidateMethodImplementationSortNewLine = #13#10 + ' ';
|
||||||
|
|
||||||
XSDValidateMethodImplementationEnd = 'end;' + CrLf;
|
XSDValidateMethodImplementationEnd = 'end;' + CrLf;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user