[poppler] The search and selection functions in the glib binding return a resulting wrong box

Jose Dapena Paz jdapena at igalia.com
Fri Aug 5 12:13:41 EST 2005


	Hi,

	Using evince from jhbuild this week I've catched a bug with the search
and selection handling. If I did a search, the box evince showed was
placed in a wrong place (it got the horizontal position, but not the
vertical position).

	Digging more in the problem, I found that this problem happened only in
the documents I used which were shown as landscape. And more, the
problem extended in this documents to been impossible to select text.

	After exploring some time the code of evince and poppler, I think the
problem is in the glib bindings. More specifically in the way the
functions poppler_page_get_text() and poppler_page_find_text() compute
the y coordinates of the selection box. It uses page->page->getHeight(),
which seems to be wrong for landscape documents (as an example
poppler_page_get_size() takes the orientation into account).

	I've attached a patch which uses getWidth for LANDSCAPE and SEASCAPE
orientations in these functions, which solves the issues with selection
and searches in evince. I'm not sure if the error is at this layer
though, so I hope a review of the patch will give a light to the point.
I've tested it with today jhbuild of evince and poppler and it seems to
be working.

-- 
Jose Dapena Paz <jdapena at igalia.com>
Igalia - http://www.igalia.com

-------------- next part --------------
A non-text attachment was scrubbed...
Name: fix-for-search-and-selection-boxes-in-landscape.patch
Type: text/x-patch
Size: 1770 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/poppler/attachments/20050805/a18f8abb/fix-for-search-and-selection-boxes-in-landscape.bin


More information about the poppler mailing list