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 709375 - The accessible cache should be cleared when setting the model
The accessible cache should be cleared when setting the model
Status: RESOLVED FIXED
Product: evince
Classification: Core
Component: general
git master
Other Linux
: Normal normal
: ---
Assigned To: Evince Maintainers
Evince Maintainers
Depends on:
Blocks:
 
 
Reported: 2013-10-03 16:28 UTC by Joanmarie Diggs (IRC: joanie)
Modified: 2013-10-04 15:02 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
proposed patch (1.05 KB, patch)
2013-10-03 16:28 UTC, Joanmarie Diggs (IRC: joanie)
needs-work Details | Review
proposed patch (1.44 KB, patch)
2013-10-04 11:43 UTC, Joanmarie Diggs (IRC: joanie)
committed Details | Review

Description Joanmarie Diggs (IRC: joanie) 2013-10-03 16:28:47 UTC
Created attachment 256400 [details] [review]
proposed patch

Steps to reproduce:
1. Launch Orca master
2. Launch gnome-documents master
3. Preview a document in gnome-documents
4. Tab to the EvView (which Orca master should read automatically)
5. Go back to the gnome-documents overview
6. Repeat steps 3 and 4 for another document

Expected results: Orca would present the contents of the displayed page for the currently-previewed document each time.

Actual results: At step 6, Orca presents the contents of the last page displayed from the document previewed in step 3. If you go to the next page and back to the previous page, Orca will then present the content of the current document as expected.

Digging some into the gnome-documents code, they are reusing the EvView in the previewer, setting the model as needed. But clear_cache() isn't getting called by ev_view_accessible_set_model(). Calling it fixes the bug.
Comment 1 Carlos Garcia Campos 2013-10-04 07:00:34 UTC
Review of attachment 256400 [details] [review]:

This is because the model is set and already contains a document. We were assuming the document is set after ev_view_accessible_set_model(), which is wrong, and we clear the cache in document_changed_cb. At the moment the only thing that document_changed_cb does is clearing the cache, but if we do other initialization there, they should also be done while a new model is set containing a document. So, I think it's better to call document_changed_cb there and checking that the document has actually changed in document_changed_cb to make sure we do nothing in case the model is set without a document. This is exactly what we do in EvView, see ev_view_set_model() and ev_view_document_changed_cb().
Comment 2 Joanmarie Diggs (IRC: joanie) 2013-10-04 11:43:41 UTC
Created attachment 256465 [details] [review]
proposed patch

(In reply to comment #1)
> Review of attachment 256400 [details] [review]:

> So, I think it's better to call document_changed_cb
> there and checking that the document has actually changed in
> document_changed_cb to make sure we do nothing in case the model is set without
> a document. This is exactly what we do in EvView, see ev_view_set_model() and
> ev_view_document_changed_cb().

Done. Thanks for the review!
Comment 3 Carlos Garcia Campos 2013-10-04 13:40:35 UTC
Review of attachment 256465 [details] [review]:

Thanks. Please, push it to master and gnome-3.10 branches