зеркало из https://github.com/mozilla/pjs.git
Bug 208922 Convert nsIAccessNode into an interface for internal accessibility clients
sr=bz
This commit is contained in:
Родитель
a707453fac
Коммит
1d22cfa0b9
|
@ -41,6 +41,7 @@
|
|||
#include "nsAccessibilityService.h"
|
||||
#include "nsAccessibleHyperText.h"
|
||||
#include "nsHTMLLinkAccessibleWrap.h"
|
||||
#include "nsPIAccessNode.h"
|
||||
#include "nsIFrame.h"
|
||||
#include "nsILink.h"
|
||||
#include "nsIServiceManager.h"
|
||||
|
@ -412,15 +413,18 @@ NS_IMETHODIMP nsAccessibleHyperText::GetLink(PRInt32 aIndex, nsIAccessibleHyperL
|
|||
if (cachedAcc) {
|
||||
// Retrieved from cache
|
||||
nsCOMPtr<nsIAccessibleHyperLink> cachedLink(do_QueryInterface(cachedAcc));
|
||||
if (cachedLink)
|
||||
if (cachedLink) {
|
||||
*aLink = cachedLink;
|
||||
NS_IF_ADDREF(*aLink);
|
||||
}
|
||||
}
|
||||
if (!(*aLink)) {
|
||||
*aLink = new nsHTMLLinkAccessibleWrap(parentNode, weakShell);
|
||||
nsCOMPtr<nsIAccessNode> accessNode(do_QueryInterface(*aLink));
|
||||
NS_ENSURE_TRUE(*aLink, NS_ERROR_OUT_OF_MEMORY);
|
||||
NS_ADDREF(*aLink);
|
||||
nsCOMPtr<nsPIAccessNode> accessNode(do_QueryInterface(*aLink));
|
||||
accessNode->Init();
|
||||
}
|
||||
NS_IF_ADDREF(*aLink);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -40,6 +40,7 @@
|
|||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#include "nsMaiInterfaceHypertext.h"
|
||||
#include "nsPIAccessNode.h"
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
|
@ -150,11 +151,12 @@ getLinkCB(AtkHypertext *aText, gint aLinkIndex)
|
|||
// if the maiHyperlink is not in cache, create it.
|
||||
if (!maiNode) {
|
||||
maiNode = new MaiHyperlink(hyperLink, nsnull, weakShell);
|
||||
maiNode->Init(); // add to cache.
|
||||
if (!maiNode) {
|
||||
NS_WARNING("OUT OF MEMORY");
|
||||
return nsnull;
|
||||
}
|
||||
nsCOMPtr<nsPIAccessNode> pMaiNode = do_QueryInterface(maiNode);
|
||||
pMaiNode->Init(); // add to cache.
|
||||
}
|
||||
|
||||
// we can get AtkHyperlink from the MaiHyperlink
|
||||
|
|
Загрузка…
Ссылка в новой задаче