Created attachment 44220 [details]
Accerciser screen-shot: hyperlink exposes ROLE_PARAGRAPH, and no URL to AT-SPI.
A hyperlink in Libre Office writer document doesn't expose the correct role and URL to AT-SPI. It exposes ROLE_PARAGRAPH and no URL. If it would expose the correct role (ROLE_LINK or some other appropriate role) and the URL, assistive tools like a screen reader can use the information to improve accessibility of the document.
Steps to reproduce:
1. Start Libre Office writer. Create a new text document. Add a hyperlink with text 'http://www.libreoffice.org/', targeted to 'http://www.libreoffice.org/'. Save the document.
2. Start Accerciser accessibility explorer.
3. Go to the accessible tree view at top left. As shown in attached
screen-shot, select the accessible object corresponding to the hyperlink just
created. The Role column shows 'paragraph'.
4. In the plug-in view at top right, select Interface Viewer. The first line
shows the role as 'paragraph'. The table under Hypertext shows the start and
end offsets for the hyperlink text, but no URI.
5. Go to the IPythonConsole at bottom.
acc.queryText().getText(0,27) returns text 'http://www.libreoffice.org/'.
acc.getRole() returns ROLE_PARAGRAPH.
acc.queryHypertext().getNLinks() returns 1, indicating one link.
acc.queryHypertext().getLink(0) returns a Hyperlink object.
acc.queryHypertext().getLink(0).nAnchors returns 1, indicating one anchor.
acc.queryHypertext().getLink(0).getURI(0) returns '', not the URL.
[This is an automated message.]
This bug was filed before the changes to Bugzilla on 2011-10-16. Thus it
started right out as NEW without ever being explicitly confirmed. The bug is
changed to state NEEDINFO for this reason. To move this bug from NEEDINFO back
to NEW please check if the bug still persists with the 3.5.0 beta1 or beta2 prereleases.
Details on how to test the 3.5.0 beta1 can be found at:
more detail on this bulk operation: http://nabble.documentfoundation.org/RFC-Operation-Spamzilla-tp3607474p3607474.html
Today I rechecked my observation with Libre Office dev 3.5.0 beta2 and found
that the bug persists. I suggest that the bug be moved back to NEW status.
Dear bug submitter!
Due to the fact, that there are a lot of NEEDINFO bugs with no answer within the last six months, we close all of these bugs.
To keep this message short, more infos are available @ https://wiki.documentfoundation.org/QA/NeedinfoClosure#Statement
Thanks for understanding and hopefully updating your bug, so that everything is prepared for developers to fix your problem.
I don't know how I missed the bugmail, but this was never addressed.
Corresponding Apache OpenOffice bug: https://issues.apache.org/ooo/show_bug.cgi?id=117206
I'm taking this, the solution can be related to bug #35105
Actually, links don't work like that. The paragraph should still have the ATK_PARAGRAPH role, and it has a hypertext interface through which we would be able to query the hyperlinks contained in that paragraph. It can be checked from accerciser in the interface viewer tab or with acc.queryHypertext() from the IPython console.
Anyway, there is still a bug; in 4.3 (master) there is no information about hyperlinks at all in that interface. In an older version, 4.1.4, it does, although some fields are missing (Uri fields seems to be so).
Some facts about hyperlinks in master after further investigation:
* It does expose the hyperlinks throught the hypertext interface correctly.
* Hyperlink objects got through that interface contain proper start and end positions and Uri.
* Hyperlink objects got through that interface do not implement get_object properly.
The implementation of hyper_link_get_object  is incorrect; it should return the associated ATK object, according to ATK docs , but it actually gets a string with the destination URL, tries to transform it into an accessible object, crashes in that transformation and returns nothing.
To fix the problem it looks like we should call XAccessibleHyperlink::getAccessibleActionAnchor instead of XAccessibleHyperlink::getAccessibleActionObject from hyper_link_get_object, but there is also a problem here; getAccessibleActionAnchor may also return a string according to the docs , which cannot be transformed into an accessible object either.
We have to think a bit how the implementation of hyper_link_get_object should be. What does 'the associated ATK object' mean? The paragraph that contains the hyperlink, the text chunk with the link...?
In a conversation with the maintainer of ATK, he pointed out that we are missing one piece in this puzzle, which is AtkHyperlinkImpl  type. The paragraph should have a set of children of this type, one for each hyperlink, and at the same time the AtkHyperlink objects returned through the AtkHypertext interface of the paragraph should return the corresponding AtkHyperlinkImpl object in their implementation of get_object.