Bug 208922 Convert nsIAccessNode into an interface for internal accessibility clients

sr=bz
This commit is contained in:
timeless%mozdev.org 2003-06-20 04:13:41 +00:00
Родитель f135a145fa
Коммит c76cf335e1
2 изменённых файлов: 10 добавлений и 4 удалений

Просмотреть файл

@ -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