mirror of
https://github.com/gnustep/libs-gdl2.git
synced 2025-04-22 12:55:44 +00:00
* EOControl/EOEditingContext.m (_mutableSetFromToManyArray:):
Add internal documentation. Filter managed objects instead of attempting to convert gids to objects. Reported by Manuel Guesdon. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gdl2/trunk@21183 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
212c9ca65d
commit
be6e30c735
2 changed files with 19 additions and 5 deletions
|
@ -1,3 +1,10 @@
|
|||
2005-05-03 David Ayers <d.ayers@inode.at>
|
||||
|
||||
* EOControl/EOEditingContext.m (_mutableSetFromToManyArray:):
|
||||
Add internal documentation. Filter managed objects instead
|
||||
of attempting to convert gids to objects. Reported by Manuel
|
||||
Guesdon.
|
||||
|
||||
2005-05-03 Manuel Guesdon <mguesdon@orange-concept.com>
|
||||
|
||||
* EOControl/EOEditingContext.m:
|
||||
|
|
|
@ -787,6 +787,10 @@ _mergeValueForKey(id obj, id value,
|
|||
return ([chgs count] == 0) ? nil : chgs;
|
||||
}
|
||||
|
||||
/*
|
||||
* Filters the objects of array which are managed by the receiver
|
||||
* into a mutable set.
|
||||
*/
|
||||
- (NSMutableSet *)_mutableSetFromToManyArray: (NSArray *)array
|
||||
{
|
||||
EOGlobalID *gid;
|
||||
|
@ -797,7 +801,7 @@ _mergeValueForKey(id obj, id value,
|
|||
n = [array count];
|
||||
set = [NSMutableSet setWithCapacity: n];
|
||||
|
||||
NSAssert(_objectsByGID, @"_objectsByGID does not exist!");
|
||||
NSAssert(_globalIDsByObject, @"_globalIDsByObject does not exist!");
|
||||
|
||||
if (n>0)
|
||||
{
|
||||
|
@ -806,10 +810,13 @@ _mergeValueForKey(id obj, id value,
|
|||
|
||||
for (i=0; i<n; i++)
|
||||
{
|
||||
gid = GDL2_ObjectAtIndexWithImp(array, oaiIMP, i);
|
||||
obj = NSMapGet(_objectsByGID, gid);
|
||||
NSAssert1(obj,@"No object for gid %@", gid);
|
||||
GDL2_AddObjectWithImp(set, aoIMP, obj);
|
||||
obj = GDL2_ObjectAtIndexWithImp(array, oaiIMP, i);
|
||||
gid = NSMapGet(_globalIDsByObject, obj);
|
||||
|
||||
if (gid)
|
||||
{
|
||||
GDL2_AddObjectWithImp(set, aoIMP, obj);
|
||||
}
|
||||
}
|
||||
};
|
||||
return set;
|
||||
|
|
Loading…
Reference in a new issue