free(varChildren);\r
} else {\r
\r
- // No children, so this is a text leaf node.\r
+ // No children, so fetch content from this leaf node.\r
BSTR tempBstr = NULL;\r
wstring content;\r
\r
- if (pacc->get_accName(varChild, &tempBstr) == S_OK) {\r
+ if ((role != ROLE_SYSTEM_TEXT || !(states & STATE_SYSTEM_FOCUSABLE)) && role != ROLE_SYSTEM_COMBOBOX\r
+ && pacc->get_accName(varChild, &tempBstr) == S_OK && tempBstr) {\r
content = tempBstr;\r
SysFreeString(tempBstr);\r
- } else if (pacc->get_accValue(varChild, &tempBstr) == S_OK) {\r
+ } else if (pacc->get_accValue(varChild, &tempBstr) == S_OK && tempBstr) {\r
content = tempBstr;\r
SysFreeString(tempBstr);\r
- } else if (states & STATE_SYSTEM_FOCUSABLE) {\r
+ }\r
+ if (content.empty() && states & STATE_SYSTEM_FOCUSABLE) {\r
// This node is focusable, but contains no text.\r
// Therefore, add it with a space so that the user can get to it.\r
content = L" ";\r