Pārlūkot izejas kodu

【综合】对已存在的注释打开后,操作没有undo、redo操作(SDK2.0.0后 注释列表在page解析的时候加载),所以需要自己监听

dinglingui 6 mēneši atpakaļ
vecāks
revīzija
5d4e96bcc3

+ 7 - 0
PDF Office/PDF Master/Class/PDFWindowController/PDFListView/CPDFListView.m

@@ -251,6 +251,13 @@ NSNotificationName const CPDFListViewDisplayModeChangeNotification = @"CPDFListV
     
     [self resetPDFToolTipRectsForAfterDelay];
     
+    for(NSInteger i = 0;i<self.document.pageCount;i++) {
+        CPDFPage *page = [self.document pageAtIndex:i];
+        for (CPDFAnnotation *annotation in page.annotations) {
+            [[NSNotificationCenter defaultCenter] postNotificationName:CPDFPageDidLoadAnnotationNotification object:annotation];
+        }
+    }
+    
     [self.window makeFirstResponder:self];
     
 }

+ 0 - 7
PDF Office/PDF Master/Class/PDFWindowController/PDFListView/CPDFListViewExtension/CPDFListView+UndoManager.m

@@ -27,13 +27,6 @@ static NSString *CPDFListViewAnnotationPropertiesObservationContext = @"CPDFList
     [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(PDFPageDidLoadAnnotationNotification:) name:@"CPDFPageDidLoadAnnotationNotification" object:nil];
     [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(PDFPageDidAddAnnotationNotification:) name:@"CPDFPageDidAddAnnotationNotification" object:nil];
     [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(PDFPageDidRemoveAnnotationNotification:) name:@"CPDFPageDidRemoveAnnotationNotification" object:nil];
-    
-    for(NSInteger i = 0;i<self.document.pageCount;i++) {
-        CPDFPage *page = [self.document pageAtIndex:i];
-        for (CPDFAnnotation *annotation in page.annotations) {
-            [[NSNotificationCenter defaultCenter] postNotificationName:CPDFPageDidLoadAnnotationNotification object:annotation];
-        }
-    }
 }
 
 - (void)startObservingNotes:(NSArray *)newNotes {