bug 717689 - remove unneeded nsCOMPtrs to accessibles r=davidb
authorTrevor Saunders <trev.saunders@gmail.com>
Tue, 27 Dec 2011 21:28:58 -0500
changeset 84630 f0cf32f96fa8cf15e0817d3ead738fad803fe4e4
parent 84629 252d3d08fbc411732d1fd57a2eae514e92247237
child 84631 5f6a7d59e259f066719c49cfae9bc016c7f54157
push id21868
push usermak77@bonardo.net
push dateTue, 17 Jan 2012 15:23:07 +0000
treeherdermozilla-central@ff1bedd7d463 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdavidb
bugs717689
milestone12.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
bug 717689 - remove unneeded nsCOMPtrs to accessibles r=davidb
accessible/src/base/nsAccessible.cpp
--- a/accessible/src/base/nsAccessible.cpp
+++ b/accessible/src/base/nsAccessible.cpp
@@ -1001,17 +1001,17 @@ nsIFrame* nsAccessible::GetBoundsFrame()
 /* void removeSelection (); */
 NS_IMETHODIMP nsAccessible::SetSelected(bool aSelect)
 {
   // Add or remove selection
   if (IsDefunct())
     return NS_ERROR_FAILURE;
 
   if (State() & states::SELECTABLE) {
-    nsCOMPtr<nsIAccessible> multiSelect =
+    nsAccessible* multiSelect =
       nsAccUtils::GetMultiSelectableContainer(mContent);
     if (!multiSelect) {
       return aSelect ? TakeFocus() : NS_ERROR_FAILURE;
     }
 
     if (mRoleMapEntry) {
       if (aSelect) {
         return mContent->SetAttr(kNameSpaceID_None,
@@ -1029,22 +1029,21 @@ NS_IMETHODIMP nsAccessible::SetSelected(
 /* void takeSelection (); */
 NS_IMETHODIMP nsAccessible::TakeSelection()
 {
   // Select only this item
   if (IsDefunct())
     return NS_ERROR_FAILURE;
 
   if (State() & states::SELECTABLE) {
-    nsCOMPtr<nsIAccessible> multiSelect =
+    nsAccessible* multiSelect =
       nsAccUtils::GetMultiSelectableContainer(mContent);
-    if (multiSelect) {
-      nsCOMPtr<nsIAccessibleSelectable> selectable = do_QueryInterface(multiSelect);
-      selectable->ClearSelection();
-    }
+    if (multiSelect)
+      multiSelect->ClearSelection();
+
     return SetSelected(true);
   }
 
   return NS_ERROR_FAILURE;
 }
 
 NS_IMETHODIMP
 nsAccessible::TakeFocus()