-
-
Notifications
You must be signed in to change notification settings - Fork 830
Add a helper to getAccessibleChildren #13126
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -950,25 +950,20 @@ VBufStorage_fieldNode_t* GeckoVBufBackend_t::fillVBuf( | |
|
|
||
| } else if (renderChildren && childCount > 0) { | ||
| // The object has no text, but we do want to render its children. | ||
| VARIANT* varChildren; | ||
| if(!(varChildren=(VARIANT*)malloc(sizeof(VARIANT)*childCount))) { | ||
| LOG_DEBUG(L"Error allocating varChildren memory"); | ||
| return NULL; | ||
| auto [varChildren, accChildRes] = getAccessibleChildren(pacc, 0, childCount); | ||
| if (S_OK != accChildRes || varChildren.size() == 0) { | ||
| LOG_ERROR(L"AccessibleChildren failed (count: " << childCount << L"), res: " << accChildRes); | ||
| } | ||
| long accessibleChildrenCount = 0; | ||
| if(AccessibleChildren(pacc,0,childCount,varChildren,&accessibleChildrenCount)!=S_OK) { | ||
| LOG_DEBUG(L"AccessibleChildren failed"); | ||
| accessibleChildrenCount=0; | ||
| } | ||
| for(long i=0;i<accessibleChildrenCount;++i) { | ||
| if (varChildren[i].vt != VT_DISPATCH) { | ||
| VariantClear(&(varChildren[i])); | ||
| LOG_DEBUG(L"got " << varChildren.size() << L" children"); | ||
|
|
||
| for(CComVariant& child : varChildren) { | ||
| if (child.vt != VT_DISPATCH || !child.pdispVal) { | ||
| child.Clear(); | ||
| continue; | ||
| } | ||
| IAccessible2* childPacc=NULL; | ||
| if(varChildren[i].pdispVal) varChildren[i].pdispVal->QueryInterface(IID_IAccessible2,(void**)&childPacc); | ||
| CComQIPtr< IAccessible2, &IID_IAccessible2> childPacc(child.pdispVal); | ||
| if (!childPacc) { | ||
| VariantClear(&(varChildren[i])); | ||
| child.Clear(); | ||
| continue; | ||
| } | ||
| tempNode = this->fillVBuf( | ||
|
|
@@ -986,11 +981,8 @@ VBufStorage_fieldNode_t* GeckoVBufBackend_t::fillVBuf( | |
| } | ||
| else | ||
| LOG_DEBUG(L"Error in calling fillVBuf"); | ||
| childPacc->Release(); | ||
| VariantClear(&(varChildren[i])); | ||
| child.Clear(); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. All the calls to child.clear are not necessary I think, as CComVariant's destructor does this itself.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, you are right, explicitly calling clear isn't necessary. I left them in to maintain the existing timing of the release. As much as possible I was trying to avoid the output binary from changing. I can look at this again if you would like? |
||
| } | ||
| free(varChildren); | ||
|
|
||
| } else if (renderSelectedItemOnly) { | ||
| CComPtr<IAccessible2> item = this->getSelectedItem(pacc, IA2AttribsMap); | ||
| if (item) { | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.