From 7dc71dea5de43d236854ee6a1c922257121bdb2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9gys=20Borges=20da=20Silveira?= Date: Tue, 19 Feb 2019 09:01:27 -0300 Subject: [PATCH] fixes to correct compile in Delphi Tokyo and Rio --- sources/MVCFramework.Cache.pas | 7 +++++-- sources/MVCFramework.Serializer.Abstract.pas | 5 +++++ sources/MVCFramework.Serializer.JsonDataObjects.pas | 6 +++++- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/sources/MVCFramework.Cache.pas b/sources/MVCFramework.Cache.pas index 7a83177b..b7cc07b1 100644 --- a/sources/MVCFramework.Cache.pas +++ b/sources/MVCFramework.Cache.pas @@ -84,7 +84,10 @@ uses function TMVCCache.SetValue(const AName: string; const AValue: TValue): TMVCCacheItem; var lCacheItem: TMVCCacheItem; + Value: TValue; begin + Value := AValue; + FMREW.DoWithWriteLock( procedure var @@ -92,13 +95,13 @@ begin begin if FStorage.TryGetValue(AName, lItem) then begin - lItem.Value := AValue; + lItem.Value := Value; end else begin lCacheItem := TMVCCacheItem.Create; try - lCacheItem.Value := AValue; + lCacheItem.Value := Value; FStorage.Add(AName, lCacheItem); except lCacheItem.Free; diff --git a/sources/MVCFramework.Serializer.Abstract.pas b/sources/MVCFramework.Serializer.Abstract.pas index fb00f593..f3cbde4b 100644 --- a/sources/MVCFramework.Serializer.Abstract.pas +++ b/sources/MVCFramework.Serializer.Abstract.pas @@ -231,7 +231,12 @@ end; procedure TMVCAbstractSerializer.RegisterTypeSerializer(const ATypeInfo: PTypeInfo; AInstance: IMVCTypeSerializer); begin + {$IFDEF NEXTGEN} + LogD('Registering TypeSerializer for: ' + PChar(Pointer(ATypeInfo.Name))); + {$ELSE} LogD('Registering TypeSerializer for: ' + string(ATypeInfo.Name)); + {$ENDIF} + FTypeSerializers.AddOrSetValue(ATypeInfo, AInstance); end; diff --git a/sources/MVCFramework.Serializer.JsonDataObjects.pas b/sources/MVCFramework.Serializer.JsonDataObjects.pas index 3aab7d1f..56d316ca 100644 --- a/sources/MVCFramework.Serializer.JsonDataObjects.pas +++ b/sources/MVCFramework.Serializer.JsonDataObjects.pas @@ -366,7 +366,7 @@ begin ftFMTBcd, ftBCD: AJsonObject.F[FieldName] := BcdToDouble(ADataSet.Fields[I].AsBcd); - ftGraphic, ftBlob, ftStream: + ftGraphic, ftBlob, ftStream, ftOraBlob: begin MS := TMemoryStream.Create; try @@ -1085,7 +1085,11 @@ begin end; tkFloat: begin + {$IFDEF NEXTGEN} + if PChar(Pointer(Value.TypeInfo.Name)) = 'TDate' then + {$ELSE} if Value.TypeInfo.Name = 'TDate' then + {$ENDIF} begin JSON.DUtc[KeyName] := Value.AsExtended; end