Review Request 129557: [okular] Enable searching for a phrase split by a newline character in a PDF
Albert Astals Cid
aacid at kde.org
Wed Jan 4 22:32:22 UTC 2017
> On Jan. 4, 2017, 10:13 p.m., Albert Astals Cid wrote:
> > home/marduk/textpage.cpp, line 57
> > <https://git.reviewboard.kde.org/r/129557/diff/1/?file=486539#file486539line57>
> >
> > so
> > from = "Hola\n"
> > to = "Adios "
> > returns true?
>
> Marduk Bolanos wrote:
> The function does not receive words but characters. The comparison between the text in the PDF and the search query is performed char by char. `from` is a char in the PDF and `to` is a char in the search query. Therefore, the actual behaviour is:
>
> ```
> from = "\n"
> to = " "
> returns true
> ```
>
> As a result, the phrase "hola\nadios" in the PDF generates a match when the search query is "hola adios".
This is how the function is used *now* but there's nothing in the function itself that forces for only characters to be sent, since it gets a QString, so no, your line of reasoning doesn't work, the function totally fails with the input i said, that needs fixing.
- Albert
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/129557/#review101805
-----------------------------------------------------------
On Nov. 25, 2016, 7:46 a.m., Marduk Bolanos wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/129557/
> -----------------------------------------------------------
>
> (Updated Nov. 25, 2016, 7:46 a.m.)
>
>
> Review request for Okular and Oliver Sander.
>
>
> Repository: okular
>
>
> Description
> -------
>
> A blank space in the query is matched against a newline character in the PDF.
>
>
> Diffs
> -----
>
> home/marduk/textpage.cpp 44dfa14d953c1cbfeff883d87d53516cdc530688
>
> Diff: https://git.reviewboard.kde.org/r/129557/diff/
>
>
> Testing
> -------
>
> Tried a few PDF files. It works.
>
>
> Thanks,
>
> Marduk Bolanos
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/okular-devel/attachments/20170104/10b9fa9a/attachment-0001.html>
More information about the Okular-devel
mailing list