Ensure NVDA can switch from browseMode to focus mode in Microsoft word when using UIA and braille. (#8046)
* Ensure NVDA can switch from browseMode to focus mode in Microsoft word when using UIA and braille.
Specifically:
* UIATextInfo constructor: sometimes it is impossible to get position_first due to buggy UIA implementation (E.g. A chart in a Word document). Make sure to catch COMErrors and raise RuntimeError as expected by calling code.
* review.getObjectPosition: Sometimes fetching position_first on a TextInfo could fail (e.g. a chart in Microsoft Word). Ensure we still get something usable back by falling back to a generic NVDAObjectTextInfo which will always support position_first.
* UIABrowseMode's UIAControlQuickNavIterator: when direction is "up", handle the case where the found element is not actually represented in the document's text and ignore it, and also keep yielding elements until the document is reached, just like all the other directions. Specifically, on a chart in Microsoft word, we may find a focusable element which isn't represented in the document, going up further does find something useful though.
* UIA wordDocument's getTextwithFields: handle the case where there are no fields at all (probably a collapsed range). This addresses the issue where exceptions are raised because the page number can not be properly set on a formatField.
* UIABrowseMode: review action: split up an if check.