Example #1
0
const gchar *
getDescriptionCB(AtkObject *aAtkObj)
{
    AccessibleWrap* accWrap = GetAccessibleWrap(aAtkObj);
    if (!accWrap || accWrap->IsDefunct())
        return nsnull;

    /* nsIAccessible is responsible for the non-NULL description */
    nsAutoString uniDesc;
    accWrap->Description(uniDesc);

    NS_ConvertUTF8toUTF16 objDesc(aAtkObj->description);
    if (!uniDesc.Equals(objDesc))
        atk_object_set_description(aAtkObj,
                                   NS_ConvertUTF16toUTF8(uniDesc).get());

    return aAtkObj->description;
}
Example #2
0
const gchar *
getDescriptionCB(AtkObject *aAtkObj)
{
  nsAutoString uniDesc;
  AccessibleWrap* accWrap = GetAccessibleWrap(aAtkObj);
  if (accWrap) {
    if (accWrap->IsDefunct())
      return nullptr;

    accWrap->Description(uniDesc);
  } else if (ProxyAccessible* proxy = GetProxy(aAtkObj)) {
    proxy->Description(uniDesc);
  } else {
    return nullptr;
  }

    NS_ConvertUTF8toUTF16 objDesc(aAtkObj->description);
    if (!uniDesc.Equals(objDesc))
        atk_object_set_description(aAtkObj,
                                   NS_ConvertUTF16toUTF8(uniDesc).get());

    return aAtkObj->description;
}