nvda icon indicating copy to clipboard operation
nvda copied to clipboard

TextInfo in MSWord throws RuntimeError

Open mltony opened this issue 1 year ago • 0 comments

Steps to reproduce:

  1. Open a new blank document in Microsoft Word.
  2. Enter browse mode by pressing NVDA+space.
  3. Open NVDA Python console by pressing NVDA+control+z and type:
t=focus.treeInterceptor.makeTextInfo('caret')
t.expand('paragraph')
t.collapse(True)

Actual behavior:

Traceback (most recent call last):
  File "<console>", line 1, in <module>
  File "treeInterceptorHandler.pyc", line 234, in collapse
  File "NVDAObjects\window\winword.pyc", line 1048, in collapse
RuntimeError

Expected behavior:

RuntimeError should not be thrown. In general, this is the way I try to advance to the next paragraph and this pattern appears to be used in other places in NVDA. There doesn't appear to be a unified way to communicate to client code that there is no next paragraph available, but in browsers I typically detect that by trying to do so by calling info.expand('paragraph') and then checking whether textInfo is still collapsed. But throwing RuntimeError doesn't seem right here.

NVDA logs, crash dumps and other attachments:

N/A

System configuration

NVDA installed/portable/running from source:

Running from dist

NVDA version:

master

Windows version:

Windows 10

Name and version of other software in use when reproducing the issue:

MSWord 16.0.17029.20140 This reproduces in both UIA enabled and disabled modes.

Other information about your system:

Other questions

Does the issue still occur after restarting your computer?

Yes

Have you tried any other versions of NVDA? If so, please report their behaviors.

No

If NVDA add-ons are disabled, is your problem still occurring?

Yes

Does the issue still occur after you run the COM Registration Fixing Tool in NVDA's tools menu?

N/A

mltony avatar Feb 13 '24 02:02 mltony