Fixes the dxf reader floating point

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@1469 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
sekelsenmat
2011-01-28 15:25:55 +00:00
parent e390337166
commit 0b1e9bc532

View File

@ -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;