nvda
08de8de3 - Fix issues with script propagation in Excel as well as tree interceptor passthrough on init (#15136)

Commit
2 years ago
Fix issues with script propagation in Excel as well as tree interceptor passthrough on init (#15136) Fixes #15131 Fixes #10612 Summary of the issue: Recent changes to Excel support caused an issue where selection in the Excel cell edit control didn't work. When fixing that, I discovered another issue where initializing the Excel tree interceptor set the passThrough auto property to True, resulting into vision and braille focus set to the previous focus object. Description of user facing changes Selection works again in cell edit controls When leaving a cell edit control, the name of the sheet is announced again, similar when coming from the formula bar. When an excel cell gets focus from outside, focus is no longer needlessly set to the previous focus object. Description of development approach This is another case of an issue that was obfuscated before #14984. There is a workaround in the Excel appModule to fallback on the UIA edit control if the edit control that gets focus when pressing f2 reports as unknown. However, the parent of the UIA control was set to the excel cell, not to the parent of the Excel6 window. This means that the changeSelection script still propagated, i.e. for every selection change related gesture in the cell edit control, NVDA would check whether a new cell was focused. I changed the app module to set the parent of the UIA cell edit to the parent of the Excel6 window. This has the side effect of the sheet name being reported after leaving the edit control because the sheet receives focus again. This is however consistent with behavior prior to the app module workaround was applied, i.e. the time when we relied on the displayText to report the contents. After I applied this change, I discovered that leaving the edit cell raised a COMError on an UIA object. This turned out to be an issue like this: api.setFocusObject was called for the new focus object (i.e. the worksheet) A new tree interceptor was created for the work sheet In the init method of the tree interceptor, self.passThrough was set, which is an auto property calling _set_passThrough on the tree interceptor. _set_passThrough called braille.handler.handleGainFocus and vision.handler.handleGainFocus for the current focus object, which was still the previous focus object (i.e. api.setFocusObject was not yet updated to the new focus). a COMError was raised because the UIA cell edit element was no longer available. I fixed this by setting _passThrough instead, which sets the internal _passThrough boolean without applying the logic that updates focus for vision and braille, which is really not necessary and even harmful to do in init of a tree interceptor. I therefore applied the same change to another incarnation of this issue in the MSHTML virtual buffer.
Author
Parents
Loading