diff --git a/Units/DelphiXMLDataBindingGenerator.pas b/Units/DelphiXMLDataBindingGenerator.pas index 937bfd6..5ade84d 100644 --- a/Units/DelphiXMLDataBindingGenerator.pas +++ b/Units/DelphiXMLDataBindingGenerator.pas @@ -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 diff --git a/Units/DelphiXMLDataBindingResources.pas b/Units/DelphiXMLDataBindingResources.pas index fffaa7e..f61b650 100644 --- a/Units/DelphiXMLDataBindingResources.pas +++ b/Units/DelphiXMLDataBindingResources.pas @@ -104,10 +104,11 @@ const XSDValidateMethodImplementationBegin = 'procedure TXML%:s.XSDValidate;' + CrLf + 'begin'; - XSDValidateMethodImplementationRequired = ' CreateRequiredElements(Self, [%:s]);'; - XSDValidateMethodImplementationComplex = ' Get%:s;'; - XSDValidateMethodImplementationAttrib = ' CreateRequiredAttributes(Self, [%:s]);'; - XSDValidateMethodImplementationSort = ' SortChildNodes(Self, [%:s]);'; + XSDValidateMethodImplementationRequired = ' CreateRequiredElements(Self, [%:s]);'; + XSDValidateMethodImplementationComplex = ' Get%:s;'; + XSDValidateMethodImplementationAttrib = ' CreateRequiredAttributes(Self, [%:s]);'; + XSDValidateMethodImplementationSort = ' SortChildNodes(Self, [%:s]);'; + XSDValidateMethodImplementationSortNewLine = #13#10 + ' '; XSDValidateMethodImplementationEnd = 'end;' + CrLf;