Procházet zdrojové kódy

* Fixed writing of default float values

git-svn-id: trunk@11748 -
michael před 17 roky
rodič
revize
d77b2b2c0c
1 změnil soubory, kde provedl 5 přidání a 1 odebrání
  1. 5 1
      rtl/objpas/classes/writer.inc

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

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