mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-23 05:32:11 +00:00
* Source/NSCollectionViewItem.m: Fix reference counting in
-copyWithZone:. Remove method -view again. * Source/NSArrayController.m: Fix reference counting in -newItemForRepresentedObject. Protect -_resetItemSize from missing prototype view. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@38392 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
5199325e10
commit
6a2ccd78ac
3 changed files with 12 additions and 10 deletions
|
@ -1,3 +1,11 @@
|
|||
2015-03-10 Fred Kiefer <FredKiefer@gmx.de>
|
||||
|
||||
* Source/NSCollectionViewItem.m: Fix reference counting in
|
||||
-copyWithZone:. Remove method -view again.
|
||||
* Source/NSArrayController.m: Fix reference counting in
|
||||
-newItemForRepresentedObject. Protect -_resetItemSize from missing
|
||||
prototype view.
|
||||
|
||||
2015-03-08 Fred Kiefer <FredKiefer@gmx.de>
|
||||
|
||||
* Source/NSCollectionView.m (-tile): Prevent _numberOfColumns from
|
||||
|
|
|
@ -125,7 +125,7 @@ static NSString *placeholderItem = nil;
|
|||
|
||||
- (void) _resetItemSize
|
||||
{
|
||||
if (itemPrototype)
|
||||
if (itemPrototype && ([itemPrototype view] != nil))
|
||||
{
|
||||
_itemSize = [[itemPrototype view] frame].size;
|
||||
_minItemSize = NSMakeSize (_itemSize.width, _itemSize.height);
|
||||
|
@ -240,6 +240,7 @@ static NSString *placeholderItem = nil;
|
|||
}
|
||||
else
|
||||
{
|
||||
[self _resetItemSize];
|
||||
// Force recalculation of each item's frame
|
||||
_itemSize = _minItemSize;
|
||||
_tileWidth = -1.0;
|
||||
|
@ -482,7 +483,7 @@ static NSString *placeholderItem = nil;
|
|||
NSCollectionViewItem *collectionItem = nil;
|
||||
if (itemPrototype)
|
||||
{
|
||||
ASSIGN(collectionItem, [itemPrototype copy]);
|
||||
collectionItem = [itemPrototype copy];
|
||||
[collectionItem setRepresentedObject: object];
|
||||
}
|
||||
return AUTORELEASE (collectionItem);
|
||||
|
|
|
@ -101,13 +101,6 @@
|
|||
ASSIGN(imageView, anImageView);
|
||||
}
|
||||
|
||||
- (NSView *) view
|
||||
{
|
||||
// FIXME
|
||||
[[self textField] setStringValue: [self representedObject]];
|
||||
return [self textField];
|
||||
}
|
||||
|
||||
- (id) initWithCoder: (NSCoder *)aCoder
|
||||
{
|
||||
self = [super initWithCoder: aCoder];
|
||||
|
@ -161,7 +154,7 @@
|
|||
NSData *itemAsData = [NSKeyedArchiver archivedDataWithRootObject: self];
|
||||
NSCollectionViewItem *newItem =
|
||||
[NSKeyedUnarchiver unarchiveObjectWithData: itemAsData];
|
||||
return newItem;
|
||||
return RETAIN(newItem);
|
||||
}
|
||||
|
||||
@end
|
||||
|
|
Loading…
Reference in a new issue