浏览代码

* Fixed writing of default float values

git-svn-id: trunk@11748 -
michael 17 年之前
父节点
当前提交
d77b2b2c0c
共有 1 个文件被更改,包括 5 次插入1 次删除
  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);