Fix for bug 376832 - L0, 1 of 1 being exposed for acc_description on everything, r=aaronlev

git-svn-id: svn://10.0.0.236/trunk@224609 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
surkov.alexander%gmail.com
2007-04-17 05:13:24 +00:00
parent a86fd18a8a
commit 4e2c8e33e2
3 changed files with 8 additions and 8 deletions

View File

@@ -2290,7 +2290,7 @@ nsAccessible::GroupPosition(PRInt32 *aGroupLevel,
*aGroupLevel = level;
*aPositionInGroup = posInSet - 1;
*aPositionInGroup = posInSet;
*aSimilarItemsInGroup = setSize - 1;
return NS_OK;

View File

@@ -330,8 +330,8 @@ nsAccessibleWrap::get_accDescription(VARIANT varChild,
nsresult rv = xpAccessible->GroupPosition(&groupLevel, &similarItemsInGroup,
&positionInGroup);
if (NS_SUCCEEDED(rv)) {
if (positionInGroup != -1 && similarItemsInGroup != -1) {
if (groupLevel != -1) {
if (positionInGroup > 0) {
if (groupLevel > 0) {
// XXX: How do we calculate the number of children? Now we append
// " with [numChildren]c" for tree item. In the future we may need to
// use the ARIA owns property to calculate that if it's present.
@@ -367,18 +367,18 @@ nsAccessibleWrap::get_accDescription(VARIANT varChild,
if (numChildren) {
nsTextFormatter::ssprintf(description,
NS_LITERAL_STRING("L%d, %d of %d with %d").get(),
groupLevel, positionInGroup + 1,
groupLevel, positionInGroup,
similarItemsInGroup + 1, numChildren);
} else {
nsTextFormatter::ssprintf(description,
NS_LITERAL_STRING("L%d, %d of %d").get(),
groupLevel, positionInGroup + 1,
groupLevel, positionInGroup,
similarItemsInGroup + 1);
}
} else { // Position has no level
nsTextFormatter::ssprintf(description,
NS_LITERAL_STRING("%d of %d").get(),
positionInGroup + 1, similarItemsInGroup + 1);
positionInGroup, similarItemsInGroup + 1);
}
*pszDescription = ::SysAllocString(description.get());