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

Text style navigation fails: NVDA throws runtime error and also listindex out of range in MS Word documents with text splitted in multiple sections / columns #16527

Closed
Adriani90 opened this issue May 12, 2024 · 6 comments
Labels
p3 https://github.com/nvaccess/nvda/blob/master/projectDocs/issues/triage.md#priority triaged Has been triaged, issue is waiting for implementation.
Milestone

Comments

@Adriani90
Copy link
Collaborator

Steps to reproduce:

  1. Open NVDA
  2. Assign [ and shift+[ for different style navigation
  3. Assign ] and shift+] for same style navigation
  4. Open an MS Word document text divided by different sections or columns (this is not the same as a table). see attached document for a test case.
  5. Make sure UIA for MS Word is disabled in NVDA advanced settings
  6. Press multiple times the assigned commands for navigating to next and previous text styles.

Actual behavior:

Following error is written to the log when using same style navigation after NVDA tries to find same style text in different columns / sections, then next same style navigation fails:

IO - inputCore.InputManager.executeGesture (21:04:47.581) - winInputHook (13368):
Input: kb(laptop):plus
DEBUG - watchdog._waitUntilNormalCoreAliveTimeout (21:04:48.088) - watchdog (25576):
Potential freeze, waiting up to 10 seconds.
IO - speech.speech.speak (21:04:48.389) - MainThread (19336):
Speaking ['Spalte 2 von 2', '\n', 'Fortlaufender Abschnittsumbruch', 'AUX INPUT AUDIO/HDMI-Buchse: Schließen Sie eine Videokamera usw. an, indem Sie ein Stereo-Ministecker-Kabel (cp1 Z8"/3,5 mm) oder ein HDMI-Kabel verwenden. ']
DEBUG - UIAHandler.shouldUseUIAInMSWord (21:04:48.439) - MainThread (19336):
User does not want UIA in MS Word unless necessary
DEBUG - watchdog._waitUntilNormalCoreAliveTimeout (21:04:48.589) - watchdog (25576):
Recovered from potential freeze after 1.0006677000783384 seconds.
IO - inputCore.InputManager.executeGesture (21:04:49.249) - winInputHook (13368):
Input: kb(laptop):plus
DEBUG - watchdog._waitUntilNormalCoreAliveTimeout (21:04:49.759) - watchdog (25576):
Potential freeze, waiting up to 10 seconds.
ERROR - scriptHandler.executeScript (21:04:49.879) - MainThread (19336):
error executing script: <bound method BrowseModeTreeInterceptor.addQuickNav.<locals>.<lambda> of <NVDAObjects.window.winword.WordDocumentTreeInterceptor object at 0x018AC2B0>> with gesture 'plus'
Traceback (most recent call last):
  File "scriptHandler.pyc", line 295, in executeScript
  File "browseMode.pyc", line 558, in <lambda>
  File "browseMode.pyc", line 516, in _quickNavScript
  File "browseMode.pyc", line 2449, in _iterTextStyle
  File "textInfos\__init__.pyc", line 756, in moveToCodepointOffset
  File "treeInterceptorHandler.pyc", line 234, in collapse
  File "NVDAObjects\window\winword.pyc", line 1052, in collapse
RuntimeError
DEBUG - watchdog._waitUntilNormalCoreAliveTimeout (21:04:50.262) - watchdog (25576):
Recovered from potential freeze after 1.0011410999577492 seconds.
IO - inputCore.InputManager.executeGesture (20:39:08.268) - winInputHook (13368):
Input: kb(laptop):plus
ERROR - scriptHandler.executeScript (20:39:08.743) - MainThread (19336):
error executing script: <bound method BrowseModeTreeInterceptor.addQuickNav.<locals>.<lambda> of <NVDAObjects.window.winword.WordDocumentTreeInterceptor object at 0x018C9F70>> with gesture 'plus'
Traceback (most recent call last):
  File "scriptHandler.pyc", line 295, in executeScript
  File "browseMode.pyc", line 558, in <lambda>
  File "browseMode.pyc", line 516, in _quickNavScript
  File "browseMode.pyc", line 2447, in _iterTextStyle
IndexError: list index out of range

The same happens for different style navigation, but with a different error:

IO - inputCore.InputManager.executeGesture (21:02:33.099) - winInputHook (13368):
Input: kb(laptop):ü
DEBUG - watchdog._waitUntilNormalCoreAliveTimeout (21:02:33.608) - watchdog (25576):
Potential freeze, waiting up to 10 seconds.
IO - speech.speech.speak (21:02:33.754) - MainThread (19336):
Speaking ['Abschnitt 2', '(-ßS6)']
DEBUG - UIAHandler.shouldUseUIAInMSWord (21:02:33.769) - MainThread (19336):
User does not want UIA in MS Word unless necessary
DEBUG - watchdog._waitUntilNormalCoreAliveTimeout (21:02:34.109) - watchdog (25576):
Recovered from potential freeze after 1.000636599957943 seconds.
IO - inputCore.InputManager.executeGesture (21:01:22.720) - winInputHook (13368):
Input: kb(laptop):ü
ERROR - scriptHandler.executeScript (21:01:23.080) - MainThread (19336):
error executing script: <bound method BrowseModeTreeInterceptor.addQuickNav.<locals>.<lambda> of <NVDAObjects.window.winword.WordDocumentTreeInterceptor object at 0x018AC2B0>> with gesture 'ü'
Traceback (most recent call last):
  File "scriptHandler.pyc", line 295, in executeScript
  File "browseMode.pyc", line 558, in <lambda>
  File "browseMode.pyc", line 516, in _quickNavScript
  File "browseMode.pyc", line 2449, in _iterTextStyle
  File "textInfos\__init__.pyc", line 756, in moveToCodepointOffset
  File "treeInterceptorHandler.pyc", line 234, in collapse
  File "NVDAObjects\window\winword.pyc", line 1052, in collapse
RuntimeError

When using UIA in MS Word, following error appears and style navigation fails when using previous same style or previous different style command.

IO - inputCore.InputManager.executeGesture (21:08:47.349) - winInputHook (13368):
Input: kb(laptop):shift+plus
ERROR - scriptHandler.executeScript (21:08:47.370) - MainThread (19336):
error executing script: <bound method BrowseModeTreeInterceptor.addQuickNav.<locals>.<lambda> of <NVDAObjects.UIA.wordDocument.WordBrowseModeDocument object at 0x065EA3B0>> with gesture 'Umschalt+plus'
Traceback (most recent call last):
  File "scriptHandler.pyc", line 295, in executeScript
  File "browseMode.pyc", line 567, in <lambda>
  File "browseMode.pyc", line 516, in _quickNavScript
  File "browseMode.pyc", line 2404, in _iterTextStyle
  File "textInfos\__init__.pyc", line 818, in moveToCodepointOffset
RuntimeError: Unable to find desired offset in TextInfo.

Expected behavior:

Text style navigation should work also when using columns and sections to split text in MS Word.

NVDA logs, crash dumps and other attachments:

n/a

System configuration

NVDA installed/portable/running from source:

Installed

NVDA version:

alpha-31858,2d865027 (2024.3.0.31858)

Windows version:

Windows 11 23 H2

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

MS Office Word 365 MSO (Version 2403 Build 16.0.17425.20176) 64 Bit

Other information about your system:

n/a

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.

n/a

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

No add-ons in use

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

yes
SETUP MIC.docx

@Adriani90
Copy link
Collaborator Author

cc: @mltony this seems the same error like #16459. Maybe they are related.

@Adriani90
Copy link
Collaborator Author

Maybe you can reproduce with the attached test case from here.

@seanbudd seanbudd added p3 https://github.com/nvaccess/nvda/blob/master/projectDocs/issues/triage.md#priority triaged Has been triaged, issue is waiting for implementation. labels May 13, 2024
@seanbudd seanbudd added this to the 2024.2 milestone May 13, 2024
@Adriani90
Copy link
Collaborator Author

This happens with UIA enabled as well, see attached document for a test case. Following is written to the log, cc: @seanbudd:

IO - inputCore.InputManager.executeGesture (07:27:25.409) - winInputHook (25672):
Input: kb(laptop):shift+plus
IO - speech.speech.speak (07:27:25.868) - MainThread (25968):
Speaking ['Link', '\t29', 'Link Ende', '\n']
DEBUG - UIAHandler.shouldUseUIAInMSWord (07:27:25.900) - MainThread (25968):
Using UIA due to suitable Office version: (16, 0, 17531)
IO - inputCore.InputManager.executeGesture (07:27:26.458) - winInputHook (25672):
Input: kb(laptop):plus
DEBUG - watchdog._waitUntilNormalCoreAliveTimeout (07:27:26.978) - watchdog (29136):
Potential freeze, waiting up to 10 seconds.
IO - speech.speech.speak (07:27:27.108) - MainThread (25968):
Speaking ['\nAn ARC-Fernseher\n31\n']
DEBUG - UIAHandler.shouldUseUIAInMSWord (07:27:27.141) - MainThread (25968):
Using UIA due to suitable Office version: (16, 0, 17531)
DEBUG - watchdog._waitUntilNormalCoreAliveTimeout (07:27:27.479) - watchdog (29136):
Recovered from potential freeze after 1.0010825998615474 seconds.
IO - inputCore.InputManager.executeGesture (07:27:27.882) - winInputHook (25672):
Input: kb(laptop):ü
DEBUG - watchdog._waitUntilNormalCoreAliveTimeout (07:27:28.395) - watchdog (29136):
Potential freeze, waiting up to 10 seconds.
ERROR - scriptHandler.executeScript (07:27:28.395) - MainThread (25968):
error executing script: <bound method BrowseModeTreeInterceptor.addQuickNav.<locals>.<lambda> of <NVDAObjects.window.winword.WordDocumentTreeInterceptor object at 0x095CAF50>> with gesture 'ü'
Traceback (most recent call last):
  File "scriptHandler.pyc", line 295, in executeScript
  File "browseMode.pyc", line 558, in <lambda>
  File "browseMode.pyc", line 516, in _quickNavScript
  File "browseMode.pyc", line 2449, in _iterTextStyle
  File "textInfos\__init__.pyc", line 794, in moveToCodepointOffset
RuntimeError: Unable to find desired offset in TextInfo.
IO - inputCore.InputManager.executeGesture (07:27:28.489) - winInputHook (25672):
Input: kb(laptop):plus
DEBUG - watchdog._waitUntilNormalCoreAliveTimeout (07:27:28.896) - watchdog (29136):
Recovered from potential freeze after 1.0006856999825686 seconds.
DEBUG - watchdog._waitUntilNormalCoreAliveTimeout (07:27:28.994) - watchdog (29136):
Potential freeze, waiting up to 10 seconds.
ERROR - scriptHandler.executeScript (07:27:29.012) - MainThread (25968):
error executing script: <bound method BrowseModeTreeInterceptor.addQuickNav.<locals>.<lambda> of <NVDAObjects.window.winword.WordDocumentTreeInterceptor object at 0x095CAF50>> with gesture 'plus'
Traceback (most recent call last):
  File "scriptHandler.pyc", line 295, in executeScript
  File "browseMode.pyc", line 558, in <lambda>
  File "browseMode.pyc", line 516, in _quickNavScript
  File "browseMode.pyc", line 2449, in _iterTextStyle
  File "textInfos\__init__.pyc", line 794, in moveToCodepointOffset
RuntimeError: Unable to find desired offset in TextInfo.
DEBUG - watchdog._waitUntilNormalCoreAliveTimeout (07:27:29.495) - watchdog (29136):
Recovered from potential freeze after 1.0009361000265926 seconds.
IO - inputCore.InputManager.executeGesture (07:36:43.587) - winInputHook (25672):
Input: kb(laptop):ü
DEBUG - watchdog._waitUntilNormalCoreAliveTimeout (07:36:44.095) - watchdog (29136):
Potential freeze, waiting up to 10 seconds.
IO - speech.speech.speak (07:36:44.787) - MainThread (25968):
Speaking ['\nBlinkt, wenn die Stummschaltung aktiv ist.\nZeigt verschiedene Informationen zu den Eingangssignalen an.\n• "DialogNorm: X dB" ("X" ist ein numerischer Wert) kann angezeigt werden, wenn eine Dolby Digital, Dolby Digital Plus oder Dolby TrueHD-Quelle abgespielt wird. Wenn zum Beispiel "DialogNorm: +4 dB" angezeigt wird, wird die abgespielte Quelle mit 4 dB plus dem THX-Standardpegel aufgenommen. Wenn Sie mit dem THX-Standardpegel abspielen, senken Sie die Lautstärke um 4 dB.\nLeuchtet möglicherweise bei Bedienvorgängen mit dem "NET" Eingangsselektor.', 'Abschnittsumbruch auf neuer Seite']
DEBUG - UIAHandler.shouldUseUIAInMSWord (07:36:44.818) - MainThread (25968):
Using UIA due to suitable Office version: (16, 0, 17531)
DEBUG - watchdog._waitUntilNormalCoreAliveTimeout (07:36:45.097) - watchdog (29136):
Recovered from potential freeze after 1.501300600124523 seconds.
IO - inputCore.InputManager.executeGesture (07:36:45.680) - winInputHook (25672):
Input: kb(laptop):ü
DEBUG - watchdog._waitUntilNormalCoreAliveTimeout (07:36:46.198) - watchdog (29136):
Potential freeze, waiting up to 10 seconds.
ERROR - scriptHandler.executeScript (07:36:47.527) - MainThread (25968):
error executing script: <bound method BrowseModeTreeInterceptor.addQuickNav.<locals>.<lambda> of <NVDAObjects.window.winword.WordDocumentTreeInterceptor object at 0x095CAF50>> with gesture 'ü'
Traceback (most recent call last):
  File "scriptHandler.pyc", line 295, in executeScript
  File "browseMode.pyc", line 558, in <lambda>
  File "browseMode.pyc", line 516, in _quickNavScript
  File "browseMode.pyc", line 2463, in _iterTextStyle
  File "browseMode.pyc", line 2321, in _expandStyle
IndexError: list index out of range

ONKYO.docx

@Adriani90
Copy link
Collaborator Author

It seems the style navigation includes tab characters, new line characters, space characters and separators in tables or text columns. This should not be the case as explained in another issue. The user expects to land on a visible valid text or numeric character, but not on separator lines or on blank lines or on tab characters.
I think this issue might be solved if these characters were excluded from the style navigation all together.

@Adriani90
Copy link
Collaborator Author

And very probably will have positive effects on performance.

seanbudd pushed a commit that referenced this issue May 20, 2024
)

Closes #16459
Closes #16408
Closes #16458
Closes #16405

Summary of the issue:
We have discovered multiple problemds with non-UIA textInfo implementation in MS Word. Some examples are #16527, #16459, #16458. Also TextInfo implenetation in Outlook has proven to be too slow for style navigation. Therefore disabling both.

Description of user facing changes
"Not supported in this document" message is spoken.

Description of development approach
Raising an error when Outlook or non-UIA Word is detected.
seanbudd pushed a commit that referenced this issue May 20, 2024
)

Closes #16459
Closes #16408
Closes #16458
Closes #16405

Summary of the issue:
We have discovered multiple problemds with non-UIA textInfo implementation in MS Word. Some examples are #16527, #16459, #16458. Also TextInfo implenetation in Outlook has proven to be too slow for style navigation. Therefore disabling both.

Description of user facing changes
"Not supported in this document" message is spoken.

Description of development approach
Raising an error when Outlook or non-UIA Word is detected.
@seanbudd
Copy link
Member

Fixed by #16595

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
p3 https://github.com/nvaccess/nvda/blob/master/projectDocs/issues/triage.md#priority triaged Has been triaged, issue is waiting for implementation.
Projects
None yet
Development

No branches or pull requests

2 participants