mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-10 20:56:14 +02:00
LazReport, fix reading barcode zoom values when decimal separator=',', issue #24393
git-svn-id: trunk@41070 -
This commit is contained in:
parent
4581bac94e
commit
49effd635f
@ -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);
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user