Author: rfm
Date: Mon Nov 2 19:31:04 2015
New Revision: 39123
URL: http://svn.gna.org/viewcvs/gnustep?rev=39123&view=rev
Log:
another tweak for using pointer identity rather than object equality
Modified:
libs/gui/trunk/Source/NSOutlineView.m
Modified: libs/gui/trunk/Source/NSOutlineView.m
URL:
http://svn.gna.org/viewcvs/gnustep/libs/gui/trunk/Source/NSOutlineView.m?rev=39123&r1=39122&r2=39123&view=diff
==============================================================================
--- libs/gui/trunk/Source/NSOutlineView.m (original)
+++ libs/gui/trunk/Source/NSOutlineView.m Mon Nov 2 19:31:04 2015
@@ -65,6 +65,7 @@
#import "GSGuiPrivate.h"
#include <math.h>
+static NSMapTableKeyCallBacks keyCallBacks;
static NSNotificationCenter *nc = nil;
static const int current_version = 1;
@@ -144,6 +145,11 @@
{
[self setVersion: current_version];
nc = [NSNotificationCenter defaultCenter];
+ /* We need special map table callbacks, to check for identical
+ * objects rather than merely equal objects.
+ */
+ keyCallBacks = NSObjectMapKeyCallBacks;
+ keyCallBacks.isEqual = NSOwnedPointerMapKeyCallBacks.isEqual;
#if 0
/* Old Interface Builder style. */
collapsed = [NSImage imageNamed: @"common_outlineCollapsed"];
@@ -208,7 +214,7 @@
* Causes the outline column, the column containing the expand/collapse
* gadget, to resize based on the amount of space needed by widest content.
*/
-- (BOOL)autoResizesOutlineColumn
+- (BOOL) autoResizesOutlineColumn
{
return _autoResizesOutlineColumn;
}
@@ -217,7 +223,7 @@
* Causes the outline column, the column containing the expand/collapse
* gadget, to resize based on the amount of space needed by widest content.
*/
-- (BOOL)autosaveExpandedItems
+- (BOOL) autosaveExpandedItems
{
return _autosaveExpandedItems;
}
@@ -649,7 +655,7 @@
/**
* Sets the amount, in points, that each level is to be indented by.
*/
-- (void)setIndentationPerLevel: (CGFloat)newIndentLevel
+- (void) setIndentationPerLevel: (CGFloat)newIndentLevel
{
_indentationPerLevel = newIndentLevel;
}
@@ -719,10 +725,10 @@
// create a new empty one
_items = [[NSMutableArray alloc] init];
- _itemDict = NSCreateMapTable(NSObjectMapKeyCallBacks,
+ _itemDict = NSCreateMapTable(keyCallBacks,
NSObjectMapValueCallBacks,
64);
- _levelOfItems = NSCreateMapTable(NSObjectMapKeyCallBacks,
+ _levelOfItems = NSCreateMapTable(keyCallBacks,
NSObjectMapValueCallBacks,
64);
@@ -847,8 +853,8 @@
position += _columnOrigins[_clickedColumn];
if ([self isExpandable:item]
- && location.x >= position
- && location.x <= position + [image size].width)
+ && location.x >= position
+ && location.x <= position + [image size].width)
{
BOOL withChildren =
([theEvent modifierFlags] & NSAlternateKeyMask) ? YES : NO;
_______________________________________________
Gnustep-cvs mailing list
[email protected]
https://mail.gna.org/listinfo/gnustep-cvs