Revision: 16379
          http://sourceforge.net/p/skim-app/code/16379
Author:   hofman
Date:     2026-06-09 15:24:17 +0000 (Tue, 09 Jun 2026)
Log Message:
-----------
combine add/remove annotation notification handlers

Modified Paths:
--------------
    trunk/SKPDFView.m

Modified: trunk/SKPDFView.m
===================================================================
--- trunk/SKPDFView.m   2026-06-09 15:20:34 UTC (rev 16378)
+++ trunk/SKPDFView.m   2026-06-09 15:24:17 UTC (rev 16379)
@@ -3091,7 +3091,7 @@
 
 #pragma mark Notification handling
 
-- (void)handleDidAddAnnotationNotification:(NSNotification *)notification {
+- (void)handleDidAddRemoveAnnotationNotification:(NSNotification 
*)notification {
     PDFAnnotation *annotation = [[notification userInfo] 
objectForKey:SKPDFDocumentAnnotationKey];
     
     [loupeController updateContents];
@@ -3108,15 +3108,6 @@
     }
 }
 
-- (void)handleDidRemoveAnnotationNotification:(NSNotification *)notification {
-    NSDictionary *userInfo = [notification userInfo];
-    PDFAnnotation *annotation = [userInfo 
objectForKey:SKPDFDocumentAnnotationKey];
-    
-    [loupeController updateContents];
-    if ([annotation isNote])
-        [self resetPDFToolTipRects];
-}
-
 - (void)handleWillMoveAnnotationNotification:(NSNotification *)notification {
     PDFAnnotation *annotation = [[notification userInfo] 
objectForKey:SKPDFDocumentAnnotationKey];
     
@@ -3124,8 +3115,7 @@
 }
 
 - (void)handleDidMoveAnnotationNotification:(NSNotification *)notification {
-    NSDictionary *userInfo = [notification userInfo];
-    PDFAnnotation *annotation = [userInfo 
objectForKey:SKPDFDocumentAnnotationKey];
+    PDFAnnotation *annotation = [[notification userInfo] 
objectForKey:SKPDFDocumentAnnotationKey];
     
     [self updatedAnnotation:annotation];
     if ([annotation isNote]) {
@@ -3145,12 +3135,10 @@
 - (void)registerForDocumentNotifications {
     NSNotificationCenter *nc = [NSNotificationCenter defaultCenter];
     PDFDocument *pdfDoc = [self document];
-    [nc addObserver:self 
selector:@selector(handleDidAddAnnotationNotification:)
+    [nc addObserver:self 
selector:@selector(handleDidAddRemoveAnnotationNotification:)
                              name:SKPDFDocumentDidAddAnnotationNotification 
object:pdfDoc];
     [nc addObserver:self 
selector:@selector(handleWillRemoveAnnotationNotification:)
                              
name:SKPDFDocumentWillRemoveAnnotationNotification object:pdfDoc];
-    [nc addObserver:self 
selector:@selector(handleDidRemoveAnnotationNotification:)
-                             name:SKPDFDocumentDidRemoveAnnotationNotification 
object:pdfDoc];
     [nc addObserver:self 
selector:@selector(handleWillMoveAnnotationNotification:)
                              name:SKPDFDocumentWillMoveAnnotationNotification 
object:pdfDoc];
     [nc addObserver:self 
selector:@selector(handleDidMoveAnnotationNotification:)

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

Reply via email to