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 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
|
||||
|
@ -104,10 +104,11 @@ const
|
||||
XSDValidateMethodImplementationBegin = 'procedure TXML%<Name>:s.XSDValidate;' + CrLf +
|
||||
'begin';
|
||||
|
||||
XSDValidateMethodImplementationRequired = ' CreateRequiredElements(Self, [%<RequiredElements>:s]);';
|
||||
XSDValidateMethodImplementationComplex = ' Get%<Name>:s;';
|
||||
XSDValidateMethodImplementationAttrib = ' CreateRequiredAttributes(Self, [%<RequiredAttributes>:s]);';
|
||||
XSDValidateMethodImplementationSort = ' SortChildNodes(Self, [%<SortOrder>:s]);';
|
||||
XSDValidateMethodImplementationRequired = ' CreateRequiredElements(Self, [%<RequiredElements>:s]);';
|
||||
XSDValidateMethodImplementationComplex = ' Get%<Name>:s;';
|
||||
XSDValidateMethodImplementationAttrib = ' CreateRequiredAttributes(Self, [%<RequiredAttributes>:s]);';
|
||||
XSDValidateMethodImplementationSort = ' SortChildNodes(Self, [%<SortOrder>:s]);';
|
||||
XSDValidateMethodImplementationSortNewLine = #13#10 + ' ';
|
||||
|
||||
XSDValidateMethodImplementationEnd = 'end;' + CrLf;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user