Revision: 14876
          http://sourceforge.net/p/skim-app/code/14876
Author:   hofman
Date:     2025-01-25 15:41:05 +0000 (Sat, 25 Jan 2025)
Log Message:
-----------
simplify callculation of insertion index

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

Modified: trunk/SKSecondaryPDFView.m
===================================================================
--- trunk/SKSecondaryPDFView.m  2025-01-25 15:38:57 UTC (rev 14875)
+++ trunk/SKSecondaryPDFView.m  2025-01-25 15:41:05 UTC (rev 14876)
@@ -593,14 +593,9 @@
     iNext = [menu indexOfItemWithTarget:self 
andAction:@selector(goToNextPage:)];
     iPrev = [menu indexOfItemWithTarget:self 
andAction:@selector(goToPreviousPage:)];
 
-    if (iPrev == -1)
-        i = iNext;
-    else if (iNext == -1)
-        i = iPrev;
-    else
-        i = MAX(iPrev, iNext);
+    i = MAX(iPrev, iNext);
     if (i == -1)
-        i = [menu numberOfItems];
+        i = [menu numberOfItems] - 1;
     
     if ([self canGoBack])
         [menu insertItemWithTitle:NSLocalizedString(@"Back", @"Menu item 
title") action:@selector(goBack:) target:self tag:0 atIndex:++i];

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