Revision: 12682 http://sourceforge.net/p/skim-app/code/12682 Author: hofman Date: 2022-01-04 15:36:25 +0000 (Tue, 04 Jan 2022) Log Message: ----------- Add observer for undoManager after setting the delegate
Modified Paths: -------------- trunk/SKPDFView.m Modified: trunk/SKPDFView.m =================================================================== --- trunk/SKPDFView.m 2022-01-04 15:34:45 UTC (rev 12681) +++ trunk/SKPDFView.m 2022-01-04 15:36:25 UTC (rev 12682) @@ -5295,7 +5295,10 @@ } - (void)setDelegate:(id <SKPDFViewDelegate>)newDelegate { - if (newDelegate) { + if ([self delegate] && newDelegate == nil) + [self cleanup]; + [super setDelegate:newDelegate]; + if ([self delegate]) { NSNotificationCenter *nc = [NSNotificationCenter defaultCenter]; NSUndoManager *undoManager = [self undoManager]; [nc addObserver:self selector:@selector(handleUndoGroupOpenedOrClosedNotification:) @@ -5303,9 +5306,6 @@ [nc addObserver:self selector:@selector(handleUndoGroupOpenedOrClosedNotification:) name:NSUndoManagerDidCloseUndoGroupNotification object:undoManager]; } - if ([self delegate] && newDelegate == nil) - [self cleanup]; - [super setDelegate:newDelegate]; } - (NSString *)currentColorDefaultKeyForAlternate:(BOOL)isAlt { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. _______________________________________________ Skim-app-commit mailing list Skim-app-commit@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/skim-app-commit