Author: dpsimons
Date: Wed Sep 9 00:54:55 2015
New Revision: 38975
URL: http://svn.gna.org/viewcvs/gnustep?rev=38975&view=rev
Log:
expand or collapse all when item is nil
Modified:
libs/gui/branches/gnustep_testplant_branch/ChangeLog
libs/gui/branches/gnustep_testplant_branch/Source/NSOutlineView.m
Modified: libs/gui/branches/gnustep_testplant_branch/ChangeLog
URL:
http://svn.gna.org/viewcvs/gnustep/libs/gui/branches/gnustep_testplant_branch/ChangeLog?rev=38975&r1=38974&r2=38975&view=diff
==============================================================================
--- libs/gui/branches/gnustep_testplant_branch/ChangeLog (original)
+++ libs/gui/branches/gnustep_testplant_branch/ChangeLog Wed Sep 9
00:54:55 2015
@@ -1,3 +1,9 @@
+2015-09-08 Doug Simons <[email protected]>
+
+ * Source/NSOutlineView.m: Update expandItem:expandChildren:
+ and collapseItem:collapseChildren: to expand or collapse all
+ when item is nil (as updated in OSX 10.5).
+
2015-08-25 Doug Simons <[email protected]>
* Source/GSTextFinder.m: Fix Ignore Case option to work.
Modified: libs/gui/branches/gnustep_testplant_branch/Source/NSOutlineView.m
URL:
http://svn.gna.org/viewcvs/gnustep/libs/gui/branches/gnustep_testplant_branch/Source/NSOutlineView.m?rev=38975&r1=38974&r2=38975&view=diff
==============================================================================
--- libs/gui/branches/gnustep_testplant_branch/Source/NSOutlineView.m
(original)
+++ libs/gui/branches/gnustep_testplant_branch/Source/NSOutlineView.m Wed Sep
9 00:54:55 2015
@@ -250,17 +250,21 @@
canCollapse = [_delegate outlineView: self shouldCollapseItem: item];
}
- if ([self isExpandable: item] && [self isItemExpanded: item] && canCollapse)
- {
- NSMutableDictionary *infoDict = [NSMutableDictionary dictionary];
-
- [infoDict setObject: item forKey: @"NSObject"];
-
- // Send out the notification to let observers know that this is about
- // to occur.
- [nc postNotificationName: NSOutlineViewItemWillCollapseNotification
- object: self
- userInfo: infoDict];
+ if ((item == nil || ([self isExpandable: item] && [self isItemExpanded:
item])) && canCollapse)
+ {
+ NSMutableDictionary *infoDict = nil;
+ if (item != nil)
+ {
+ infoDict = [NSMutableDictionary dictionary];
+
+ [infoDict setObject: item forKey: @"NSObject"];
+
+ // Send out the notification to let observers know that this is about
+ // to occur.
+ [nc postNotificationName: NSOutlineViewItemWillCollapseNotification
+ object: self
+ userInfo: infoDict];
+ }
// recursively find all children and call this method to close them.
// Note: The children must be collapsed before their parent item so
@@ -286,14 +290,17 @@
}
}
- // collapse...
- [self _closeItem: item];
-
- // Send out the notification to let observers know that this has
- // occured.
- [nc postNotificationName: NSOutlineViewItemDidCollapseNotification
- object: self
- userInfo: infoDict];
+ if (item != nil)
+ {
+ // collapse...
+ [self _closeItem: item];
+
+ // Send out the notification to let observers know that this has
+ // occured.
+ [nc postNotificationName: NSOutlineViewItemDidCollapseNotification
+ object: self
+ userInfo: infoDict];
+ }
// Should only mark the rect below the closed item for redraw
[self setNeedsDisplay: YES];
@@ -325,10 +332,10 @@
}
// if the item is expandable
- if ([self isExpandable: item])
+ if (item == nil || [self isExpandable: item])
{
// if it is not already expanded and it can be expanded, then expand
- if (![self isItemExpanded: item] && canExpand)
+ if (item != nil && ![self isItemExpanded: item] && canExpand)
{
NSMutableDictionary *infoDict = [NSMutableDictionary dictionary];
_______________________________________________
Gnustep-cvs mailing list
[email protected]
https://mail.gna.org/listinfo/gnustep-cvs