Revision: 7644
          http://skim-app.svn.sourceforge.net/skim-app/?rev=7644&view=rev
Author:   hofman
Date:     2012-02-14 10:44:57 +0000 (Tue, 14 Feb 2012)
Log Message:
-----------
use local variable to avoid duplication

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

Modified: trunk/SKGroupedSearchResult.m
===================================================================
--- trunk/SKGroupedSearchResult.m       2012-02-13 22:14:53 UTC (rev 7643)
+++ trunk/SKGroupedSearchResult.m       2012-02-14 10:44:57 UTC (rev 7644)
@@ -73,10 +73,11 @@
 
 - (void)addMatch:(PDFSelection *)match {
     [self willChangeValueForKey:SKGroupedSearchResultCountKey];
+    NSRect bounds = [match boundsForPage:page];
     NSInteger i = [matches count];
     while (i-- > 0) {
         PDFSelection *prevResult = [matches objectAtIndex:i];
-        if (SKCompareRects([match boundsForPage:page], [prevResult 
boundsForPage:page]) != NSOrderedAscending)
+        if (SKCompareRects(bounds, [prevResult boundsForPage:page]) != 
NSOrderedAscending)
             break;
     }
     [matches insertObject:match atIndex:i + 1];

Modified: trunk/SKMainWindowController.m
===================================================================
--- trunk/SKMainWindowController.m      2012-02-13 22:14:53 UTC (rev 7643)
+++ trunk/SKMainWindowController.m      2012-02-14 10:44:57 UTC (rev 7644)
@@ -1872,11 +1872,12 @@
     }
     
     PDFPage *page = [instance safeFirstPage];
+    NSRect bounds = [instance boundsForPage:page];
     NSInteger i = [searchResults count];
     while (i-- > 0) {
         PDFSelection *prevResult = [searchResults objectAtIndex:i];
         PDFPage *prevPage = [prevResult safeFirstPage];
-        if ([page isEqual:prevPage] == NO || SKCompareRects([instance 
boundsForPage:page], [prevResult boundsForPage:prevPage]) != NSOrderedAscending)
+        if ([page isEqual:prevPage] == NO || SKCompareRects(bounds, 
[prevResult boundsForPage:prevPage]) != NSOrderedAscending)
             break;
     }
     [searchResults insertObject:instance atIndex:i + 1];

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


------------------------------------------------------------------------------
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit

Reply via email to