After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 756683 - Search results not displayed with correct page number
Search results not displayed with correct page number
Status: RESOLVED FIXED
Product: evince
Classification: Core
Component: general
3.10.x
Other Linux
: Normal normal
: ---
Assigned To: Evince Maintainers
Evince Maintainers
Depends on:
Blocks:
 
 
Reported: 2015-10-16 08:34 UTC by Peter Pasedach
Modified: 2015-10-18 16:03 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Screenshot (20.30 KB, image/png)
2015-10-16 08:34 UTC, Peter Pasedach
  Details
sample document with separate pageranges for frontmatter and mainmatter (3.49 KB, application/pdf)
2015-10-16 08:36 UTC, Peter Pasedach
  Details
find-sidebar: show the page label instead of page number. (3.26 KB, patch)
2015-10-16 15:29 UTC, Germán Poo-Caamaño
committed Details | Review

Description Peter Pasedach 2015-10-16 08:34:42 UTC
Created attachment 313424 [details]
Screenshot

For a pdf document with separate page ranges for front- and main matter evince can handle the display of the page number correctly in the page field, and ctrl-l will take me to the correct number. When I then search for a word a sidebar is opened with the search results, on which also the page numbers are listed. However, these page numbers are absolute numbers in the pdf, not the numbers within the respective page range. As an example a screenshot of a document with four pages, i,ii,1,2, with a hit for the search on every page, which get displayed as 1,2,3,4, only with the frontmatter hits prefixed by the roman number.
Comment 1 Peter Pasedach 2015-10-16 08:36:44 UTC
Created attachment 313425 [details]
sample document with separate pageranges for frontmatter and mainmatter
Comment 2 Germán Poo-Caamaño 2015-10-16 15:29:55 UTC
Created attachment 313475 [details] [review]
find-sidebar: show the page label instead of page number.

This patch add an extra column into the model for the page label, and uses this one to display in the sidebar.

It keeps the current page in the model every other operation.
Comment 3 Peter Pasedach 2015-10-16 16:30:34 UTC
(In reply to Germán Poo-Caamaño from comment #2)
> Created attachment 313475 [details] [review] [review]
> find-sidebar: show the page label instead of page number.
> 
> This patch add an extra column into the model for the page label, and uses
> this one to display in the sidebar.
> 
> It keeps the current page in the model every other operation.

I'm trying to apply your patch to the debian source package in Ubuntu 14.04, but "Hunk #2 FAILED at 175.", I guess because of the patches already applied to it. How do I best proceed now?
Comment 4 Peter Pasedach 2015-10-16 16:44:10 UTC
(In reply to Germán Poo-Caamaño from comment #2)
> Created attachment 313475 [details] [review] [review]
> find-sidebar: show the page label instead of page number.
> 
> This patch add an extra column into the model for the page label, and uses
> this one to display in the sidebar.
> 
> It keeps the current page in the model every other operation.

(In reply to Peter Pasedach from comment #3)
> (In reply to Germán Poo-Caamaño from comment #2)
> > Created attachment 313475 [details] [review] [review] [review]
> > find-sidebar: show the page label instead of page number.
> > 
> > This patch add an extra column into the model for the page label, and uses
> > this one to display in the sidebar.
> > 
> > It keeps the current page in the model every other operation.
> 
> I'm trying to apply your patch to the debian source package in Ubuntu 14.04,
> but "Hunk #2 FAILED at 175.", I guess because of the patches already applied
> to it. How do I best proceed now?

I now tried it with the 3.10.3 source tarball from the gnome ftp server but get the same error (on a dry run).
Comment 5 Germán Poo-Caamaño 2015-10-16 16:50:07 UTC
I applied the changes against master, which is > 3.18.  Several versions ahead.
Comment 6 Germán Poo-Caamaño 2015-10-16 16:50:45 UTC
You can try to adapt the patch to earlier versions, though.
Comment 7 Peter Pasedach 2015-10-16 17:31:01 UTC
(In reply to Germán Poo-Caamaño from comment #6)
> You can try to adapt the patch to earlier versions, though.

Well, I tried. Removed Hunk #2 from your patch, as the 3.10.3 doesn't
have a ev_find_sidebar_reset_model . After that the patch applies and
it builds. I installed the generated deb files, evince opens, but when
I try to do a search it crashes.
Comment 8 José Aliste 2015-10-16 18:12:58 UTC
Peter, I am sorry, but we can't fix bugs on Earlier versions of Evince. Specially evince 3.10 is 4 years old... Of course you can't adapt the patch, but if you have problems with adapting the patch, the discussion does not belong to this patch.
Comment 9 Germán Poo-Caamaño 2015-10-18 16:03:12 UTC
Review of attachment 313475 [details] [review]:

Pushed in master