Skip to content

Commit 3f82ab6

Browse files
authored
Remove carriage return and bell character from table header information in IAccessible MS Word (#16874)
Closes #7212 Summary of the issue: When accessing Microsoft Word via IAccessible, column and row headers set with the set row/column header scripts in NVDA have '\r\a' at the end of them. While this does not seem to be an issue for speech (presumably synths just ignore control characters), these characters were being output in braille. Description of user facing changes Extraneous output is no longer produced. Description of development approach Modified NVDAObjects.IAccessible.winword.WordDocument.fetchAssociatedHeaderCellText to drop '\r\a' if it was a suffix to any of the row or column headers' text.
1 parent 74554eb commit 3f82ab6

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

source/NVDAObjects/IAccessible/winword.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,8 @@ def fetchAssociatedHeaderCellText(self, cell, columnHeader=False):
219219
tempColumnNumber -= 1
220220
continue
221221
break
222-
textList.append(headerCell.range.text)
222+
# 7212: Filter the carriage return and bell character from header text.
223+
textList.append(headerCell.range.text.removesuffix("\r\a"))
223224
else:
224225
for headerColumnNumber in range(info.columnNumber, info.columnNumber + info.colSpan):
225226
tempRowNumber = rowNumber
@@ -230,7 +231,8 @@ def fetchAssociatedHeaderCellText(self, cell, columnHeader=False):
230231
tempRowNumber -= 1
231232
continue
232233
break
233-
textList.append(headerCell.range.text)
234+
# 7212: Filter the carriage return and bell character from header text.
235+
textList.append(headerCell.range.text.removesuffix("\r\a"))
234236
text = " ".join(textList)
235237
if text:
236238
return text

user_docs/en/changes.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
* UIA for XAML and WPF text controls. (#16817, @LeonarddeR)
1818
* IAccessible2 for browsers such as Firefox and Chromium based browsers. (#11545, #16815, @LeonarddeR)
1919
* UIA in Windows Terminal. (#16873, @codeofdusk)
20+
* When accessing Microsoft Word without UI Automation, NVDA no longer outputs garbage characters in braille in table headers defined with the set row and column header commands. (#7212)
2021
* The Seika Notetaker driver now correctly generates braille input for space, backspace and dots with space/backspace gestures. (#16642, @school510587)
2122
* In on-demand speech mode, NVDA does not talk anymore when a message is opened in Outlook, when a new page is loaded in a browser or during the slideshow in PowerPoint. (#16825, @CyrilleB79)
2223

0 commit comments

Comments
 (0)