From 9ac7c93fbf4e549929d6211dee1593b4e6fa920c Mon Sep 17 00:00:00 2001 From: michael starke Date: Mon, 17 Oct 2016 18:17:52 +0200 Subject: [PATCH] bubbling NSEditorRegistration calls from NSViewController up to NSDocument --- MacPass/MPCustomFieldTableCellView.m | 9 +++++++++ MacPass/MPDocument.m | 1 - MacPass/MPViewController.m | 11 +++++++++++ 3 files changed, 20 insertions(+), 1 deletion(-) diff --git a/MacPass/MPCustomFieldTableCellView.m b/MacPass/MPCustomFieldTableCellView.m index 3df1ee31..64cc641d 100644 --- a/MacPass/MPCustomFieldTableCellView.m +++ b/MacPass/MPCustomFieldTableCellView.m @@ -10,6 +10,15 @@ #import "MPDocument.h" @implementation MPCustomFieldTableCellView + +- (void)objectDidBeginEditing:(id)editor { + [self.window.windowController.document objectDidBeginEditing:editor]; +} + +- (void)objectDidEndEditing:(id)editor { + [self.window.windowController.document objectDidEndEditing:editor]; +} + - (void)setBackgroundStyle:(NSBackgroundStyle)backgroundStyle { super.backgroundStyle = NSBackgroundStyleLight; } diff --git a/MacPass/MPDocument.m b/MacPass/MPDocument.m index 3abcb399..999803cf 100644 --- a/MacPass/MPDocument.m +++ b/MacPass/MPDocument.m @@ -821,5 +821,4 @@ NSString *const MPDocumentGroupKey = @"MPDocumentGrou [[NSNotificationCenter defaultCenter] postNotificationName:MPDocumentDidChangeModelPropertyNotification object:self]; } - @end diff --git a/MacPass/MPViewController.m b/MacPass/MPViewController.m index d9d35f28..f41a0701 100644 --- a/MacPass/MPViewController.m +++ b/MacPass/MPViewController.m @@ -38,6 +38,17 @@ } } +#pragma mark NSEditorRegistration +- (void)objectDidBeginEditing:(id)editor { + [self.windowController.document objectDidBeginEditing:editor]; + [super objectDidBeginEditing:editor]; +} + +- (void)objectDidEndEditing:(id)editor { + [self.windowController.document objectDidEndEditing:editor]; + [super objectDidEndEditing:editor]; +} + #pragma mark Binding observation - (void)setValue:(id)value forKeyPath:(NSString *)keyPath { if([keyPath hasPrefix:@"representedObject."]) {