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 732340 - ev-link-accessible: Improve efficiency of methods to get start and end indices
ev-link-accessible: Improve efficiency of methods to get start and end indices
Status: RESOLVED FIXED
Product: evince
Classification: Core
Component: general
3.12.x
Other Linux
: Normal normal
: ---
Assigned To: Evince Maintainers
Evince Maintainers
Depends on:
Blocks:
 
 
Reported: 2014-06-27 13:13 UTC by Joanmarie Diggs (IRC: joanie)
Modified: 2014-06-28 20:01 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
proposed patch (3.68 KB, patch)
2014-06-27 13:13 UTC, Joanmarie Diggs (IRC: joanie)
committed Details | Review

Description Joanmarie Diggs (IRC: joanie) 2014-06-27 13:13:37 UTC
Created attachment 279392 [details] [review]
proposed patch

Currently ev_hyperlink_get_start_index and ev_hyperlink_get_end_index calculate the indices each and every time they are asked for by an AT. Because this is done by iterating through all the character rects on the page, we should store the value once we've figured it out.

In addition, ev_hyperlink_get_end_index starts the calculation from the last character rect on the page and works backwards to the first. Odds are that the end index is significantly closer to the start index rather than it is to the end of the page. In addition, I cannot think of a reason why an AT would want the end index but not want the start index (i.e. we'll have to calculate the start index anyway). So we should begin the calculation of the end index from the character immediately after the start index.

Lastly, I propose this fix be applied to both 3.12 and 3.13. (I discovered the inefficiency debugging a crash in 3.12. Fixing just the crash is trivial, so if we don't want to fix the efficiency issue for 3.12, please let me know and I'll do a separate bug and fix for that.)
Comment 1 Carlos Garcia Campos 2014-06-28 08:42:49 UTC
Review of attachment 279392 [details] [review]:

Excellent, push it to both branches.
Comment 2 Joanmarie Diggs (IRC: joanie) 2014-06-28 20:01:29 UTC
Comment on attachment 279392 [details] [review]
proposed patch

Thanks!

gnome-3-12: 673cfbe
master: 1a6c9df