Revision: 9522
          http://sourceforge.net/p/skim-app/code/9522
Author:   hofman
Date:     2017-12-05 16:09:19 +0000 (Tue, 05 Dec 2017)
Log Message:
-----------
revert last commit, this messes up the undo stack

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

Modified: trunk/SKMainDocument.m
===================================================================
--- trunk/SKMainDocument.m      2017-12-05 16:07:47 UTC (rev 9521)
+++ trunk/SKMainDocument.m      2017-12-05 16:09:19 UTC (rev 9522)
@@ -1118,48 +1118,29 @@
     }
     
     if (didConvert) {
-        
         // if pdfDocWithoutNotes was nil, the document was not encrypted, so 
no need to try to unlock
         if (pdfDocWithoutNotes == nil)
             pdfDocWithoutNotes = [[[PDFDocument alloc] initWithData:pdfData] 
autorelease];
+        count = [pdfDocWithoutNotes pageCount];
+        for (i = 0; i < count; i++) {
+            PDFPage *page = [pdfDocWithoutNotes pageAtIndex:i];
+            
+            for (PDFAnnotation *annotation in [[[page annotations] copy] 
autorelease]) {
+                if ([annotation isSkimNote] == NO && [annotation 
isConvertibleAnnotation])
+                    [page removeAnnotation:annotation];
+            }
+        }
         
-        dispatch_queue_t queue = floor(NSAppKitVersionNumber) > 
NSAppKitVersionNumber10_11 ? 
dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0) : 
dispatch_get_main_queue();
-
-        dispatch_async(queue, ^(){
+        [self setPDFData:[pdfDocWithoutNotes dataRepresentation] 
pageOffsets:offsets];
         
-            NSInteger i, count = [pdfDocWithoutNotes pageCount];
-            for (i = 0; i < count; i++) {
-                PDFPage *page = [pdfDocWithoutNotes pageAtIndex:i];
-                
-                for (PDFAnnotation *annotation in [[[page annotations] copy] 
autorelease]) {
-                    if ([annotation isConvertibleAnnotation])
-                        [page removeAnnotation:annotation];
-                }
-            }
-            
-            NSData *pdfData = [pdfDocWithoutNotes dataRepresentation];
-            
-            dispatch_async(dispatch_get_main_queue(), ^(){
-                [self setPDFData:pdfData pageOffsets:offsets];
-            
-                [[self undoManager] setActionName:NSLocalizedString(@"Convert 
Notes", @"Undo action name")];
-                
-                [offsets release];
-                
-                [[pdfDocWithoutNotes outlineRoot] clearDocument];
-                
-                [[self mainWindowController] dismissProgressSheet];
-            });
-        });
+        [[self undoManager] setActionName:NSLocalizedString(@"Convert Notes", 
@"Undo action name")];
         
-    } else {
-        
         [offsets release];
-
-        [[pdfDocWithoutNotes outlineRoot] clearDocument];
-        
-        [[self mainWindowController] dismissProgressSheet];
     }
+    
+    [[pdfDocWithoutNotes outlineRoot] clearDocument];
+    
+    [[self mainWindowController] dismissProgressSheet];
 }
 
 - (void)beginConvertNotesPasswordSheetForPDFDocument:(PDFDocument *)pdfDoc {

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


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit

Reply via email to