diff --git a/components/fpvectorial/dxfvectorialreader.pas b/components/fpvectorial/dxfvectorialreader.pas index 8882078b5e..ce383f878a 100644 --- a/components/fpvectorial/dxfvectorialreader.pas +++ b/components/fpvectorial/dxfvectorialreader.pas @@ -533,6 +533,11 @@ begin begin Exit; end + // Comments can be in the beginning of the file and start with 999 + else if (IntSectionGroupCode = 999) then + begin + // nothing to be done, let it add the token + end else begin raise Exception.Create(Format( @@ -1991,6 +1996,7 @@ begin for i := 0 to Tokenizer.Tokens.Count - 1 do begin CurToken := TDXFToken(Tokenizer.Tokens.Items[i]); + if (CurToken.Childs = nil) or (CurToken.Childs.Count=0) then Continue; CurTokenFirstChild := TDXFToken(CurToken.Childs.Items[0]); if CurTokenFirstChild.StrValue = 'HEADER' then diff --git a/components/fpvectorial/fpvectorial.pas b/components/fpvectorial/fpvectorial.pas index 64879324eb..2114f84416 100644 --- a/components/fpvectorial/fpvectorial.pas +++ b/components/fpvectorial/fpvectorial.pas @@ -2485,7 +2485,7 @@ end; procedure TvBlock.CallbackDeleteElement(data, arg: pointer); begin - TvFormulaElement(data).Free; + TvEntity(data).Free; end; constructor TvBlock.Create;