LazReport, fix reading barcode zoom values when decimal separator=',', issue #24393

git-svn-id: trunk@41070 -
This commit is contained in:
jesus 2013-05-08 06:57:43 +00:00
parent 4581bac94e
commit 49effd635f
2 changed files with 21 additions and 5 deletions

View File

@ -11634,7 +11634,6 @@ end;
function TfrObject.GetSaveProperty(const Prop: String; aObj : TPersistent=nil): string;
Var PropInfo : PPropInfo;
Obj : TObject;
OldSep : char;
begin
Result:='';
@ -11657,10 +11656,9 @@ begin
end;
tkSet : Result:=GetSetProp(aObj,Prop);
tkFloat : begin
OldSep := DecimalSeparator;
DecimalSeparator := '.';
lrNormalizeLocaleFloats(True);
Result := FloatToStr(GetFloatProp(aObj,Prop));
DecimalSeparator := OldSep;
lrNormalizeLocaleFloats(false);
end;
tkEnumeration : Result:=GetEnumProp(aObj,Prop);
tkClass : Begin
@ -11700,7 +11698,11 @@ begin
SetOrdProp(aObj,PropInfo,StrToInt(aValue))
end;
tkSet : SetSetProp(aObj,Prop,aValue);
tkFloat : SetFloatProp(aObj,Prop,StrToFloat(aValue));
tkFloat : begin
lrNormalizeLocaleFloats(true);
SetFloatProp(aObj,Prop,StrToFloat(aValue));
lrNormalizeLocaleFloats(false);
end;
tkEnumeration : SetEnumProp(aObj,Prop,aValue);
tkClass : Begin
Obj:=GetObjectProp(aObj,Prop);

View File

@ -67,6 +67,7 @@ function lrValidFieldReference(s: string):boolean;
function lrDateTimeToStr(ADate:TDateTime):string;
function lrStrToDateTime(AValue: string): TDateTime;
function lrExpandVariables(const S:string):string;
procedure lrNormalizeLocaleFloats(DisableLocale: boolean);
// utf8 tools
function UTF8Desc(S:string; var Desc: string): Integer;
@ -82,6 +83,9 @@ implementation
uses LR_Class, LR_Const, LR_Pars;
var
PreviousFormatSettings: TFormatSettings;
procedure frInitFont(aFont : TFont; aColor : TColor; aSize : Integer; aStyle : TFontStyles);
begin
with aFont do
@ -727,6 +731,16 @@ begin
Result:=Result + Copy(S, K, I-K);
end;
procedure lrNormalizeLocaleFloats(DisableLocale: boolean);
begin
if DisableLocale then
begin
PreviousFormatSettings := DefaultFormatSettings;
DefaultFormatSettings.DecimalSeparator := '.';
end else
DefaultFormatSettings := PreviousFormatSettings;
end;
function UTF8Desc(S: string; var Desc: string): Integer;
var
i,b: Integer;