Browse Source

* Fixed writing of default float values

git-svn-id: trunk@11748 -
michael 17 năm trước cách đây
mục cha
commit
d77b2b2c0c
1 tập tin đã thay đổi với 5 bổ sung1 xóa
  1. 5 1
      rtl/objpas/classes/writer.inc

+ 5 - 1
rtl/objpas/classes/writer.inc

@@ -754,6 +754,7 @@ var
   Ident: String;
   IntToIdentFn: TIntToIdent;
 {$ifndef FPUNONE}
+  SingleV : Single;
   FloatValue, DefFloatValue: Extended;
 {$endif}
   MethodValue: TMethod;
@@ -832,7 +833,10 @@ begin
         if HasAncestor then
           DefFloatValue := GetFloatProp(Ancestor, PropInfo)
         else
-          DefFloatValue := PPropInfo(PropInfo)^.Default;
+          begin
+          DefValue :=PPropInfo(PropInfo)^.Default;
+          DefFloatValue:=PSingle(@PPropInfo(PropInfo)^.Default)^;
+          end;
         if (FloatValue<>DefFloatValue) or (DefValue=longint($80000000)) then
         begin
           Driver.BeginProperty(FPropPath + PPropInfo(PropInfo)^.Name);