Skip to content

Commit 4186c11

Browse files
Merge 79fcfe7 into 91a7c39
2 parents 91a7c39 + 79fcfe7 commit 4186c11

4 files changed

Lines changed: 24 additions & 37 deletions

File tree

source/_UIAHandler.py

Lines changed: 18 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -747,37 +747,25 @@ def _isUIAWindowHelper(self,hwnd):
747747
# Ask the window if it supports UIA natively
748748
res=windll.UIAutomationCore.UiaHasServerSideProvider(hwnd)
749749
if res:
750-
# The window does support UIA natively.
751-
# Detect if we can also inject in-process
752-
canUseOlderInProcessApproach = bool(appModule.helperLocalBindingHandle)
753-
754-
# MS Word documents now have a fairly usable UI Automation implementation.
755-
# However, builds of MS Office 2016 before build 13901 or so had bugs which
750+
# The window does support UIA natively, but MS Word documents now
751+
# have a fairly usable UI Automation implementation.
752+
# However, builds of MS Office 2016 before build 9000 or so had bugs which
756753
# we cannot work around.
757-
# Therefore for less recent versions of Office,
758-
# if we can inject in-process, refuse to use UIA and instead
754+
# And even current builds of Office 2016 are still missing enough info from
755+
# UIA that it is still impossible to switch to UIA completely.
756+
# Therefore, if we can inject in-process, refuse to use UIA and instead
759757
# fall back to the MS Word object model.
760-
if windowClass == "_WwG":
761-
isOfficeApp = appModule.productName.startswith(("Microsoft Office", "Microsoft Outlook"))
762-
if (
763-
(
764-
winVersion.getWinVer() < winVersion.WIN10
765-
or (
766-
# An MS Office app before build 13901
767-
isOfficeApp
768-
and (
769-
tuple(int(x) for x in appModule.productVersion.split('.')[:3])
770-
< (16, 0, 13901)
771-
)
772-
)
773-
)
774-
# Disabling is only useful if we can inject in-process (and use our older code)
775-
and canUseOlderInProcessApproach
776-
# Allow the user to still explicitly force UIA support
777-
# no matter the Office version
778-
and not config.conf['UIA']['useInMSWordWhenAvailable']
779-
):
780-
return False
758+
canUseOlderInProcessApproach = bool(appModule.helperLocalBindingHandle)
759+
if (
760+
# An MS Word document window
761+
windowClass=="_WwG"
762+
# Disabling is only useful if we can inject in-process (and use our older code)
763+
and canUseOlderInProcessApproach
764+
# Allow the user to explicitly force UIA support for MS Word documents
765+
# no matter the Office version
766+
and not config.conf['UIA']['useInMSWordWhenAvailable']
767+
):
768+
return False
781769
# MS Excel spreadsheets now have a fairly usable UI Automation implementation.
782770
# However, builds of MS Office 2016 before build 9000 or so had bugs which we
783771
# cannot work around.
@@ -809,7 +797,7 @@ def _isUIAWindowHelper(self,hwnd):
809797
)
810798
):
811799
return False
812-
elif windowClass == "ConsoleWindowClass":
800+
if windowClass == "ConsoleWindowClass":
813801
return UIAUtils._shouldUseUIAConsole(hwnd)
814802
return bool(res)
815803

source/gui/settingsDialogs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2622,7 +2622,7 @@ def __init__(self, parent):
26222622

26232623
# Translators: This is the label for a checkbox in the
26242624
# Advanced settings panel.
2625-
label = _("Always use UI Automation to access Microsoft &Word document controls when available")
2625+
label = _("Use UI Automation to access Microsoft &Word document controls when available")
26262626
self.UIAInMSWordCheckBox = UIAGroup.addItem(wx.CheckBox(UIABox, label=label))
26272627
self.bindHelpEvent("AdvancedSettingsUseUiaForWord", self.UIAInMSWordCheckBox)
26282628
self.UIAInMSWordCheckBox.SetValue(config.conf["UIA"]["useInMSWordWhenAvailable"])

user_docs/en/changes.t2t

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ Affected users will need to download this update manually.
3939
- When reading status bar with ``NVDA+end``, the review cursor is no longer moved to its location.
4040
If you need this functionality please assign a gesture to the appropriate script in the Object Navigation category in the Input Gestures dialog. (#8600)
4141
- When opening a settings dialog which is already open, NVDA sets focus on the existing dialog rather than raise an error. (#5383)
42-
- For builds of Microsoft Office 2016/365 greater than 13900, NVDA will now always use UI Automation to access Microsoft Word document controls, no matter whether the user has toggled the Use UI Automation to access Microsoft word document controls advanced setting on or off. (#12770)
4342
- Updated liblouis braille translator to [3.19.0 https://github.com/liblouis/liblouis/releases/tag/v3.19.0]. (#12810)
4443
- New braille tables: Russian grade 1, Tshivenda grade 1, Tshivenda grade 2
4544
-

user_docs/en/userGuide.t2t

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1836,12 +1836,12 @@ This has a major negative impact on performance, especially in applications like
18361836
Therefore, when this option is enabled, NVDA will limit event registration to the system focus for most events.
18371837
If you suffer from performance issues in one or more applications, We recommend you to try this functionality to see whether performance improves.
18381838

1839-
==== Always use UI automation to access Microsoft Word document controls when available ====[AdvancedSettingsUseUiaForWord]
1840-
When this option is enabled, NVDA will always try to use the Microsoft UI Automation accessibility API in order to fetch information from Microsoft Word document controls, even for less recent builds of Microsoft Office 2016/365.
1839+
==== Use UI automation to access Microsoft Word document controls when available ====[AdvancedSettingsUseUiaForWord]
1840+
When this option is enabled, NVDA will try to use the Microsoft UI Automation accessibility API in order to fetch information from Microsoft Word document controls.
18411841
This includes Microsoft Word itself, and also the Microsoft Outlook message viewer and composer.
1842-
For Microsoft Office with a build version of 16.0.13901 or greater, NVDA will always use UI Automation to access Microsoft Word documents no matter how this setting is configured.
1843-
For the most recent versions of Microsoft Office 2016/365 running on Windows 10 and later, UI Automation support is complete enough to provide access to Microsoft Word documents almost equal to NVDA's existing Microsoft Word support, with the added advantage that responsiveness is majorly increased.
1844-
However, There may be some information which is either not exposed, or exposed incorrectly in some older builds of Microsoft Office, which means this UI automation support cannot always be relied upon.
1842+
For the most recent versions of Microsoft Office 2016/365 running on Windows 10 and later, UI Automation support is complete enough to provide access to Microsoft Word documents almost equal to NVDA's existing Microsoft Word support, with the added advantage that responsiveness is majorly increased.
1843+
However, There may be some information which is either not exposed, or exposed incorrectly in some versions of Microsoft Office, which means this UI automation support cannot always be relied upon.
1844+
We still do not recommend that the majority of users turn this on by default, though we do welcome users of Office 2016/365 to test this feature and provide feedback.
18451845

18461846
==== Use UI Automation to access the Windows Console when available ====[AdvancedSettingsConsoleUIA]
18471847
When this option is enabled, NVDA will use a new, work in progress version of its support for Windows Console which takes advantage of [accessibility improvements made by Microsoft https://devblogs.microsoft.com/commandline/whats-new-in-windows-console-in-windows-10-fall-creators-update/]. This feature is highly experimental and is still incomplete, so its use is not yet recommended. However, once completed, it is anticipated that this new support will become the default, improving NVDA's performance and stability in Windows command consoles.

0 commit comments

Comments
 (0)