Revision: 4598
          http://skim-app.svn.sourceforge.net/skim-app/?rev=4598&view=rev
Author:   hofman
Date:     2008-09-10 10:48:45 +0000 (Wed, 10 Sep 2008)

Log Message:
-----------
rename lineBounds to lineRects to avoid confusing name

Modified Paths:
--------------
    trunk/PDFPage_SKExtensions.h
    trunk/PDFPage_SKExtensions.m
    trunk/SKPDFView.m
    trunk/SKReadingBar.h
    trunk/SKReadingBar.m

Modified: trunk/PDFPage_SKExtensions.h
===================================================================
--- trunk/PDFPage_SKExtensions.h        2008-09-10 09:55:01 UTC (rev 4597)
+++ trunk/PDFPage_SKExtensions.h        2008-09-10 10:48:45 UTC (rev 4598)
@@ -69,7 +69,7 @@
 - (NSAttributedString *)thumbnail64Attachment;
 - (NSAttributedString *)thumbnail32Attachment;
 
-- (NSArray *)lineBounds;
+- (NSArray *)lineRects;
 
 - (unsigned int)pageIndex;
 - (NSString *)logicalLabel;

Modified: trunk/PDFPage_SKExtensions.m
===================================================================
--- trunk/PDFPage_SKExtensions.m        2008-09-10 09:55:01 UTC (rev 4597)
+++ trunk/PDFPage_SKExtensions.m        2008-09-10 10:48:45 UTC (rev 4598)
@@ -273,7 +273,7 @@
     return [self thumbnailAttachmentWithSize:32.0];
 }
 
-- (NSArray *)lineBounds {
+- (NSArray *)lineRects {
     NSMutableArray *lines = [NSMutableArray array];
     PDFSelection *sel = [self selectionForRect:[self 
boundsForBox:kPDFDisplayBoxCropBox]];
     unsigned i, iMax = [sel safeNumberOfRangesOnPage:self];

Modified: trunk/SKPDFView.m
===================================================================
--- trunk/SKPDFView.m   2008-09-10 09:55:01 UTC (rev 4597)
+++ trunk/SKPDFView.m   2008-09-10 10:48:45 UTC (rev 4598)
@@ -3505,12 +3505,12 @@
 
 - (void)doDragReadingBarWithEvent:(NSEvent *)theEvent {
     PDFPage *page = [readingBar page];
-    NSArray *lineBounds = [page lineBounds];
+    NSArray *lineRects = [page lineRects];
        NSMutableDictionary *userInfo = [NSMutableDictionary 
dictionaryWithObjectsAndKeys:page, SKPDFViewOldPageKey, nil];
     
     NSPoint lastMouseLoc = [self convertPoint:[theEvent locationInWindow] 
fromView:nil];
     NSPoint point = [self convertPoint:lastMouseLoc toPage:page];
-    int lineOffset = SKIndexOfRectAtYInOrderedRects(point.y, lineBounds, YES) 
- [readingBar currentLine];
+    int lineOffset = SKIndexOfRectAtYInOrderedRects(point.y, lineRects, YES) - 
[readingBar currentLine];
     NSDate *lastPageChangeDate = [NSDate distantPast];
     
     lastMouseLoc = [self convertPoint:lastMouseLoc toView:[self documentView]];
@@ -3553,14 +3553,14 @@
         
         if ([currentPage isEqual:page] == NO) {
             page = currentPage;
-            lineBounds = [page lineBounds];
+            lineRects = [page lineRects];
         }
         
-        if ([lineBounds count] == 0)
+        if ([lineRects count] == 0)
             continue;
         
-        currentLine = SKIndexOfRectAtYInOrderedRects(mouseLocInPage.y, 
lineBounds, mouseLocInDocument.y < lastMouseLoc.y) - lineOffset;
-        currentLine = MIN((int)[lineBounds count] - (int)[readingBar 
numberOfLines], currentLine);
+        currentLine = SKIndexOfRectAtYInOrderedRects(mouseLocInPage.y, 
lineRects, mouseLocInDocument.y < lastMouseLoc.y) - lineOffset;
+        currentLine = MIN((int)[lineRects count] - (int)[readingBar 
numberOfLines], currentLine);
         currentLine = MAX(0, currentLine);
         
         if ([page isEqual:[readingBar page]] == NO || currentLine != 
[readingBar currentLine]) {
@@ -3583,7 +3583,7 @@
 - (void)doResizeReadingBarWithEvent:(NSEvent *)theEvent {
     PDFPage *page = [readingBar page];
     int firstLine = [readingBar currentLine];
-    NSArray *lineBounds = [page lineBounds];
+    NSArray *lineRects = [page lineRects];
        NSDictionary *userInfo = [NSDictionary 
dictionaryWithObjectsAndKeys:page, SKPDFViewOldPageKey, page, 
SKPDFViewNewPageKey, nil];
     
     [[NSCursor resizeUpDownCursor] push];
@@ -3600,7 +3600,7 @@
             continue;
         
         mouseLoc = [self convertPoint:mouseLoc toPage:page];
-        int numberOfLines = MAX(0, SKIndexOfRectAtYInOrderedRects(mouseLoc.y, 
lineBounds, YES)) - firstLine + 1;
+        int numberOfLines = MAX(0, SKIndexOfRectAtYInOrderedRects(mouseLoc.y, 
lineRects, YES)) - firstLine + 1;
         
         if (numberOfLines > 0 && numberOfLines != (int)[readingBar 
numberOfLines]) {
             [self setNeedsDisplayInRect:[readingBar currentBoundsForBox:[self 
displayBox]] ofPage:[readingBar page]];

Modified: trunk/SKReadingBar.h
===================================================================
--- trunk/SKReadingBar.h        2008-09-10 09:55:01 UTC (rev 4597)
+++ trunk/SKReadingBar.h        2008-09-10 10:48:45 UTC (rev 4598)
@@ -42,7 +42,7 @@
 
 @interface SKReadingBar : NSObject {
     PDFPage *page;
-    NSArray *lineBounds;
+    NSArray *lineRects;
     int currentLine;
     unsigned int numberOfLines;
 }

Modified: trunk/SKReadingBar.m
===================================================================
--- trunk/SKReadingBar.m        2008-09-10 09:55:01 UTC (rev 4597)
+++ trunk/SKReadingBar.m        2008-09-10 10:48:45 UTC (rev 4598)
@@ -45,7 +45,7 @@
 - (id)initWithPage:(PDFPage *)aPage {
     if (self = [super init]) {
         numberOfLines = 1;
-        lineBounds = nil;
+        lineRects = nil;
         currentLine = -1;
         [self setPage:aPage];
     }
@@ -58,7 +58,7 @@
 
 - (void)dealloc {
     [page release];
-    [lineBounds release];
+    [lineRects release];
     [super dealloc];
 }
 
@@ -70,8 +70,8 @@
     if (page != newPage) {
         [page release];
         page = [newPage retain];
-        [lineBounds release];
-        lineBounds = [[page lineBounds] retain];
+        [lineRects release];
+        lineRects = [[page lineRects] retain];
         currentLine = -1;
     } 
 }
@@ -85,7 +85,7 @@
 }
 
 - (int)currentLastLine {
-    return MIN([lineBounds count], currentLine + numberOfLines) - 1;
+    return MIN([lineRects count], currentLine + numberOfLines) - 1;
 }
 
 - (unsigned int)numberOfLines {
@@ -102,7 +102,7 @@
     NSRect rect = NSZeroRect;
     int i, lastLine = [self currentLastLine];
     for (i = currentLine; i <= lastLine; i++)
-        rect = NSUnionRect(rect, [[lineBounds objectAtIndex:i] rectValue]);
+        rect = NSUnionRect(rect, [[lineRects objectAtIndex:i] rectValue]);
     return rect;
 }
 
@@ -118,7 +118,7 @@
 
 - (BOOL)goToNextLine {
     BOOL didMove = NO;
-    if (currentLine < (int)[lineBounds count] - (int)numberOfLines) {
+    if (currentLine < (int)[lineRects count] - (int)numberOfLines) {
         ++currentLine;
         didMove = YES;
     } else if ([self goToNextPage]) {
@@ -129,13 +129,13 @@
 
 - (BOOL)goToPreviousLine {
     BOOL didMove = NO;
-    if (currentLine == -1 && [lineBounds count])
-        currentLine = [lineBounds count];
+    if (currentLine == -1 && [lineRects count])
+        currentLine = [lineRects count];
     if (currentLine > 0) {
         --currentLine;
         didMove =  YES;
     } else if ([self goToPreviousPage]) {
-        currentLine = MAX(0, (int)[lineBounds count] - (int)numberOfLines);
+        currentLine = MAX(0, (int)[lineRects count] - (int)numberOfLines);
         didMove = YES;
     }
     return didMove;
@@ -148,12 +148,12 @@
     
     while (++i < iMax) {
         PDFPage *nextPage = [doc pageAtIndex:i];
-        NSArray *lines = [nextPage lineBounds];
+        NSArray *lines = [nextPage lineRects];
         if ([lines count]) {
             [page release];
             page = [nextPage retain];
-            [lineBounds release];
-            lineBounds = [lines retain];
+            [lineRects release];
+            lineRects = [lines retain];
             currentLine = 0;
             didMove = YES;
             break;
@@ -169,12 +169,12 @@
     
     while (i-- > 0) {
         PDFPage *prevPage = [doc pageAtIndex:i];
-        NSArray *lines = [prevPage lineBounds];
+        NSArray *lines = [prevPage lineRects];
         if ([lines count]) {
             [page release];
             page = [prevPage retain];
-            [lineBounds release];
-            lineBounds = [lines retain];
+            [lineRects release];
+            lineRects = [lines retain];
             currentLine = 0;
             didMove = YES;
             break;


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

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit

Reply via email to