Revision: 6774
http://skim-app.svn.sourceforge.net/skim-app/?rev=6774&view=rev
Author: hofman
Date: 2010-09-02 17:13:09 +0000 (Thu, 02 Sep 2010)
Log Message:
-----------
use page labels from document instead of pages in secondary pdfview popup for
efficiency
Modified Paths:
--------------
trunk/SKSecondaryPDFView.m
Modified: trunk/SKSecondaryPDFView.m
===================================================================
--- trunk/SKSecondaryPDFView.m 2010-09-02 17:01:09 UTC (rev 6773)
+++ trunk/SKSecondaryPDFView.m 2010-09-02 17:13:09 UTC (rev 6774)
@@ -40,6 +40,7 @@
#import "NSScrollView_SKExtensions.h"
#import "PDFAnnotation_SKExtensions.h"
#import "PDFPage_SKExtensions.h"
+#import "PDFDocument_SKExtensions.h"
#import "SKStringConstants.h"
#import "NSResponder_SKExtensions.h"
#import "NSEvent_SKExtensions.h"
@@ -165,7 +166,7 @@
}
- (void)reloadPagePopUpButton {
- PDFDocument *pdfDoc = [self document];
+ NSArray *labels = [[self document] pageLabels];
NSUInteger i, count = [pagePopUpButton numberOfItems];
NSString *label;
CGFloat width, maxWidth = 0.0;
@@ -176,9 +177,9 @@
while (count--)
[pagePopUpButton removeItemAtIndex:count];
- if (count = [pdfDoc pageCount]) {
+ if (count = [labels count]) {
for (i = 0; i < count; i++) {
- label = [[pdfDoc pageAtIndex:i] displayLabel];
+ label = [labels objectAtIndex:i];
width = NSWidth([label boundingRectWithSize:size options:0
attributes:attrs]);
if (width > maxWidth) {
maxWidth = width;
@@ -189,7 +190,7 @@
sizePopUpToItemAtIndex(pagePopUpButton, maxIndex);
- [pagePopUpButton selectItemAtIndex:[pdfDoc indexForPage:[self
currentPage]]];
+ [pagePopUpButton selectItemAtIndex:[[self currentPage] pageIndex]];
}
}
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
This SF.net Dev2Dev email is sponsored by:
Show off your parallel programming skills.
Enter the Intel(R) Threading Challenge 2010.
http://p.sf.net/sfu/intel-thread-sfd
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit