bug 1241453 - fixup xpcAccessible Intl() methods to not assume mIntl is always an Accessible r=davidb

This commit is contained in:
Trevor Saunders 2016-01-21 00:07:56 -05:00
parent 64b8e7af37
commit 24fd26a373
5 changed files with 28 additions and 5 deletions

View File

@ -61,7 +61,14 @@ protected:
virtual ~xpcAccessibleDocument() {}
private:
DocAccessible* Intl() { return mIntl.AsAccessible()->AsDoc(); }
DocAccessible* Intl()
{
if (Accessible* acc = mIntl.AsAccessible()) {
return acc->AsDoc();
}
return nullptr;
}
void NotifyOfShutdown(Accessible* aAccessible)
{

View File

@ -43,7 +43,14 @@ protected:
virtual ~xpcAccessibleHyperText() {}
private:
HyperTextAccessible* Intl() { return mIntl.AsAccessible()->AsHyperText(); }
HyperTextAccessible* Intl()
{
if (Accessible* acc = mIntl.AsAccessible()) {
return acc->AsHyperText();
}
return nullptr;
}
xpcAccessibleHyperText(const xpcAccessibleHyperText&) = delete;
xpcAccessibleHyperText& operator =(const xpcAccessibleHyperText&) = delete;

View File

@ -34,7 +34,8 @@ protected:
virtual ~xpcAccessibleImage() {}
private:
ImageAccessible* Intl() { return mIntl.AsAccessible()->AsImage(); }
ImageAccessible* Intl()
{ return mIntl.IsAccessible() ? mIntl.AsAccessible()->AsImage() : nullptr; }
xpcAccessibleImage(const xpcAccessibleImage&) = delete;
xpcAccessibleImage& operator =(const xpcAccessibleImage&) = delete;

View File

@ -83,7 +83,8 @@ protected:
virtual ~xpcAccessibleTable() {}
private:
TableAccessible* Intl() { return mIntl.AsAccessible()->AsTable(); }
TableAccessible* Intl()
{ return mIntl.IsAccessible() ? mIntl.AsAccessible()->AsTable() : nullptr; }
xpcAccessibleTable(const xpcAccessibleTable&) = delete;
xpcAccessibleTable& operator =(const xpcAccessibleTable&) = delete;

View File

@ -43,7 +43,14 @@ protected:
virtual ~xpcAccessibleTableCell() {}
private:
TableCellAccessible* Intl() { return mIntl.AsAccessible()->AsTableCell(); }
TableCellAccessible* Intl()
{
if (Accessible* acc = mIntl.AsAccessible()) {
return acc->AsTableCell();
}
return nullptr;
}
xpcAccessibleTableCell(const xpcAccessibleTableCell&) = delete;
xpcAccessibleTableCell& operator =(const xpcAccessibleTableCell&) = delete;