Bug 4013 - text find doesn't wrap in PDF files
Summary: text find doesn't wrap in PDF files
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 412
Hardware: Mac OS X 10.4
: P2 Normal
Assignee: John Sullivan
URL: http://www.copyright.gov/legislation/...
Depends on:
Reported: 2005-07-15 12:52 PDT by Trey Matteson
Modified: 2005-07-15 16:13 PDT (History)
0 users

See Also:

proposed patch (3.33 KB, patch)
2005-07-15 14:18 PDT, Trey Matteson
sullivan: review-
Details | Formatted Diff | Diff
proposed patch with consensus changes (3.50 KB, patch)
2005-07-15 16:00 PDT, Trey Matteson
sullivan: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Trey Matteson 2005-07-15 12:52:15 PDT
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 
Comment 1 Trey Matteson 2005-07-15 14:18:55 PDT
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 2 John Sullivan 2005-07-15 14:31:04 PDT
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,

Otherwise, this seems good. Please explain how you tested it.
Comment 3 John Sullivan 2005-07-15 14:43:26 PDT
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];
Comment 4 Trey Matteson 2005-07-15 16:00:35 PDT
Created attachment 2978 [details]
proposed patch with consensus changes
Comment 5 John Sullivan 2005-07-15 16:09:08 PDT
Comment on attachment 2978 [details]
proposed patch with consensus changes

Great, nice fix.
Comment 6 John Sullivan 2005-07-15 16:13:44 PDT
Checked in.