Skip to content
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

Error when navigating in Word or PowerPoint #18

Open
CyrilleB79 opened this issue Sep 26, 2024 · 3 comments
Open

Error when navigating in Word or PowerPoint #18

CyrilleB79 opened this issue Sep 26, 2024 · 3 comments

Comments

@CyrilleB79
Copy link
Contributor

CyrilleB79 commented Sep 26, 2024

Issue

Word navigation does not work in Word nor in PowerPoint slideshow: the cursor does not move and there is no speech feedback.
Errors are logged:

Logged errors

  1. In Word, browse mode off, no UIA:
ERROR - scriptHandler.executeScript (13:55:23.800) - MainThread (15672):
error executing script: <bound method script_caret_moveByWordWordNav of <NVDAObjects.Dynamic_EditableTextLogContainerWinwordWordDocumentWordDocumentIAccessibleWindowNVDAObject object at 0x0542DEF0>> with gesture 'contrôle+flèche gauche'
Traceback (most recent call last):
  File "scriptHandler.pyc", line 300, in executeScript
  File "C:\Users\Cyrille\AppData\Roaming\nvda\addons\wordNav\globalPlugins\wordNav.py", line 697, in script_caret_moveByWordWordNav
    doWordMove(caretInfo, pattern, direction, wordCount)
  File "C:\Users\Cyrille\AppData\Roaming\nvda\addons\wordNav\globalPlugins\wordNav.py", line 843, in doWordMove
    wordEndInfo = moveToCodePointOffset(paragraphInfo, wordEndOffset)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Cyrille\AppData\Roaming\nvda\addons\wordNav\globalPlugins\wordNav.py", line 777, in moveToCodePointOffset
    raise e
  File "C:\Users\Cyrille\AppData\Roaming\nvda\addons\wordNav\globalPlugins\wordNav.py", line 772, in moveToCodePointOffset
    return textInfo.moveToCodepointOffset(offset)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "textInfos\__init__.pyc", line 862, in moveToCodepointOffset
  File "NVDAObjects\window\winword.pyc", line 1126, in collapse
RuntimeError
  1. In Word, browse mode on, no UIA:
ERROR - scriptHandler.executeScript (13:58:22.508) - MainThread (15672):
error executing script: <bound method script_caret_moveByWordWordNav of <NVDAObjects.window.winword.WordDocumentTreeInterceptor object at 0x0930B2F0>> with gesture 'contrôle+flèche gauche'
Traceback (most recent call last):
  File "scriptHandler.pyc", line 300, in executeScript
  File "C:\Users\Cyrille\AppData\Roaming\nvda\addons\wordNav\globalPlugins\wordNav.py", line 697, in script_caret_moveByWordWordNav
    doWordMove(caretInfo, pattern, direction, wordCount)
  File "C:\Users\Cyrille\AppData\Roaming\nvda\addons\wordNav\globalPlugins\wordNav.py", line 843, in doWordMove
    wordEndInfo = moveToCodePointOffset(paragraphInfo, wordEndOffset)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Cyrille\AppData\Roaming\nvda\addons\wordNav\globalPlugins\wordNav.py", line 777, in moveToCodePointOffset
    raise e
  File "C:\Users\Cyrille\AppData\Roaming\nvda\addons\wordNav\globalPlugins\wordNav.py", line 772, in moveToCodePointOffset
    return textInfo.moveToCodepointOffset(offset)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "textInfos\__init__.pyc", line 862, in moveToCodepointOffset
  File "treeInterceptorHandler.pyc", line 241, in collapse
  File "NVDAObjects\window\winword.pyc", line 1126, in collapse
RuntimeError

  1. In PowerPoint slideshow:
ERROR - scriptHandler.executeScript (14:00:13.658) - MainThread (15672):
error executing script: <bound method script_caret_moveByWordWordNav of <appModules.powerpnt.ReviewableSlideshowTreeInterceptor object at 0x0AA5E4F0>> with gesture 'contrôle+flèche droite'
Traceback (most recent call last):
  File "scriptHandler.pyc", line 300, in executeScript
  File "C:\Users\Cyrille\AppData\Roaming\nvda\addons\wordNav\globalPlugins\wordNav.py", line 658, in script_caret_moveByWordWordNav
    blacklisted = isBlacklistedApp(obj)
                  ^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Cyrille\AppData\Roaming\nvda\addons\wordNav\globalPlugins\wordNav.py", line 522, in isBlacklistedApp
    appName = focus.appModule.appName
              ^^^^^^^^^^^^^^^
AttributeError: 'ReviewableSlideshowTreeInterceptor' object has no attribute 'appModule'

Versions

  • NVDA 2024.4beta4.
  • WordNav 2.2.2
  • Windows 10 22H2 (AMD64) build 19045.4894
  • Office 2016

When resolving the issue

Take care to test with UIA on / off, browse mode on / off. Thanks!

@CyrilleB79
Copy link
Contributor Author

@mltony I can see that you have just made a release. Any chance to also fix this? I have just encountered the issue again in PowerPoint.

You should probably check if the focus belongs to a tree interceptor (and if it is active) to decide if you need to take the object itself or its root object. You can see such constructions in globalCommands.py.

@mltony
Copy link
Owner

mltony commented Nov 14, 2024

@CyrilleB79,
So the first two exceptions are manifestations of this problem in NVDA:
nvaccess/nvda#16172
I never had time to look deeper into this one as I don't use Word much. Moreover it seems that switching to UIA mode in word can be used as a workaround. But yeah, it doesn't make any sense that you can't collapse a textInfo in MS Word.
I think I just fixed the third exception and pushed 1 commit in master branch. Could you check if the problem goes away?

@CyrilleB79
Copy link
Contributor Author

Yes, this seems OK now in PowerPoint with this new commit. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants