Revision: 2701
          http://skim-app.svn.sourceforge.net/skim-app/?rev=2701&view=rev
Author:   hofman
Date:     2007-08-22 08:02:59 -0700 (Wed, 22 Aug 2007)

Log Message:
-----------
Move definition of a static character set to category file.

Modified Paths:
--------------
    trunk/NSCharacterSet_SKExtensions.h
    trunk/NSCharacterSet_SKExtensions.m
    trunk/PDFPage_SKExtensions.m

Modified: trunk/NSCharacterSet_SKExtensions.h
===================================================================
--- trunk/NSCharacterSet_SKExtensions.h 2007-08-22 14:58:22 UTC (rev 2700)
+++ trunk/NSCharacterSet_SKExtensions.h 2007-08-22 15:02:59 UTC (rev 2701)
@@ -42,4 +42,5 @@
 @interface NSCharacterSet (SKExtensions)
 + (NSCharacterSet *)newlineCharacterSet;
 + (NSCharacterSet *)nonWhitespaceCharacterSet;
++ (NSCharacterSet *)nonWhitespaceAndNewlineCharacterSet;
 @end

Modified: trunk/NSCharacterSet_SKExtensions.m
===================================================================
--- trunk/NSCharacterSet_SKExtensions.m 2007-08-22 14:58:22 UTC (rev 2700)
+++ trunk/NSCharacterSet_SKExtensions.m 2007-08-22 15:02:59 UTC (rev 2701)
@@ -60,4 +60,11 @@
     return nonWhitespaceCharacterSet;
 }
 
++ (NSCharacterSet *)nonWhitespaceAndNewlineCharacterSet {
+    static NSCharacterSet *nonWhitespaceAndNewlineCharacterSet = nil;
+    if (nonWhitespaceAndNewlineCharacterSet == nil)
+        nonWhitespaceAndNewlineCharacterSet = [[[NSCharacterSet 
whitespaceAndNewlineCharacterSet] invertedSet] copy];
+    return nonWhitespaceAndNewlineCharacterSet;
+}
+
 @end

Modified: trunk/PDFPage_SKExtensions.m
===================================================================
--- trunk/PDFPage_SKExtensions.m        2007-08-22 14:58:22 UTC (rev 2700)
+++ trunk/PDFPage_SKExtensions.m        2007-08-22 15:02:59 UTC (rev 2701)
@@ -44,6 +44,7 @@
 #import "OBUtilities.h"
 #import "NSBitmapImageRep_SKExtensions.h"
 #import "SKStringConstants.h"
+#import "NSCharacterSet_SKExtensions.h"
 #import "NSGeometry_SKExtensions.h"
 
 NSString *SKPDFDocumentPageBoundsDidChangeNotification = 
@"SKPDFDocumentPageBoundsDidChangeNotification";
@@ -212,10 +213,6 @@
 }
 
 - (NSArray *)lineBounds {
-    static NSCharacterSet *nonWhitespaceAndNewlineCharacterSet = nil;
-    if (nonWhitespaceAndNewlineCharacterSet == nil)
-        nonWhitespaceAndNewlineCharacterSet = [[[NSCharacterSet 
whitespaceAndNewlineCharacterSet] invertedSet] copy];
-    
     NSMutableArray *lines = [NSMutableArray array];
     PDFSelection *sel = [self selectionForRect:[self 
boundsForBox:kPDFDisplayBoxCropBox]];
     unsigned i, iMax = [sel safeNumberOfRangesOnPage:self];
@@ -240,7 +237,7 @@
                 NSRange selRange = [s safeRangeAtIndex:k onPage:self];
                 [indexes addIndexesInRange:selRange];
                 // due to a bug in PDFKit, the range of the selection can 
sometimes lie partly outside the range of the string
-                if ([string 
rangeOfCharacterFromSet:nonWhitespaceAndNewlineCharacterSet options:0 
range:NSIntersectionRange(selRange, stringRange)].length)
+                if ([string rangeOfCharacterFromSet:[NSCharacterSet 
nonWhitespaceAndNewlineCharacterSet] options:0 
range:NSIntersectionRange(selRange, stringRange)].length)
                     notEmpty = YES;
             }
             if (notEmpty)


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: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit

Reply via email to