bug 1159850 - make ia2Accessiblevalue use proxies r=davidb
authorTrevor Saunders <tbsaunde@tbsaunde.org>
Wed, 29 Apr 2015 14:51:13 -0400
changeset 242804 d5a70f4292a641c5e4e55e7e139e3214b16fc0ec
parent 242803 603d4c01ca0a3e569020cf9e63106a6d448019d2
child 242805 c5dcb389afee0d7e9178e7c1d7fa073a4478b6e9
push id59514
push usertrev.saunders@gmail.com
push dateThu, 07 May 2015 17:48:20 +0000
treeherdermozilla-inbound@d5a70f4292a6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdavidb
bugs1159850
milestone40.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 1159850 - make ia2Accessiblevalue use proxies r=davidb
accessible/windows/ia2/ia2AccessibleValue.cpp
--- a/accessible/windows/ia2/ia2AccessibleValue.cpp
+++ b/accessible/windows/ia2/ia2AccessibleValue.cpp
@@ -49,62 +49,77 @@ ia2AccessibleValue::get_currentValue(VAR
   A11Y_TRYBLOCK_BEGIN
 
   if (!aCurrentValue)
     return E_INVALIDARG;
 
   VariantInit(aCurrentValue);
 
   AccessibleWrap* valueAcc = static_cast<AccessibleWrap*>(this);
-  if (valueAcc->IsDefunct())
-    return CO_E_OBJNOTCONNECTED;
+  double currentValue;
+  if (valueAcc->IsProxy()) {
+    currentValue = valueAcc->Proxy()->CurValue();
+  } else {
+    if (valueAcc->IsDefunct())
+      return CO_E_OBJNOTCONNECTED;
 
-  double currentValue = valueAcc->CurValue();
+    currentValue = valueAcc->CurValue();
+  }
+
   if (IsNaN(currentValue))
     return S_FALSE;
 
   aCurrentValue->vt = VT_R8;
   aCurrentValue->dblVal = currentValue;
   return S_OK;
 
   A11Y_TRYBLOCK_END
 }
 
 STDMETHODIMP
 ia2AccessibleValue::setCurrentValue(VARIANT aValue)
 {
   A11Y_TRYBLOCK_BEGIN
 
+  if (aValue.vt != VT_R8)
+    return E_INVALIDARG;
+
   AccessibleWrap* valueAcc = static_cast<AccessibleWrap*>(this);
+  if (valueAcc->IsProxy())
+    return valueAcc->Proxy()->SetCurValue(aValue.dblVal) ? S_OK : E_FAIL;
+
   if (valueAcc->IsDefunct())
     return CO_E_OBJNOTCONNECTED;
 
-  if (aValue.vt != VT_R8)
-    return E_INVALIDARG;
-
   return valueAcc->SetCurValue(aValue.dblVal) ? S_OK : E_FAIL;
 
   A11Y_TRYBLOCK_END
 }
 
 STDMETHODIMP
 ia2AccessibleValue::get_maximumValue(VARIANT* aMaximumValue)
 {
   A11Y_TRYBLOCK_BEGIN
 
   if (!aMaximumValue)
     return E_INVALIDARG;
 
   VariantInit(aMaximumValue);
 
   AccessibleWrap* valueAcc = static_cast<AccessibleWrap*>(this);
-  if (valueAcc->IsDefunct())
-    return CO_E_OBJNOTCONNECTED;
+  double maximumValue;
+  if (valueAcc->IsProxy()) {
+    maximumValue = valueAcc->Proxy()->MaxValue();
+  } else {
+    if (valueAcc->IsDefunct())
+      return CO_E_OBJNOTCONNECTED;
 
-  double maximumValue = valueAcc->MaxValue();
+    maximumValue = valueAcc->MaxValue();
+  }
+
   if (IsNaN(maximumValue))
     return S_FALSE;
 
   aMaximumValue->vt = VT_R8;
   aMaximumValue->dblVal = maximumValue;
   return S_OK;
 
   A11Y_TRYBLOCK_END
@@ -116,20 +131,26 @@ ia2AccessibleValue::get_minimumValue(VAR
   A11Y_TRYBLOCK_BEGIN
 
   if (!aMinimumValue)
     return E_INVALIDARG;
 
   VariantInit(aMinimumValue);
 
   AccessibleWrap* valueAcc = static_cast<AccessibleWrap*>(this);
-  if (valueAcc->IsDefunct())
-    return CO_E_OBJNOTCONNECTED;
+  double minimumValue;
+  if (valueAcc->IsProxy()) {
+    minimumValue = valueAcc->Proxy()->MinValue();
+  } else {
+    if (valueAcc->IsDefunct())
+      return CO_E_OBJNOTCONNECTED;
 
-  double minimumValue = valueAcc->MinValue();
+    minimumValue = valueAcc->MinValue();
+  }
+
   if (IsNaN(minimumValue))
     return S_FALSE;
 
   aMinimumValue->vt = VT_R8;
   aMinimumValue->dblVal = minimumValue;
   return S_OK;
 
   A11Y_TRYBLOCK_END