mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-12-11 05:41:05 +01:00
* Patch from Martin Schreiber to fix streaming inherited collections
(mantis #11774) git-svn-id: trunk@11679 -
This commit is contained in:
parent
e4b4875bb0
commit
d0d3a79731
@ -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;
|
||||
|
||||
@ -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;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user