From 0b1e9bc532169d0824630abb425b7779267c91f1 Mon Sep 17 00:00:00 2001 From: sekelsenmat Date: Fri, 28 Jan 2011 15:25:55 +0000 Subject: [PATCH] Fixes the dxf reader floating point git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@1469 8e941d3f-bd1b-0410-a28a-d453659cc2b4 --- .../fpvectorialsrc/dxfvectorialreader.pas | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/applications/fpvviewer/fpvectorialsrc/dxfvectorialreader.pas b/applications/fpvviewer/fpvectorialsrc/dxfvectorialreader.pas index 4ce52c87b..7ea7f8845 100644 --- a/applications/fpvviewer/fpvectorialsrc/dxfvectorialreader.pas +++ b/applications/fpvviewer/fpvectorialsrc/dxfvectorialreader.pas @@ -66,6 +66,7 @@ type TvDXFVectorialReader = class(TvCustomVectorialReader) private + FPointSeparator: TFormatSettings; // function SeparateString(AString: string; ASeparator: Char): T10Strings; procedure ReadENTITIES(ATokens: TDXFTokens; AData: TvVectorialDocument); @@ -350,7 +351,7 @@ begin if (CurToken.GroupCode = DXF_ENTITIES_HANDLE) or (CurToken.GroupCode = DXF_ENTITIES_AcDbEntity) then Continue; - CurToken.FloatValue := StrToFloat(Trim(CurToken.StrValue)); + CurToken.FloatValue := StrToFloat(Trim(CurToken.StrValue), FPointSeparator); case CurToken.GroupCode of 10: LineStartX := CurToken.FloatValue; @@ -406,7 +407,7 @@ begin if (CurToken.GroupCode = DXF_ENTITIES_HANDLE) or (CurToken.GroupCode = DXF_ENTITIES_AcDbEntity) then Continue; - CurToken.FloatValue := StrToFloat(Trim(CurToken.StrValue)); + CurToken.FloatValue := StrToFloat(Trim(CurToken.StrValue), FPointSeparator); case CurToken.GroupCode of 10: CenterX := CurToken.FloatValue; @@ -452,7 +453,7 @@ begin if (CurToken.GroupCode = DXF_ENTITIES_HANDLE) or (CurToken.GroupCode = DXF_ENTITIES_AcDbEntity) then Continue; - CurToken.FloatValue := StrToFloat(Trim(CurToken.StrValue)); + CurToken.FloatValue := StrToFloat(Trim(CurToken.StrValue), FPointSeparator); case CurToken.GroupCode of 10: CircleCenterX := CurToken.FloatValue; @@ -494,7 +495,7 @@ begin if (CurToken.GroupCode = DXF_ENTITIES_HANDLE) or (CurToken.GroupCode = DXF_ENTITIES_AcDbEntity) then Continue; - CurToken.FloatValue := StrToFloat(Trim(CurToken.StrValue)); + CurToken.FloatValue := StrToFloat(Trim(CurToken.StrValue), FPointSeparator); case CurToken.GroupCode of 10: CenterX := CurToken.FloatValue; @@ -558,7 +559,7 @@ begin (CurToken.GroupCode = 1) or (CurToken.GroupCode = DXF_ENTITIES_AcDbEntity) then Continue; - CurToken.FloatValue := StrToFloat(Trim(CurToken.StrValue)); + CurToken.FloatValue := StrToFloat(Trim(CurToken.StrValue), FPointSeparator); case CurToken.GroupCode of 1: Str := CurToken.StrValue; @@ -586,6 +587,10 @@ constructor TvDXFVectorialReader.Create; begin inherited Create; + FPointSeparator := DefaultFormatSettings; + FPointSeparator.DecimalSeparator := '.'; + FPointSeparator.ThousandSeparator := '#';// disable the thousand separator + Tokenizer := TDXFTokenizer.Create; end;