Revision: 4844
http://skim-app.svn.sourceforge.net/skim-app/?rev=4844&view=rev
Author: hofman
Date: 2008-10-21 13:50:59 +0000 (Tue, 21 Oct 2008)
Log Message:
-----------
only accept singular containers for selection
Modified Paths:
--------------
trunk/PDFSelection_SKExtensions.m
Modified: trunk/PDFSelection_SKExtensions.m
===================================================================
--- trunk/PDFSelection_SKExtensions.m 2008-10-21 11:27:41 UTC (rev 4843)
+++ trunk/PDFSelection_SKExtensions.m 2008-10-21 13:50:59 UTC (rev 4844)
@@ -165,7 +165,7 @@
NSScriptObjectSpecifier *textSpec = [spec containerSpecifier];
NSTextStorage *textStorage = [textSpec objectsByEvaluatingSpecifier];
if ([textStorage isKindOfClass:[NSArray class]])
- textStorage = [(NSArray *)textStorage count] ? [(NSArray *)textStorage
objectAtIndex:0] : nil;
+ textStorage = [(NSArray *)textStorage count] == 1 ? [(NSArray
*)textStorage objectAtIndex:0] : nil;
if ([textStorage isKindOfClass:[NSTextStorage class]] == NO)
return nil;
@@ -319,7 +319,7 @@
continue;
ranges = [NSArray arrayWithObjects:[NSValue
valueWithRange:NSMakeRange(0, [textStorage length])], nil];
textSpec = spec;
- } else if ([textKeys containsObject:key] == NO) {
+ } else if ([textKeys containsObject:key]) {
ranges = characterRangesForSpecifier(spec, &textSpec);
if ([textSpec isKindOfClass:[NSScriptObjectSpecifier class]] == NO
|| [[textSpec key] isEqualToString:@"richText"] == NO)
continue;
@@ -329,7 +329,7 @@
NSScriptObjectSpecifier *pageSpec = [textSpec containerSpecifier];
PDFPage *page = [pageSpec objectsByEvaluatingSpecifier];
if ([page isKindOfClass:[NSArray class]])
- page = [(NSArray *)page count] ? [(NSArray *)page objectAtIndex:0]
: nil;
+ page = [(NSArray *)page count] == 1 ? [(NSArray *)page
objectAtIndex:0] : nil;
if ([page isKindOfClass:[PDFPage class]] == NO || (aPage && [aPage
isEqual:page] == NO))
continue;
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