Excel with UIA: announce merged cells#12843
Conversation
|
@seanbudd Could you elaborate on why this must go into the 2021.3 release, there doesn't seem to be a justification provided. |
|
I am a frequent user of excel. I hope that this PR can be merged. Is there any problem that prevents this PR? |
seanbudd
left a comment
There was a problem hiding this comment.
Thanks @LeonarddeR - do you know if MS is aware of the bug(s)?
| for i in modGenerator(n) | ||
| )[::-1] | ||
|
|
||
| def _getNumberRepresentationForColumn(self, column): |
There was a problem hiding this comment.
Could this get a unit test with a couple of examples?
There was a problem hiding this comment.
it appears that unittests cannot import from NVDAObjects.UIA.excel
======================================================================
ERROR: Failure: AttributeError ('NoneType' object has no attribute 'registerUIAProperty')
----------------------------------------------------------------------
Traceback (most recent call last):
File "C:\Users\sean\projects\nvda\.venv\lib\site-packages\nose\failure.py", line 39, in runTest
raise self.exc_val.with_traceback(self.tb)
File "C:\Users\sean\projects\nvda\.venv\lib\site-packages\nose\loader.py", line 418, in loadTestsFromName
addr.filename, addr.module)
File "C:\Users\sean\projects\nvda\.venv\lib\site-packages\nose\importer.py", line 47, in importFromPath
return self.importFromDir(dir_path, fqname)
File "C:\Users\sean\projects\nvda\.venv\lib\site-packages\nose\importer.py", line 94, in importFromDir
mod = load_module(part_fqname, fh, filename, desc)
File "C:\Users\sean\AppData\Local\Programs\Python\Python37-32\lib\imp.py", line 234, in load_module
return load_source(name, filename, file)
File "C:\Users\sean\AppData\Local\Programs\Python\Python37-32\lib\imp.py", line 171, in load_source
module = _load(spec)
File "<frozen importlib._bootstrap>", line 696, in _load
File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 728, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "C:\Users\sean\projects\nvda\tests\unit\test_excel.py", line 11, in <module>
from NVDAObjects.UIA.excel import ExcelCell
File "C:\Users\sean\projects\nvda\source\NVDAObjects\UIA\__init__.py", line 928, in <module>
class UIA(Window):
File "C:\Users\sean\projects\nvda\source\NVDAObjects\UIA\__init__.py", line 929, in UIA
_UIACustomProps = UIAHandler.customProps.CustomPropertiesCommon.get()
File "C:\Users\sean\projects\nvda\source\UIAHandler\customProps.py", line 75, in get
cls._instance = cls()
File "C:\Users\sean\projects\nvda\source\UIAHandler\customProps.py", line 83, in __init__
uiaType=UIAutomationType.INT,
File "<string>", line 6, in __init__
File "C:\Users\sean\projects\nvda\source\UIAHandler\customProps.py", line 54, in __post_init__
self.id = NVDAHelper.localLib.registerUIAProperty(
AttributeError: 'NoneType' object has no attribute 'registerUIAProperty'Co-authored-by: Sean Budd <seanbudd123@gmail.com>
Nope. May be @michaelDCurran knows. I believe there's no such thing as a presentational row or column number like the ones implemented for IAccessible2. That would certainly help. |
Link to issue number:
None
Summary of the issue:
When UIA is enabled for Excel, merged cells were not mentioned as such. Instead, only the first coordinates of the merged range were reported.
Description of how this pull request fixes the issue:
There is no way to fetch the last cell in the range from Excel itself. The UIA implementation in Excel also refuses to provide real row and column numbers. Therefore we have to convert the alphabetical column representation to a column number, then correct the column number for column span and convert it back to alphabetical representation.
Testing strategy:
Tested several merged cells on an empty Excel sheet.
Known issues with pull request:
Change log entries:
Changes
Code Review Checklist: