bug 347038. Remove unused and unneeded GetSelectedLinkIndex. r=evan.yan

This commit is contained in:
aaronleventhal%moonset.net 2006-08-03 03:59:32 +00:00
Родитель 30343ba120
Коммит 6a60e878f1
2 изменённых файлов: 1 добавлений и 38 удалений

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

@ -42,7 +42,7 @@
#include "nsISupports.idl"
#include "nsIAccessibleHyperLink.idl"
[scriptable, uuid(8f18d922-1dd2-11b2-82ea-829b78a44413)]
[scriptable, uuid(dec56474-2887-4d44-9826-1594cfe4a2f4)]
interface nsIAccessibleHyperText : nsISupports
{
readonly attribute long links;
@ -54,6 +54,4 @@ interface nsIAccessibleHyperText : nsISupports
* Return value of -1 indicates no link at that index.
*/
long getLinkIndex (in long charIndex);
long getSelectedLinkIndex ();
};

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

@ -878,41 +878,6 @@ NS_IMETHODIMP nsHyperTextAccessible::GetLinkIndex(PRInt32 aCharIndex, PRInt32 *a
return NS_OK;
}
NS_IMETHODIMP nsHyperTextAccessible::GetSelectedLinkIndex(PRInt32 *aSelectedLinkIndex)
{
*aSelectedLinkIndex = 0;
if (!mDOMNode && !nsAccessNode::gLastFocusedNode) {
return NS_ERROR_FAILURE;
}
nsCOMPtr<nsIAccessible> focusedAccessible;
nsCOMPtr<nsIAccessibilityService> accService(do_GetService("@mozilla.org/accessibilityService;1"));
if (NS_FAILED(accService->GetAccessibleInWeakShell(nsAccessNode::gLastFocusedNode, mWeakShell,
getter_AddRefs(focusedAccessible)))) {
return NS_ERROR_FAILURE;
}
// Make sure focused accessible is a child of ours before doing a lot of work
nsCOMPtr<nsIAccessible> focusedParent;
focusedAccessible->GetParent(getter_AddRefs(focusedParent));
if (focusedParent != this) {
return NS_ERROR_FAILURE;
}
nsCOMPtr<nsIAccessible> accessible;
while (NextChild(accessible)) {
if (accessible == focusedAccessible) {
return NS_OK;
}
if (!IsEmbeddedObject(accessible)) {
++ *aSelectedLinkIndex;
}
}
NS_NOTREACHED("Should not reach here, focus of parent was this accessible");
return NS_ERROR_FAILURE;
}
/**
* nsIAccessibleEditableText impl.
*/