Revision: 15739
http://sourceforge.net/p/skim-app/code/15739
Author: hofman
Date: 2025-10-31 15:28:21 +0000 (Fri, 31 Oct 2025)
Log Message:
-----------
check class instead of implementing convenience property
Modified Paths:
--------------
trunk/NSWindowController_SKExtensions.h
trunk/NSWindowController_SKExtensions.m
trunk/SKMainWindowController.m
trunk/SKNoteWindowController.m
Modified: trunk/NSWindowController_SKExtensions.h
===================================================================
--- trunk/NSWindowController_SKExtensions.h 2025-10-31 10:17:32 UTC (rev
15738)
+++ trunk/NSWindowController_SKExtensions.h 2025-10-31 15:28:21 UTC (rev
15739)
@@ -44,8 +44,6 @@
- (void)setWindowFrameAutosaveNameOrCascade:(NSString *)name;
-@property (nonatomic, readonly, getter=isNoteWindowController) BOOL
noteWindowController;
-
- (void)beginSheetModalForWindow:(NSWindow *)window completionHandler:(void (^
_Nullable)(NSModalResponse result))handler;
- (IBAction)dismissSheet:(nullable id)sender;
Modified: trunk/NSWindowController_SKExtensions.m
===================================================================
--- trunk/NSWindowController_SKExtensions.m 2025-10-31 10:17:32 UTC (rev
15738)
+++ trunk/NSWindowController_SKExtensions.m 2025-10-31 15:28:21 UTC (rev
15739)
@@ -63,8 +63,6 @@
NSMapInsert(nextWindowLocations, (__bridge void *)name, &point);
}
-- (BOOL)isNoteWindowController { return NO; }
-
- (void)beginSheetModalForWindow:(NSWindow *)window completionHandler:(void
(^)(NSModalResponse result))handler {
NS_VALID_UNTIL_END_OF_SCOPE __block id strongSelf = self;
[window beginSheet:[self window] completionHandler:^(NSModalResponse
result){
Modified: trunk/SKMainWindowController.m
===================================================================
--- trunk/SKMainWindowController.m 2025-10-31 10:17:32 UTC (rev 15738)
+++ trunk/SKMainWindowController.m 2025-10-31 15:28:21 UTC (rev 15739)
@@ -1078,7 +1078,7 @@
[pdfView setCurrentAnnotation:nil];
[self commitEditing];
for (NSWindowController *wc in [[[self document] windowControllers]
copy]) {
- if ([wc isNoteWindowController])
+ if ([wc isKindOfClass:[SKNoteWindowController class]])
[wc close];
}
if ([undoManager groupingLevel] > level) {
@@ -1438,7 +1438,7 @@
- (void)removeAllObjectsFromNotes {
if ([notes count]) {
for (NSWindowController *wc in [[[self document] windowControllers]
copy]) {
- if ([wc isNoteWindowController]) {
+ if ([wc isKindOfClass:[SKNoteWindowController class]]) {
[wc discardEditing];
[wc close];
}
@@ -2543,7 +2543,7 @@
- (NSWindowController *)windowControllerForNote:(PDFAnnotation *)annotation {
for (id wc in [[self document] windowControllers]) {
- if ([wc isNoteWindowController] && [[wc note] isEqual:annotation])
+ if ([wc isKindOfClass:[SKNoteWindowController class]] && [[wc note]
isEqual:annotation])
return wc;
}
return nil;
Modified: trunk/SKNoteWindowController.m
===================================================================
--- trunk/SKNoteWindowController.m 2025-10-31 10:17:32 UTC (rev 15738)
+++ trunk/SKNoteWindowController.m 2025-10-31 15:28:21 UTC (rev 15739)
@@ -314,8 +314,6 @@
return [[[[self note] type] typeName]
stringByAppendingEmDashAndString:[[self note] string] ?: @""];
}
-- (BOOL)isNoteWindowController { return YES; }
-
- (BOOL)isNoteType {
return [note isNote];
}
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit