Browse Source

* fix from Michalis K. for nesting depth of XMLs (# 11957)

git-svn-id: trunk@11644 -
marco 17 năm trước cách đây
mục cha
commit
622ace494e
1 tập tin đã thay đổi với 2 bổ sung2 xóa
  1. 2 2
      packages/fcl-xml/src/xmlread.pp

+ 2 - 2
packages/fcl-xml/src/xmlread.pp

@@ -2979,9 +2979,9 @@ end;
 
 procedure TXMLReader.PushVC(aElDef: TDOMElementDef);
 begin
-  if FNesting = Length(FValidator) then
-    SetLength(FValidator, FNesting * 2);
   Inc(FNesting);
+  if FNesting >= Length(FValidator) then
+    SetLength(FValidator, FNesting * 2);
   FValidator[FNesting].FElementDef := aElDef;
   FValidator[FNesting].FCurCP := nil;
   FValidator[FNesting].FFailed := False;