bug278039 Add a11y description for XUL column
r = pkwarren sr = Henry.Jia
This commit is contained in:
Родитель
b2fba4e5de
Коммит
eeb26efadd
|
@ -428,16 +428,12 @@ getRowDescriptionCB(AtkTable *aTable, gint aRow)
|
|||
accWrap->GetMaiInterface(MAI_INTERFACE_TABLE));
|
||||
NS_ENSURE_TRUE(maiTable, nsnull);
|
||||
|
||||
const char *description = maiTable->GetRowDescription();
|
||||
if (!description) {
|
||||
nsAutoString autoStr;
|
||||
nsresult rv = accTable->GetRowDescription(aRow, autoStr);
|
||||
NS_ENSURE_SUCCESS(rv, nsnull);
|
||||
nsAutoString autoStr;
|
||||
nsresult rv = accTable->GetRowDescription(aRow, autoStr);
|
||||
NS_ENSURE_SUCCESS(rv, nsnull);
|
||||
|
||||
maiTable->SetRowDescription(autoStr);
|
||||
description = maiTable->GetRowDescription();
|
||||
}
|
||||
return description;
|
||||
maiTable->SetRowDescription(autoStr);
|
||||
return maiTable->GetRowDescription();
|
||||
}
|
||||
|
||||
AtkObject*
|
||||
|
|
|
@ -55,22 +55,22 @@ public:
|
|||
virtual const GInterfaceInfo *GetInterfaceInfo();
|
||||
|
||||
const char *GetColumnDescription() {
|
||||
return NS_ConvertUCS2toUTF8(mColumnDescription).get();
|
||||
return mColumnDescription.get();
|
||||
}
|
||||
void SetColumnDescription(nsAString &aString) {
|
||||
mColumnDescription = aString;
|
||||
CopyUTF16toUTF8(aString, mColumnDescription);
|
||||
}
|
||||
|
||||
const char *GetRowDescription() {
|
||||
return NS_ConvertUCS2toUTF8(mRowDescription).get();
|
||||
return mRowDescription.get();
|
||||
}
|
||||
void SetRowDescription(nsAString &aString) {
|
||||
mRowDescription = aString;
|
||||
CopyUTF16toUTF8(aString, mRowDescription);
|
||||
}
|
||||
|
||||
private:
|
||||
nsString mColumnDescription;
|
||||
nsString mRowDescription;
|
||||
nsCString mColumnDescription;
|
||||
nsCString mRowDescription;
|
||||
};
|
||||
|
||||
#endif /* __MAI_INTERFACE_TABLE_H__ */
|
||||
|
|
|
@ -319,7 +319,12 @@ NS_IMETHODIMP nsXULTreeAccessibleWrap::GetRowExtentAt(PRInt32 aRow, PRInt32 aCol
|
|||
|
||||
NS_IMETHODIMP nsXULTreeAccessibleWrap::GetColumnDescription(PRInt32 aColumn, nsAString & _retval)
|
||||
{
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
nsCOMPtr<nsIAccessibleTable> columnHeader;
|
||||
nsresult rv = GetColumnHeader(getter_AddRefs(columnHeader));
|
||||
if (NS_SUCCEEDED(rv) && columnHeader) {
|
||||
return columnHeader->GetColumnDescription(aColumn, _retval);
|
||||
}
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsXULTreeAccessibleWrap::GetRowDescription(PRInt32 aRow, nsAString & _retval)
|
||||
|
@ -533,7 +538,12 @@ NS_IMETHODIMP nsXULTreeColumnsAccessibleWrap::GetRowExtentAt(PRInt32 aRow, PRInt
|
|||
|
||||
NS_IMETHODIMP nsXULTreeColumnsAccessibleWrap::GetColumnDescription(PRInt32 aColumn, nsAString & _retval)
|
||||
{
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
nsCOMPtr<nsIAccessible> column;
|
||||
nsresult rv = CellRefAt(0, aColumn, getter_AddRefs(column));
|
||||
if (NS_SUCCEEDED(rv) && column) {
|
||||
return column->GetName(_retval);
|
||||
}
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsXULTreeColumnsAccessibleWrap::GetRowDescription(PRInt32 aRow, nsAString & _retval)
|
||||
|
|
Загрузка…
Ссылка в новой задаче