mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-07 14:27:59 +02:00
* Fixed merge conflicts
git-svn-id: branches/fixes_3_2@43757 -
This commit is contained in:
parent
f55addba35
commit
030c65ec38
@ -69,12 +69,14 @@ Type
|
||||
FCurrencySymbol : String;
|
||||
FDateFormat : String;
|
||||
FIntegerFormat: String;
|
||||
FHandleNullField: Boolean;
|
||||
FTimeFormat : String;
|
||||
FDateTimeFormat : String;
|
||||
FDecimalSeparator: Char;
|
||||
FUseDisplayText : Boolean;
|
||||
Protected
|
||||
Procedure InitSettings; virtual;
|
||||
Property HandleNullField : Boolean Read FHandleNullField Write FHandleNullField;
|
||||
Property UseDisplayText : Boolean Read FUseDisplayText Write FUseDisplayText;
|
||||
Property IntegerFormat : String Read FIntegerFormat Write FIntegerFormat;
|
||||
Property DecimalSeparator : Char Read FDecimalSeparator Write FDecimalSeparator;
|
||||
@ -295,6 +297,7 @@ Procedure UnRegisterExportFormat(Const AName : String);
|
||||
Const
|
||||
StringFieldTypes = [ftString,ftFixedChar,ftWidestring,ftFixedWideChar];
|
||||
IntFieldTypes = [ftInteger,ftWord,ftSmallint,ftAutoinc];
|
||||
FloatFieldTypes = [ftFloat, ftCurrency, ftFMTBcd, ftBCD];
|
||||
OrdFieldTypes = IntFieldTypes +[ftBoolean,ftLargeInt];
|
||||
DateFieldTypes = [ftDate,ftTime,ftDateTime,ftTimeStamp];
|
||||
MemoFieldTypes = [ftMemo,ftFmtMemo,ftWideMemo];
|
||||
@ -587,9 +590,11 @@ Var
|
||||
FS : TFormatSettings;
|
||||
|
||||
begin
|
||||
if F.IsNull and FormatSettings.HandleNullField then
|
||||
Exit('');
|
||||
If (F.DataType in IntFieldTypes) then
|
||||
begin
|
||||
If (FormatSettings.IntegerFormat)<>'' then
|
||||
If ((FormatSettings.IntegerFormat)<>'') and (not F.IsNull) then
|
||||
Result:=Format(FormatSettings.IntegerFormat,[F.AsInteger])
|
||||
else if FormatSettings.UseDisplayText then
|
||||
Result:=F.DisplayText
|
||||
@ -598,10 +603,11 @@ begin
|
||||
end
|
||||
else if (F.DataType=ftBoolean) then
|
||||
begin
|
||||
If F.AsBoolean then
|
||||
Result:=FormatSettings.BooleanTrue
|
||||
else
|
||||
Result:=FormatSettings.BooleanFalse;
|
||||
if (Not F.IsNull) then
|
||||
If F.AsBoolean then
|
||||
Result:=FormatSettings.BooleanTrue
|
||||
else
|
||||
Result:=FormatSettings.BooleanFalse;
|
||||
If (Result='') then
|
||||
if FormatSettings.UseDisplayText then
|
||||
Result:=F.DisplayText
|
||||
@ -610,7 +616,7 @@ begin
|
||||
end
|
||||
else if (F.DataType=ftDate) then
|
||||
begin
|
||||
If (FormatSettings.DateFormat<>'') then
|
||||
If (FormatSettings.DateFormat<>'') and (not F.IsNull) then
|
||||
Result:=FormatDateTime(FormatSettings.DateFormat,F.AsDateTime)
|
||||
else if FormatSettings.UseDisplayText then
|
||||
Result:=F.DisplayText
|
||||
@ -619,7 +625,7 @@ begin
|
||||
end
|
||||
else if (F.DataType=ftTime) then
|
||||
begin
|
||||
If (FormatSettings.TimeFormat<>'') then
|
||||
If (FormatSettings.TimeFormat<>'') and (not F.IsNull) then
|
||||
Result:=FormatDateTime(FormatSettings.TimeFormat,F.AsDateTime)
|
||||
else if FormatSettings.UseDisplayText then
|
||||
Result:=F.DisplayText
|
||||
@ -628,7 +634,7 @@ begin
|
||||
end
|
||||
else if (F.DataType in [ftDateTime,ftTimeStamp]) then
|
||||
begin
|
||||
If (FormatSettings.DateTimeFormat<>'') then
|
||||
If (FormatSettings.DateTimeFormat<>'') and (not F.IsNull) then
|
||||
Result:=FormatDateTime(FormatSettings.DateTimeFormat,F.AsDateTime)
|
||||
else if FormatSettings.UseDisplayText then
|
||||
Result:=F.DisplayText
|
||||
@ -637,13 +643,13 @@ begin
|
||||
end
|
||||
else if (F.DataType=ftCurrency) then
|
||||
begin
|
||||
If (FormatSettings.CurrencySymbol<>'') then
|
||||
If (FormatSettings.CurrencySymbol<>'') and (not F.IsNull) then
|
||||
begin
|
||||
FS:=DefaultFormatSettings;
|
||||
FS.CurrencyString:=FormatSettings.CurrencySymbol;
|
||||
Result:=CurrToStrF(F.AsCurrency,ffCurrency,FormatSettings.CurrencyDigits,FS);
|
||||
end
|
||||
else if FormatSettings.UseDisplayText then
|
||||
else if FormatSettings.UseDisplayText then
|
||||
Result:=F.DisplayText
|
||||
else
|
||||
Result:=F.AsUTF8String;
|
||||
@ -839,6 +845,7 @@ end;
|
||||
procedure TCustomExportFormatSettings.InitSettings;
|
||||
begin
|
||||
FIntegerFormat:='%d';
|
||||
FHandleNullField:=True;
|
||||
FDateFormat:=ShortDateFormat;
|
||||
FTimeFormat:=ShortTimeFormat;
|
||||
FDateTimeFormat:=ShortDateFormat+' '+ShortTimeFormat;
|
||||
@ -863,6 +870,7 @@ begin
|
||||
If (Source is TCustomExportFormatSettings) then
|
||||
begin
|
||||
FS:=Source as TCustomExportFormatSettings;
|
||||
FHandleNullField:=FS.FHandleNullField;
|
||||
FBooleanFalse:=FS.FBooleanFalse;
|
||||
FBooleanTrue:=FS.FBooleanTrue;
|
||||
FCurrencyDigits:=FS.FCurrencyDigits;
|
||||
|
Loading…
Reference in New Issue
Block a user