1
0
mirror of synced 2024-11-23 06:03:50 +00:00

Fixed: SortChildNodes could cause "Line too long" error on large documents

This commit is contained in:
Mark van Renswoude 2014-08-05 12:03:22 +00:00
parent aa29f0463e
commit dc29a0ae51
2 changed files with 12 additions and 5 deletions

View File

@ -1549,7 +1549,13 @@ begin
end;
end else if not propertyItem.IsNodeValue then
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);
if (not propertyItem.IsOptional) and (not propertyItem.IsRepeating) then

View File

@ -108,6 +108,7 @@ const
XSDValidateMethodImplementationComplex = ' Get%<Name>:s;';
XSDValidateMethodImplementationAttrib = ' CreateRequiredAttributes(Self, [%<RequiredAttributes>:s]);';
XSDValidateMethodImplementationSort = ' SortChildNodes(Self, [%<SortOrder>:s]);';
XSDValidateMethodImplementationSortNewLine = #13#10 + ' ';
XSDValidateMethodImplementationEnd = 'end;' + CrLf;