Bug 660149 - nsAccessNode::IsDefunct() should be const, r=trevor

This commit is contained in:
Alexander Surkov 2011-05-28 18:26:45 +09:00
parent 35e44f908f
commit da89e08cb3
10 changed files with 29 additions and 23 deletions

View File

@ -132,6 +132,12 @@ void nsAccessNode::LastRelease()
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
// nsAccessNode public // nsAccessNode public
bool
nsAccessNode::IsDefunct() const
{
return !mContent;
}
PRBool PRBool
nsAccessNode::Init() nsAccessNode::Init()
{ {

View File

@ -120,11 +120,6 @@ public:
*/ */
already_AddRefed<nsINode> GetCurrentFocus(); already_AddRefed<nsINode> GetCurrentFocus();
/**
* Returns true when the accessible is defunct.
*/
virtual PRBool IsDefunct() { return !mContent; }
/** /**
* Initialize the access node object, add it to the cache. * Initialize the access node object, add it to the cache.
*/ */
@ -135,6 +130,11 @@ public:
*/ */
virtual void Shutdown(); virtual void Shutdown();
/**
* Returns true when the accessible is defunct.
*/
virtual bool IsDefunct() const;
/** /**
* Return frame for the given access node object. * Return frame for the given access node object.
*/ */

View File

@ -332,8 +332,8 @@ nsApplicationAccessible::GetPlatformVersion(nsAString& aVersion)
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
// nsAccessNode public methods // nsAccessNode public methods
PRBool bool
nsApplicationAccessible::IsDefunct() nsApplicationAccessible::IsDefunct() const
{ {
return nsAccessibilityService::IsShutdown(); return nsAccessibilityService::IsShutdown();
} }

View File

@ -115,7 +115,7 @@ public:
NS_DECL_NSIACCESSIBLEAPPLICATION NS_DECL_NSIACCESSIBLEAPPLICATION
// nsAccessNode // nsAccessNode
virtual PRBool IsDefunct(); virtual bool IsDefunct() const;
virtual PRBool Init(); virtual PRBool Init();
virtual void Shutdown(); virtual void Shutdown();
virtual bool IsPrimaryForNode() const; virtual bool IsPrimaryForNode() const;

View File

@ -676,8 +676,8 @@ nsDocAccessible::GetFrame() const
return root; return root;
} }
PRBool bool
nsDocAccessible::IsDefunct() nsDocAccessible::IsDefunct() const
{ {
return nsHyperTextAccessibleWrap::IsDefunct() || !mDocument; return nsHyperTextAccessibleWrap::IsDefunct() || !mDocument;
} }

View File

@ -108,7 +108,7 @@ public:
virtual PRBool Init(); virtual PRBool Init();
virtual void Shutdown(); virtual void Shutdown();
virtual nsIFrame* GetFrame() const; virtual nsIFrame* GetFrame() const;
virtual PRBool IsDefunct(); virtual bool IsDefunct() const;
virtual nsINode* GetNode() const { return mDocument; } virtual nsINode* GetNode() const { return mDocument; }
virtual nsIDocument* GetDocumentNode() const { return mDocument; } virtual nsIDocument* GetDocumentNode() const { return mDocument; }

View File

@ -156,8 +156,8 @@ nsXULTreeAccessible::GetValue(nsAString& aValue)
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
// nsXULTreeAccessible: nsAccessNode implementation // nsXULTreeAccessible: nsAccessNode implementation
PRBool bool
nsXULTreeAccessible::IsDefunct() nsXULTreeAccessible::IsDefunct() const
{ {
return nsAccessibleWrap::IsDefunct() || !mTree || !mTreeView; return nsAccessibleWrap::IsDefunct() || !mTree || !mTreeView;
} }
@ -834,8 +834,8 @@ nsXULTreeItemAccessibleBase::DoAction(PRUint8 aIndex)
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
// nsXULTreeItemAccessibleBase: nsAccessNode implementation // nsXULTreeItemAccessibleBase: nsAccessNode implementation
PRBool bool
nsXULTreeItemAccessibleBase::IsDefunct() nsXULTreeItemAccessibleBase::IsDefunct() const
{ {
if (nsAccessibleWrap::IsDefunct() || !mTree || !mTreeView || mRow < 0) if (nsAccessibleWrap::IsDefunct() || !mTree || !mTreeView || mRow < 0)
return PR_TRUE; return PR_TRUE;
@ -1091,8 +1091,8 @@ nsXULTreeItemAccessible::GetName(nsAString& aName)
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
// nsXULTreeItemAccessible: nsAccessNode implementation // nsXULTreeItemAccessible: nsAccessNode implementation
PRBool bool
nsXULTreeItemAccessible::IsDefunct() nsXULTreeItemAccessible::IsDefunct() const
{ {
return nsXULTreeItemAccessibleBase::IsDefunct() || !mColumn; return nsXULTreeItemAccessibleBase::IsDefunct() || !mColumn;
} }

View File

@ -80,7 +80,7 @@ public:
NS_IMETHOD GetFocusedChild(nsIAccessible **aFocusedChild); NS_IMETHOD GetFocusedChild(nsIAccessible **aFocusedChild);
// nsAccessNode // nsAccessNode
virtual PRBool IsDefunct(); virtual bool IsDefunct() const;
virtual void Shutdown(); virtual void Shutdown();
// nsAccessible // nsAccessible
@ -201,7 +201,7 @@ public:
NS_IMETHOD DoAction(PRUint8 aIndex); NS_IMETHOD DoAction(PRUint8 aIndex);
// nsAccessNode // nsAccessNode
virtual PRBool IsDefunct(); virtual bool IsDefunct() const;
virtual void Shutdown(); virtual void Shutdown();
virtual bool IsPrimaryForNode() const; virtual bool IsPrimaryForNode() const;
@ -266,7 +266,7 @@ public:
NS_IMETHOD GetName(nsAString& aName); NS_IMETHOD GetName(nsAString& aName);
// nsAccessNode // nsAccessNode
virtual PRBool IsDefunct(); virtual bool IsDefunct() const;
virtual PRBool Init(); virtual PRBool Init();
virtual void Shutdown(); virtual void Shutdown();

View File

@ -1087,8 +1087,8 @@ nsXULTreeGridCellAccessible::IsSelected(PRBool *aIsSelected)
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
// nsXULTreeGridCellAccessible: nsAccessNode implementation // nsXULTreeGridCellAccessible: nsAccessNode implementation
PRBool bool
nsXULTreeGridCellAccessible::IsDefunct() nsXULTreeGridCellAccessible::IsDefunct() const
{ {
return nsLeafAccessible::IsDefunct() || !mParent || !mTree || !mTreeView || return nsLeafAccessible::IsDefunct() || !mParent || !mTree || !mTreeView ||
!mColumn; !mColumn;

View File

@ -155,7 +155,7 @@ public:
NS_DECL_NSIACCESSIBLETABLECELL NS_DECL_NSIACCESSIBLETABLECELL
// nsAccessNode // nsAccessNode
virtual PRBool IsDefunct(); virtual bool IsDefunct() const;
virtual PRBool Init(); virtual PRBool Init();
virtual bool IsPrimaryForNode() const; virtual bool IsPrimaryForNode() const;