Revision: 9122
          http://sourceforge.net/p/skim-app/code/9122
Author:   hofman
Date:     2016-09-23 08:41:14 +0000 (Fri, 23 Sep 2016)
Log Message:
-----------
Go directly to destination after document reload, but just go to the page when 
the current page was rotated

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

Modified: trunk/SKMainWindowController.m
===================================================================
--- trunk/SKMainWindowController.m      2016-09-22 23:51:48 UTC (rev 9121)
+++ trunk/SKMainWindowController.m      2016-09-23 08:41:14 UTC (rev 9122)
@@ -733,6 +733,7 @@
         
         NSUInteger pageIndex = NSNotFound, secondaryPageIndex = NSNotFound;
         NSPoint point, secondaryPoint;
+        BOOL rotated, secondaryRotated;
         PDFDestination *dest;
         NSArray *snapshotDicts = nil;
         NSDictionary *openState = nil;
@@ -741,10 +742,12 @@
             dest = [pdfView currentDestination];
             pageIndex = [[dest page] pageIndex];
             point = [dest point];
+            rotated = [[dest page] rotation] != [[dest page] 
intrinsicRotation];
             if (secondaryPdfView) {
                 dest = [secondaryPdfView currentDestination];
                 secondaryPageIndex = [[dest page] pageIndex];
                 secondaryPoint = [dest point];
+                secondaryRotated = [[dest page] rotation] != [[dest page] 
intrinsicRotation];
             }
             openState = [self expansionStateForOutline:[[pdfView document] 
outlineRoot]];
             
@@ -798,26 +801,20 @@
                     [savedNormalSetup setObject:[NSNumber 
numberWithUnsignedInteger:pageIndex] forKey:PAGEINDEX_KEY];
                 } else {
                     page = [document pageAtIndex:pageIndex];
-                    [pdfView goToPage:page];
+                    if (rotated)
+                        [pdfView goToPage:page];
+                    else
+                        [pdfView goToDestination:[[[PDFDestination alloc] 
initWithPage:page atPoint:point] autorelease]];
                 }
             }
             if (secondaryPageIndex != NSNotFound) {
                 secondaryPage = [document pageAtIndex:MIN(secondaryPageIndex, 
[document pageCount] - 1)];
-                [secondaryPdfView goToPage:secondaryPage];
+                if (secondaryRotated)
+                    [secondaryPdfView goToPage:secondaryPage];
+                else
+                    [secondaryPdfView goToDestination:[[[PDFDestination alloc] 
initWithPage:[document pageAtIndex:secondaryPageIndex] atPoint:secondaryPoint] 
autorelease]];
             }
             [pdfView resetHistory];
-            [[pdfView window] disableFlushWindow];
-            if (page) {
-                [pdfView display];
-                [pdfView goToDestination:[[[PDFDestination alloc] 
initWithPage:[document pageAtIndex:pageIndex] atPoint:point] autorelease]];
-            }
-            if (secondaryPage) {
-                if ([secondaryPdfView window])
-                    [secondaryPdfView display];
-                [secondaryPdfView goToDestination:[[[PDFDestination alloc] 
initWithPage:[document pageAtIndex:secondaryPageIndex] atPoint:secondaryPoint] 
autorelease]];
-            }
-            [[pdfView window] enableFlushWindow];
-            [[pdfView window] flushWindowIfNeeded];
         }
         
         // the number of pages may have changed

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


------------------------------------------------------------------------------
_______________________________________________
Skim-app-commit mailing list
Skim-app-commit@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/skim-app-commit

Reply via email to