Revision: 7692
          http://skim-app.svn.sourceforge.net/skim-app/?rev=7692&view=rev
Author:   hofman
Date:     2012-05-08 09:16:05 +0000 (Tue, 08 May 2012)
Log Message:
-----------
reset Apple's tooltips for notes when the note changes

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

Modified: trunk/SKMainWindowController.m
===================================================================
--- trunk/SKMainWindowController.m      2012-03-30 10:37:14 UTC (rev 7691)
+++ trunk/SKMainWindowController.m      2012-05-08 09:16:05 UTC (rev 7692)
@@ -2278,8 +2278,10 @@
                     [secondaryPdfView setNeedsDisplayInRect:oldRect 
ofPage:page];
                 }
             }
-            if ([[note type] isEqualToString:SKNNoteString] && [keyPath 
isEqualToString:SKNPDFAnnotationBoundsKey])
+            if ([[note type] isEqualToString:SKNNoteString] && [keyPath 
isEqualToString:SKNPDFAnnotationBoundsKey]) {
+                [pdfView annotationsChangedOnPage:[note page]];
                 [pdfView resetPDFToolTipRects];
+            }
             
             if ([keyPath isEqualToString:SKNPDFAnnotationBoundsKey] || 
[keyPath isEqualToString:SKNPDFAnnotationStringKey] || [keyPath 
isEqualToString:SKNPDFAnnotationTextKey] || [keyPath 
isEqualToString:SKNPDFAnnotationColorKey] || [keyPath 
isEqualToString:SKNPDFAnnotationUserNameKey] || [keyPath 
isEqualToString:SKNPDFAnnotationModificationDateKey]) {
                 [rightSideController.noteArrayController rearrangeObjects];

Modified: trunk/SKPDFView.m
===================================================================
--- trunk/SKPDFView.m   2012-03-30 10:37:14 UTC (rev 7691)
+++ trunk/SKPDFView.m   2012-05-08 09:16:05 UTC (rev 7692)
@@ -1899,11 +1899,10 @@
     [annotation setShouldPrint:hideNotes == NO || [annotation isSkimNote] == 
NO];
     [page addAnnotation:annotation];
     [self setNeedsDisplayForAnnotation:annotation];
+    [self annotationsChangedOnPage:page];
     [self resetPDFToolTipRects];
-    if ([annotation isSkimNote]) {
-        [accessibilityChildren release];
-        accessibilityChildren = nil;
-    }
+    if ([annotation isSkimNote])
+        SKDESTROY(accessibilityChildren);
     [[NSNotificationCenter defaultCenter] 
postNotificationName:SKPDFViewDidAddAnnotationNotification object:self 
userInfo:[NSDictionary dictionaryWithObjectsAndKeys:page, SKPDFViewPageKey, 
annotation, SKPDFViewAnnotationKey, nil]];                
 }
 
@@ -1925,7 +1924,7 @@
 
 - (void)removeAnnotation:(PDFAnnotation *)annotation {
     PDFAnnotation *wasAnnotation = [annotation retain];
-    PDFPage *page = [wasAnnotation page];
+    PDFPage *page = [[wasAnnotation page] retain];
     
     [[[self documentUndoManager] prepareWithInvocationTarget:self] 
addAnnotation:wasAnnotation toPage:page];
     if ([self isEditing] && activeAnnotation == annotation)
@@ -1934,19 +1933,19 @@
                [self setActiveAnnotation:nil];
     [self setNeedsDisplayForAnnotation:wasAnnotation];
     [page removeAnnotation:wasAnnotation];
-    if ([wasAnnotation isSkimNote]) {
-        [accessibilityChildren release];
-        accessibilityChildren = nil;
-    }
+    if ([wasAnnotation isSkimNote])
+        SKDESTROY(accessibilityChildren);
+    [self annotationsChangedOnPage:page];
     if ([[wasAnnotation type] isEqualToString:SKNNoteString])
         [self resetPDFToolTipRects];
     [[NSNotificationCenter defaultCenter] 
postNotificationName:SKPDFViewDidRemoveAnnotationNotification object:self 
         userInfo:[NSDictionary dictionaryWithObjectsAndKeys:wasAnnotation, 
SKPDFViewAnnotationKey, page, SKPDFViewPageKey, nil]];
     [wasAnnotation release];
+    [page release];
 }
 
 - (void)moveAnnotation:(PDFAnnotation *)annotation toPage:(PDFPage *)page {
-    PDFPage *oldPage = [annotation page];
+    PDFPage *oldPage = [[annotation page] retain];
     [[[self documentUndoManager] prepareWithInvocationTarget:self] 
moveAnnotation:annotation toPage:oldPage];
     [[self documentUndoManager] setActionName:NSLocalizedString(@"Edit Note", 
@"Undo action name")];
     [self setNeedsDisplayForAnnotation:annotation];
@@ -1955,11 +1954,13 @@
     [page addAnnotation:annotation];
     [annotation release];
     [self setNeedsDisplayForAnnotation:annotation];
+    [self annotationsChangedOnPage:oldPage];
+    [self annotationsChangedOnPage:page];
     if ([[annotation type] isEqualToString:SKNNoteString])
         [self resetPDFToolTipRects];
-    [accessibilityChildren release];
-    accessibilityChildren = nil;
+    SKDESTROY(accessibilityChildren);
     [[NSNotificationCenter defaultCenter] 
postNotificationName:SKPDFViewDidMoveAnnotationNotification object:self 
userInfo:[NSDictionary dictionaryWithObjectsAndKeys:oldPage, 
SKPDFViewOldPageKey, page, SKPDFViewNewPageKey, annotation, 
SKPDFViewAnnotationKey, nil]];                
+    [oldPage release];
 }
 
 - (void)editThisAnnotation:(id)sender {

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit

Reply via email to