Procházet zdrojové kódy

* Fixed writing of default boolean values

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

+ 6 - 2
rtl/objpas/classes/writer.inc

@@ -798,7 +798,7 @@ begin
           DefValue := GetOrdProp(Ancestor, PropInfo)
           DefValue := GetOrdProp(Ancestor, PropInfo)
         else
         else
           DefValue := PPropInfo(PropInfo)^.Default;
           DefValue := PPropInfo(PropInfo)^.Default;
-        //writeln(PPropInfo(PropInfo)^.Name, ', HasAncestor=', ord(HasAncestor), ', Value=', Value, ', Default=', DefValue);
+        // writeln(PPropInfo(PropInfo)^.Name, ', HasAncestor=', ord(HasAncestor), ', Value=', Value, ', Default=', DefValue);
         if (Value <> DefValue) or (DefValue=longint($80000000)) then
         if (Value <> DefValue) or (DefValue=longint($80000000)) then
         begin
         begin
           Driver.BeginProperty(FPropPath + PPropInfo(PropInfo)^.Name);
           Driver.BeginProperty(FPropPath + PPropInfo(PropInfo)^.Name);
@@ -1030,8 +1030,12 @@ begin
         if HasAncestor then
         if HasAncestor then
           DefBoolValue := GetOrdProp(Ancestor, PropInfo)<>0
           DefBoolValue := GetOrdProp(Ancestor, PropInfo)<>0
         else
         else
+          begin
           DefBoolValue := PPropInfo(PropInfo)^.Default<>0;
           DefBoolValue := PPropInfo(PropInfo)^.Default<>0;
-        if BoolValue <> DefBoolValue then
+          DefValue:=PPropInfo(PropInfo)^.Default;
+          end;
+        // writeln(PPropInfo(PropInfo)^.Name, ', HasAncestor=', ord(HasAncestor), ', Value=', Value, ', Default=', DefBoolValue);
+        if (BoolValue<>DefBoolValue) or (DefValue=longint($80000000)) then
           begin
           begin
           Driver.BeginProperty(FPropPath + PPropInfo(PropInfo)^.Name);
           Driver.BeginProperty(FPropPath + PPropInfo(PropInfo)^.Name);
           WriteBoolean(BoolValue);
           WriteBoolean(BoolValue);