Browse Source

+ Applied patch from Matthias Gaertner to stream booleans

michael 23 years ago
parent
commit
bddbfae551
1 changed files with 22 additions and 4 deletions
  1. 22 4
      fcl/inc/writer.inc

+ 22 - 4
fcl/inc/writer.inc

@@ -595,6 +595,8 @@ var
   SavedAncestor: TPersistent;
   SavedPropPath, Name: String;
   Int64Value, DefInt64Value: Int64;
+  BoolValue, DefBoolValue: boolean;
+  
 begin
 
   if (not Assigned(PPropInfo(PropInfo)^.SetProc)) or
@@ -779,14 +781,27 @@ begin
           DefInt64Value := GetInt64Prop(Ancestor, PropInfo)
         else
           DefInt64Value := 0;
-
         if Int64Value <> DefInt64Value then
         begin
           Driver.BeginProperty(FPropPath + PPropInfo(PropInfo)^.Name);
           WriteInteger(Int64Value);
-	  Driver.EndProperty;
+       	  Driver.EndProperty;
         end;
       end;
+    tkBool:
+      begin
+        BoolValue := GetOrdProp(Instance, PropInfo)<>0;
+        if HasAncestor then
+          DefBoolValue := GetOrdProp(Ancestor, PropInfo)<>0
+        else
+          DefBoolValue := false;
+        if BoolValue <> DefBoolValue then
+          begin
+          Driver.BeginProperty(FPropPath + PPropInfo(PropInfo)^.Name);
+          WriteBoolean(BoolValue);
+          Driver.EndProperty;
+          end;
+      end;
   end;
 end;
 
@@ -808,7 +823,10 @@ end;}
 
 {
   $Log$
-  Revision 1.3  2000-12-21 09:10:16  sg
+  Revision 1.4  2002-09-03 06:02:57  michael
+  + Applied patch from Matthias Gaertner to stream booleans
+
+  Revision 1.3  2000/12/21 09:10:16  sg
   Merged from fixbranch:
   * Applied bugfix by Mattias Gaertner for TWriter.WriteProperty
     (writing of NIL object instanced caused an invalid access)
@@ -817,4 +835,4 @@ end;}
   Revision 1.2  2000/07/13 11:33:01  michael
   + removed logs
  
-}
+}