Add method _keyPathForValueBinding in _setObjectValue for Outline view

This commit is contained in:
Gregory John Casamento 2024-08-20 22:56:18 -04:00
parent 27d57fe5eb
commit 1a188b7eb7

View file

@ -2048,15 +2048,13 @@ Also returns the child index relative to this parent. */
forTableColumn: (NSTableColumn *)tb
row: (NSInteger) index
{
NSString *keyPath = [tb _keyPathForValueBinding];
// If we have content binding the data source is used only
// like a delegate
NSDictionary *info = [GSKeyValueBinding infoForBinding: NSValueBinding forObject: tb];
if (info != nil)
if (keyPath != nil)
{
id theItem = [_items objectAtIndex: index];
NSString *ikp = [info objectForKey: NSObservedKeyPathKey];
NSUInteger location = [ikp rangeOfString: @"."].location;
NSString *keyPath = (location == NSNotFound ? ikp : [ikp substringFromIndex: location + 1]);
// Set the value on the keyPath.
[theItem setValue: value