Load any PDF filein Safari. Search for a string that appears more than once. Keep searching until you hit the end of the doc. The search will not wrap around. If you do the same thing in an HTML doc, it does wrap.
Created attachment 2976 [details] proposed patch Note most of these new methods are not called in practice, but for testing I at least invoked them in gdb.
Comment on attachment 2976 [details] proposed patch Rather than retain, I'd suggest using -copy on savedSelection, because the lifetime of a PDFSelection seems somewhat murky (calling [PDFSubview currentSelection] twice in a row returns the same object each time, surprisingly). Otherwise, this seems good. Please explain how you tested it.
Comment on attachment 2976 [details] proposed patch One more comment. If setCurrentSelection:nil works as expected (synonym for clearing the selection), then I'd rewrite: if (savedSelection) { [PDFSubview setCurrentSelection:savedSelection]; [savedSelection release]; } else { [PDFSubview clearSelection]; } as just + [PDFSubview setCurrentSelection:savedSelection]; + [savedSelection release];
Created attachment 2978 [details] proposed patch with consensus changes
Comment on attachment 2978 [details] proposed patch with consensus changes Great, nice fix.
Checked in.