Revision: 5548
http://skim-app.svn.sourceforge.net/skim-app/?rev=5548&view=rev
Author: hofman
Date: 2009-08-12 23:51:48 +0000 (Wed, 12 Aug 2009)
Log Message:
-----------
partially revert an earlier commit, use our own code for getting the lines for
a markup note, because the version in PDFKit does not strip spaces at the end
of the line.
Modified Paths:
--------------
trunk/PDFAnnotationMarkup_SKExtensions.m
Modified: trunk/PDFAnnotationMarkup_SKExtensions.m
===================================================================
--- trunk/PDFAnnotationMarkup_SKExtensions.m 2009-08-12 18:57:26 UTC (rev
5547)
+++ trunk/PDFAnnotationMarkup_SKExtensions.m 2009-08-12 23:51:48 UTC (rev
5548)
@@ -206,19 +206,9 @@
NSMutableArray *quadPoints = [[NSMutableArray alloc] init];
NSRect newBounds = NSZeroRect;
if (selection) {
- NSUInteger i, iMax;
+ NSUInteger i, iMax = [selection safeNumberOfRangesOnPage:page];
NSRect lineRect = NSZeroRect;
- if ([selection respondsToSelector:@selector(selectionsByLine)]) {
- NSEnumerator *selEnum = [[selection selectionsByLine]
objectEnumerator];
- PDFSelection *sel;
- while (sel = [selEnum nextObject]) {
- lineRect = [sel boundsForPage:page];
- if (NSIsEmptyRect(lineRect) == NO && [[sel string]
rangeOfCharacterFromSet:[NSCharacterSet
nonWhitespaceAndNewlineCharacterSet]].length) {
- CFArrayAppendValue([self lineRects], &lineRect);
- newBounds = NSUnionRect(lineRect, newBounds);
- }
- }
- } else if (iMax > 0) {
+ if (iMax > 0) {
NSString *string = [page string];
NSRect charRect = NSZeroRect;
NSRect lastCharRect = NSZeroRect;
@@ -253,6 +243,16 @@
CFArrayAppendValue([self lineRects], &lineRect);
newBounds = NSUnionRect(lineRect, newBounds);
}
+ } else if ([selection
respondsToSelector:@selector(selectionsByLine)]) {
+ NSEnumerator *selEnum = [[selection selectionsByLine]
objectEnumerator];
+ PDFSelection *sel;
+ while (sel = [selEnum nextObject]) {
+ lineRect = [sel boundsForPage:page];
+ if (NSIsEmptyRect(lineRect) == NO && [[sel string]
rangeOfCharacterFromSet:[NSCharacterSet
nonWhitespaceAndNewlineCharacterSet]].length) {
+ CFArrayAppendValue([self lineRects], &lineRect);
+ newBounds = NSUnionRect(lineRect, newBounds);
+ }
+ }
}
if (NSIsEmptyRect(newBounds)) {
[self release];
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit