* Patch from Martin Schreiber to fix streaming inherited collections

(mantis #11774)

git-svn-id: trunk@11679 -
This commit is contained in:
michael 2008-08-31 21:57:27 +00:00
parent e4b4875bb0
commit d0d3a79731
2 changed files with 7 additions and 3 deletions

View File

@ -772,14 +772,18 @@ function CollectionsEqual(C1, C2: TCollection; Owner1, Owner2: TComponent): Bool
if (c1.classtype<>c2.classtype) or
(c1.count<>c2.count) then
exit;
if c1.count = 0 then
begin
result:= true;
exit;
end;
s1:=tmemorystream.create;
try
s2:=tmemorystream.create;
try
stream_collection(s1,c1,owner1);
stream_collection(s2,c2,owner2);
result:=(s1.size=s2.size) and (CompareChar(s1.memory,s2.memory,s1.size)=0);
result:=(s1.size=s2.size) and (CompareChar(s1.memory^,s2.memory^,s1.size)=0);
finally
s2.free;
end;

View File

@ -938,7 +938,7 @@ begin
else if ObjValue.InheritsFrom(TCollection) then
begin
if (not HasAncestor) or (not CollectionsEqual(TCollection(ObjValue),
TCollection(GetObjectProp(Ancestor, PropInfo)))) then
TCollection(GetObjectProp(Ancestor, PropInfo)),root,rootancestor)) then
begin
Driver.BeginProperty(FPropPath + PPropInfo(PropInfo)^.Name);
SavedPropPath := FPropPath;