-
-
Notifications
You must be signed in to change notification settings - Fork 631
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
Allow access to Microsoft Word documents via UIAutomation, providing a significant speed improvement, and ability to access documents when in-process injection is impossible. #7849
Conversation
… UIA support, by abstracting existing browseMode table navigation code even further. Specifically: Add a new documentBase module which contains: * TextContainerObject, which is an object that can make a textInfo. It contains a TextInfo class property, as well as makeTextInfo, and selection getter and setter. This is now inherited by NVDAObject and documentTreeInterceptor. * DocumentWithTableNavigation: a TextContainerObject that contains table navigation scripts, implemented by abstraction table code that used to exist in browseMode. Now BrowseModeDocument inherits from this. UIABrowseModeDocument's _getTableCellAt was moved into its own UIADocumentWithTableNavigation class, which UIABrowseModeDocument now inherits from, and so dos the UIA WordDocument NVDAObject class, thus now giving UIA word document support table navigation outside browse mode.
…annotation types, such as for Microsoft Word. UIATextInfo: support reporting of comments. UIATextInfo: support reporting of style name (E.g. Microsoft Word styles) UIATextInfo: report insertion and deletion revisions (Though Edge and MS Word don't seem to implement this yet). UIATextInfo: report linespacing.
…g edit in tables of contents. UIA wordDocumentTextInfo: support page numbers. UIA Word document support: Always at least split by unit format when fetching formatting. Fetching formatting for the entire text chunk may not be good as some annotationTypes such as spelling return valid results for the total range, and therefore do not give the greatest resolution UIA WordDocumentTextInfo: remove som old code that detected annoying editable text nodes which no longer works. UIA word document: report existance of footnotes and endnotes within text. UIA WordDocument: add reportCurrentComment script
…VDAObject. Use UIA with Microsoft word if NVDA connot inject, or NVDA is specifically configured to do so. Choose WordDocument with IAccessible Outlook appModule: grab WordDocument code from IAccessible rather than Window
… current cell from the headers if inappropriately put there by the UIA implementation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you comment on the test plan for this? Knowing what versions / features should be tested would be handy. Then we can ask people to test specific parts.
raise LookupError | ||
UIAGridPattern=None | ||
try: | ||
punk=tableUIAElement.getCurrentPattern(UIAHandler.UIA_GridPatternId) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
punk?
@@ -124,7 +124,7 @@ def findOverlayClasses(self,clsList): | |||
from .akelEdit import AkelEdit as newCls | |||
elif windowClassName=="ConsoleWindowClass": | |||
from .winConsole import WinConsole as newCls | |||
elif windowClassName=="_WwG": | |||
elif False: #windowClassName=="_WwG": |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this block be removed?
source/_UIAHandler.py
Outdated
if windowClass=="_WwG" and not (config.conf['UIA']['useInMSWordWhenAvailable'] or not appModule.helperLocalBindingHandle): | ||
# Microsoft Word should not use UIA unless we can't inject or the user explicitly chose to use UIA with Microsoft word | ||
return False | ||
return res |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The name of this function suggests a boolean return, while this can be implicitly be used as a boolean. I would rather this be changed to return bool(res)
@michaelDCurran commented on 12 dec. 2017 03:20 CET:
May be document some changes for developers, as there has been a massive restructure regarding table navigation? |
As a matter of interest, One assumes that for legacy systems, ie Windows 7
or older versions of word or other apps that may use some of the old code
used for Word, then the old code is used, not the new parts described.
I'm only mentioning this as we don't really want to break stuff that has
worked for ages accidentally.There seems to be enough agro with Outlook and
other office components alredy!
Brian
|
Expected: Actual:
|
… expand to paragraph rather than cell, as not all implementations can support cell (such as UIA). Paragraph is certainly enough info to speak anyway.
@derekriemer blank cells should now announce okay with the tab key. |
Notes for testing this pr:
Reiterating again that the main purpose of this code for now is to provide something when injection is not available (such as in windows 10 S). |
…f announceEntireNewLine class viarable is true. This is false by default, but UIA WordDocument sets this to true for better list bullet reading.
… class at the very end before the base UIA class, so that subclasses of UIA can override methods and properties of EditableTextWithoutAutoSelectDetection (such as for controlling of announcement of new line text).
…ng lists. this ensures compatibility with the older MS Word implementation, and stops confusion when pressing enter for new bullets where NVDA was announcing exiting and then entering a new list.
90e09de
to
31c9019
Compare
from displayModel import EditableTextDisplayModelTextInfo | ||
from NVDAObjects.window import DisplayModelEditableText | ||
from ..behaviors import EditableTextWithoutAutoSelectDetection | ||
from NVDAObjects.window.winword import * | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would a comment here for explanation of what this file is for be worth putting?
elif obj.UIAElement.cachedControlType==UIAHandler.UIA_CustomControlTypeId and obj.name: | ||
# Include foot note and endnote identifiers | ||
field['content']=obj.name | ||
#field['alwaysReportName']=True |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason this is commented?
# To stay compatible with the older MS Word implementation, don't expose lists in word documents as actual lists. This suppresses announcement of entering and exiting them. | ||
# Note that bullets and numbering are still announced of course. | ||
# Eventually we'll want to stop suppressing this, but for now this is more confusing than good (as in many cases announcing of new bullets when pressing enter causes exit and then enter to be spoken). | ||
field['role']=controlTypes.ROLE_EDITABLETEXT | ||
if obj.role==controlTypes.ROLE_GRAPHIC: | ||
# Label graphics with a description before name as name seems to be auto-generated (E.g. "rectangle") | ||
field['value']=field.pop('description',None) or obj.description or field.pop('name',None) or obj.name |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will this break Microsoft's AI generated image descriptions possibly?
try: | ||
UIAElementArray=val.QueryInterface(UIAHandler.IUIAutomationElementArray) | ||
except COMError: | ||
print "not an array" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Debugging code.
@@ -139,7 +140,7 @@ def clearDynamicClassCache(cls): | |||
""" | |||
cls._dynamicClassCache.clear() | |||
|
|||
class NVDAObject(baseObject.ScriptableObject): | |||
class NVDAObject(documentBase.TextContainerObject,baseObject.ScriptableObject): | |||
"""NVDA's representation of a single control/widget. | |||
Every widget, regardless of how it is exposed by an application or the operating system, is represented by a single NVDAObject instance. | |||
This allows NVDA to work with all widgets in a uniform way. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does that change need a docs update?
@@ -312,7 +312,13 @@ def _isUIAWindowHelper(self,hwnd): | |||
if appModule and appModule.isBadUIAWindow(hwnd): | |||
return False | |||
# Ask the window if it supports UIA natively | |||
return windll.UIAutomationCore.UiaHasServerSideProvider(hwnd) | |||
res=windll.UIAutomationCore.UiaHasServerSideProvider(hwnd) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just curious, why is this being changed for this project?
return windll.UIAutomationCore.UiaHasServerSideProvider(hwnd) | ||
res=windll.UIAutomationCore.UiaHasServerSideProvider(hwnd) | ||
if res: | ||
# the window does support UIA natively, but |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That comment isn't a sentence.
import ui | ||
import controlTypes | ||
|
||
class TextContainerObject(AutoPropertyObject): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no docstring here.
source/documentBase.py
Outdated
info.updateSelection() | ||
|
||
class DocumentWithTableNavigation(TextContainerObject,ScriptableObject): | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here.
…currently under annotations like old MS Word).
Hi, For @michaelDCurran: please keep an eye on #7456, as your latest commit fixes it for now. Thanks. |
Hi, Reported by a user (paraphrased): When opening Start menu in Windows 7, an error is recorded. STR:
Expected: no errors. ERROR - eventHandler.executeEvent (21:12:00.062): Thanks. |
@josephsl
Has someone tested this?
This implementation in windows 10 works great
Wysłane z aplikacji Poczta dla Windows 10
Od: Joseph Lee
Wysłano: piątek, 5 stycznia 2018 00:07
Do: nvaccess/nvda
DW: Subscribed
Temat: Re: [nvaccess/nvda] Allow access to Microsoft Word documents viaUIAutomation, providing a significant speed improvement, and ability to accessdocuments when in-process injection is impossible. (#7849)
Hi,
Reported by a user (paraphrased): When opening Start menu in Windows 7, an error is recorded.
STR:
1. From Windows 7, install latest next snapshot.
2. Open Start menu.
Expected: no errors.
Actual:
ERROR - eventHandler.executeEvent (21:12:00.062):
error executing event: gainFocus on <NVDAObjects.Dynamic_EditableTextWithoutAutoSelectDetectionUIA object at 0x05DFBEF0> with extra args of {}
Traceback (most recent call last):
File "eventHandler.pyc", line 152, in executeEvent
File "eventHandler.pyc", line 92, in init
File "eventHandler.pyc", line 100, in next
File "C:\Users\Angelo\AppData\Roaming\nvda\addons\remote\globalPlugins\remoteClient_init_.py", line 410, in event_gainFocus
File "eventHandler.pyc", line 100, in next
File "appModules\explorer.pyc", line 280, in event_gainFocus
File "eventHandler.pyc", line 100, in next
File "NVDAObjects_init_.pyc", line 951, in event_gainFocus
File "NVDAObjects_init_.pyc", line 839, in reportFocus
File "speech.pyc", line 396, in speakObject
File "speech.pyc", line 752, in speakTextInfo
File "NVDAObjects\UIA_init_.pyc", line 621, in getTextWithFields
File "NVDAObjects\UIA_init_.pyc", line 611, in getTextWithFieldsForUIARange
File "NVDAObjects\UIA_init.pyc", line 446, in getTextWithFields_text
File "NVDAObjects\UIA_init.pyc", line 241, in _getFormatFieldAtRange
UnboundLocalError: local variable 'fetchAnnotationTypes' referenced before assignment
Thanks.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Hi, yes, someone is testing this on Windows 7. Thanks.
From: zstanecic [mailto:notifications@github.com]
Sent: Thursday, January 4, 2018 3:23 PM
To: nvaccess/nvda <nvda@noreply.github.com>
Cc: Joseph Lee <joseph.lee22590@gmail.com>; Mention <mention@noreply.github.com>
Subject: Re: [nvaccess/nvda] Allow access to Microsoft Word documents via UIAutomation, providing a significant speed improvement, and ability to access documents when in-process injection is impossible. (#7849)
@josephsl
Has someone tested this?
This implementation in windows 10 works great
Wysłane z aplikacji Poczta dla Windows 10
Od: Joseph Lee
Wysłano: piątek, 5 stycznia 2018 00:07
Do: nvaccess/nvda
DW: Subscribed
Temat: Re: [nvaccess/nvda] Allow access to Microsoft Word documents viaUIAutomation, providing a significant speed improvement, and ability to accessdocuments when in-process injection is impossible. (#7849)
Hi,
Reported by a user (paraphrased): When opening Start menu in Windows 7, an error is recorded.
STR:
1. From Windows 7, install latest next snapshot.
2. Open Start menu.
Expected: no errors.
Actual:
ERROR - eventHandler.executeEvent (21:12:00.062):
error executing event: gainFocus on <NVDAObjects.Dynamic_EditableTextWithoutAutoSelectDetectionUIA object at 0x05DFBEF0> with extra args of {}
Traceback (most recent call last):
File "eventHandler.pyc", line 152, in executeEvent
File "eventHandler.pyc", line 92, in init
File "eventHandler.pyc", line 100, in next
File "C:\Users\Angelo\AppData\Roaming\nvda\addons\remote\globalPlugins\remoteClient_init_.py", line 410, in event_gainFocus
File "eventHandler.pyc", line 100, in next
File "appModules\explorer.pyc", line 280, in event_gainFocus
File "eventHandler.pyc", line 100, in next
File "NVDAObjects_init_.pyc", line 951, in event_gainFocus
File "NVDAObjects_init_.pyc", line 839, in reportFocus
File "speech.pyc", line 396, in speakObject
File "speech.pyc", line 752, in speakTextInfo
File "NVDAObjects\UIA_init_.pyc", line 621, in getTextWithFields
File "NVDAObjects\UIA_init_.pyc", line 611, in getTextWithFieldsForUIARange
File "NVDAObjects\UIA_init.pyc", line 446, in getTextWithFields_text
File "NVDAObjects\UIA_init.pyc", line 241, in _getFormatFieldAtRange
UnboundLocalError: local variable 'fetchAnnotationTypes' referenced before assignment
Thanks.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub <#7849 (comment)> , or mute the thread <https://github.com/notifications/unsubscribe-auth/AHgLkM0iHaUCGLsaIVLteqf4zIOqLa4Qks5tHV02gaJpZM4Q-UoF> .
|
Well, conclusion,
If we will have an opportunity to squash these bugs, we will have fast MS Word experience
Even in the large documents.
The performance with Braille is notably increased, and it’s good to se it.
Wysłane z aplikacji Poczta dla Windows 10
Od: Joseph Lee
Wysłano: piątek, 5 stycznia 2018 00:31
Do: nvaccess/nvda
DW: zstanecic; Comment
Temat: Re: [nvaccess/nvda] Allow access to Microsoft Word documents viaUIAutomation, providing a significant speed improvement, and ability to accessdocuments when in-process injection is impossible. (#7849)
Hi, yes, someone is testing this on Windows 7. Thanks.
From: zstanecic [mailto:notifications@github.com]
Sent: Thursday, January 4, 2018 3:23 PM
To: nvaccess/nvda <nvda@noreply.github.com>
Cc: Joseph Lee <joseph.lee22590@gmail.com>; Mention <mention@noreply.github.com>
Subject: Re: [nvaccess/nvda] Allow access to Microsoft Word documents via UIAutomation, providing a significant speed improvement, and ability to access documents when in-process injection is impossible. (#7849)
@josephsl
Has someone tested this?
This implementation in windows 10 works great
Wysłane z aplikacji Poczta dla Windows 10
Od: Joseph Lee
Wysłano: piątek, 5 stycznia 2018 00:07
Do: nvaccess/nvda
DW: Subscribed
Temat: Re: [nvaccess/nvda] Allow access to Microsoft Word documents viaUIAutomation, providing a significant speed improvement, and ability to accessdocuments when in-process injection is impossible. (#7849)
Hi,
Reported by a user (paraphrased): When opening Start menu in Windows 7, an error is recorded.
STR:
1. From Windows 7, install latest next snapshot.
2. Open Start menu.
Expected: no errors.
Actual:
ERROR - eventHandler.executeEvent (21:12:00.062):
error executing event: gainFocus on <NVDAObjects.Dynamic_EditableTextWithoutAutoSelectDetectionUIA object at 0x05DFBEF0> with extra args of {}
Traceback (most recent call last):
File "eventHandler.pyc", line 152, in executeEvent
File "eventHandler.pyc", line 92, in init
File "eventHandler.pyc", line 100, in next
File "C:\Users\Angelo\AppData\Roaming\nvda\addons\remote\globalPlugins\remoteClient_init_.py", line 410, in event_gainFocus
File "eventHandler.pyc", line 100, in next
File "appModules\explorer.pyc", line 280, in event_gainFocus
File "eventHandler.pyc", line 100, in next
File "NVDAObjects_init_.pyc", line 951, in event_gainFocus
File "NVDAObjects_init_.pyc", line 839, in reportFocus
File "speech.pyc", line 396, in speakObject
File "speech.pyc", line 752, in speakTextInfo
File "NVDAObjects\UIA_init_.pyc", line 621, in getTextWithFields
File "NVDAObjects\UIA_init_.pyc", line 611, in getTextWithFieldsForUIARange
File "NVDAObjects\UIA_init.pyc", line 446, in getTextWithFields_text
File "NVDAObjects\UIA_init.pyc", line 241, in _getFormatFieldAtRange
UnboundLocalError: local variable 'fetchAnnotationTypes' referenced before assignment
Thanks.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub <#7849 (comment)> , or mute the thread <https://github.com/notifications/unsubscribe-auth/AHgLkM0iHaUCGLsaIVLteqf4zIOqLa4Qks5tHV02gaJpZM4Q-UoF> .
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Which is the oldest version of Office now supported. in general at the
moment I see that at least master snaps still work on 2002/3 versions of
Word, though I know the former is not officially supported.
|
Hi,
I think that i found a Bug.
1. Open Microsoft word, opening an existing document.
2. Open elements list with insert +f7
3. From the filter elements radio button, select grammar errors
4. As a result, you will see, that MS word crashes, and elements list leaves opened.
Using latest next,
Windows 10 1709 16299
Installed NVDA
|
Curiously, with:
NVDA last Next
Windows version 10.0.15063 workstation
Word 2013
I can't open the Elements list!
IO - inputCore.InputManager.executeGesture (00:38:01.766):
Input: kb(desktop):NVDA+f7
IO - speech.speak (00:38:05.506):
Speaking [u'Spelling Tool bar']
IO - speech.speak (00:38:05.913):
Speaking [u'Ignore button I']
Do you want me to test something?
Regards,
Rui
Às 21:54 de 05/01/2018, zstanecic escreveu:
… Hi,
I think that i found a Bug.
1. Open Microsoft word, opening an existing document.
2. Open elements list with insert +f7
3. From the filter elements radio button, select grammar errors
4. As a result, you will see, that MS word crashes, and elements list
leaves opened.
Using latest next,
Windows 10 1709 16299
Installed NVDA
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#7849 (comment)>, or
mute the thread
<https://github.com/notifications/unsubscribe-auth/APIHxp2ujY76SuEasXDa7uXsggCgxYP4ks5tHposgaJpZM4Q-UoF>.
|
@ruifontesare you in browse mode?
Wysłane z aplikacji Poczta dla Windows 10
Od: ruifontes
Wysłano: sobota, 6 stycznia 2018 01:46
Do: nvaccess/nvda
DW: zstanecic; Comment
Temat: Re: [nvaccess/nvda] Allow access to Microsoft Word documents viaUIAutomation, providing a significant speed improvement, and ability to accessdocuments when in-process injection is impossible. (#7849)
Curiously, with:
NVDA last Next
Windows version 10.0.15063 workstation
Word 2013
I can't open the Elements list!
IO - inputCore.InputManager.executeGesture (00:38:01.766):
Input: kb(desktop):NVDA+f7
IO - speech.speak (00:38:05.506):
Speaking [u'Spelling Tool bar']
IO - speech.speak (00:38:05.913):
Speaking [u'Ignore button I']
Do you want me to test something?
Regards,
Rui
Às 21:54 de 05/01/2018, zstanecic escreveu:
Hi,
I think that i found a Bug.
1. Open Microsoft word, opening an existing document.
2. Open elements list with insert +f7
3. From the filter elements radio button, select grammar errors
4. As a result, you will see, that MS word crashes, and elements list
leaves opened.
Using latest next,
Windows 10 1709 16299
Installed NVDA
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#7849 (comment)>, or
mute the thread
<https://github.com/notifications/unsubscribe-auth/APIHxp2ujY76SuEasXDa7uXsggCgxYP4ks5tHposgaJpZM4Q-UoF>.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or mute the thread.
|
I found another browse mode bug regarding finding:
It seems that the cursor does move one cursor position to the right, but it does not move to the actual result. |
Sorry for opening a separate call to this discussion. |
…AnnotationTypes variable before any point where it can be used. Specifically: If the IUIAutomationTextRange3 interface was missing, fetchAnnotationTypes was never set. It should be set to False by default.
The issue with find in browse mode is clearly a bug in MS Word's UI automation implementation. If it finds text, it returns the original text range, rather than the position of the found string. There is no way to work around this in NVDA. |
Re grammar errors crash with Elements list: a test word document file would be great. |
and the Windows 7 attributeError in the start menu has been fixed in the last commit to this branch. |
Here is the document in the attachment. A sample one which shows you the crash
And, in the elements list just press left arrow t select errors radio buton, and crach happens, and there we go.
Wysłane z aplikacji Poczta dla Windows 10
Od: Michael Curran
Wysłano: czwartek, 11 stycznia 2018 21:50
Do: nvaccess/nvda
DW: zstanecic; Comment
Temat: Re: [nvaccess/nvda] Allow access to Microsoft Word documents viaUIAutomation, providing a significant speed improvement, and ability to accessdocuments when in-process injection is impossible. (#7849)
Re grammar errors crash with Elements list: a test word document file would be great.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or mute the thread.
|
here is the attachment |
Yes I know. I only posted the other search error out of completeness.
Brian
|
Hi, I activated the this feature. But, I think I found an issue. |
@ferhatbkr: What version of NVDA did you test this? Mouse tracking should work in latest Alpha builds. |
@LeonarddeR I didn't try on alpha version, only on latest stable. |
Hi to all,
I can say, that for me it works perfectly.
From: ferhatbkr <notifications@github.com>
Sent: Sunday, December 30, 2018 1:27 AM
To: nvaccess/nvda <nvda@noreply.github.com>
Cc: zstanecic <zvonimirek222@yandex.com>; Comment <comment@noreply.github.com>
Subject: Re: [nvaccess/nvda] Allow access to Microsoft Word documents via UIAutomation, providing a significant speed improvement, and ability to access documents when in-process injection is impossible. (#7849)
@LeonarddeR <https://github.com/leonardder> I didn't try on alpha version, only on latest stable.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub <#7849 (comment)> , or mute the thread <https://github.com/notifications/unsubscribe-auth/AKohk5fJ6zBOmf-0GjyPNkf8BjpMcnmvks5u-AhGgaJpZM4Q-UoF> . <https://github.com/notifications/beacon/AKohk5CIPrtgevwdlHyKrKbqe5YLELUCks5u-AhGgaJpZM4Q-UoF.gif>
|
A quick note on testing this pr:
To forecefully use UIAAutomation in Microsoft Word when available, set
config.conf['UIA']['useInMSWordWhenAvailable']
to True.You can confirm that NVDA is using UIA as the role for the document will be document, rather than editableText.
Most importantly though, performance should be a lot snappier.
Link to issue number:
None
Summary of the issue:
Speed improvements
NVDA must fetch a lot of data from Microsoft Word when reading content. This results in many many calls to Microsoft Word's object model.
Although NVDA does many of these calls in-process when possible, recently due to both changes in Microsoft Word, and the growing number of calls needed, performance is getting worse.
Unable to inject
In some situations, such as when running NVDA on Windows 10 S as a store app, it is impossible for NVDA to inject into other processes. Therefore, bulk-fetching data in Microsoft Word by injection is not an option. this results in Microsoft word being completely inaccessible on Windows 10 S for NVDA.
Description of how this pull request fixes the issue:
NVDA already had preliminary support for Microsoft Word via UIAutomation as this was the way NVDA was able to access Windows 10 Mail. However, this support was limited and did not make use of all possible features.
This PR does the following:
Abstraction of table navigation scripts
In short, table navigation scripts such as control+alt+rightArrow etc, are now available in Microsoft Word when accessed via UIAutomation.
Ensure browseMode works in Microsoft Word with UIAutomation
Some small fixes to UIATextInfo's constructor where needed so that creating a TextInfo from its root UIA NVDAObject would correctly work.
Report more formatting in UIATextInfo
Further specific Microsoft Word UIA enhansements
Allow UIA Microsoft Word support in various situations
config.conf['UIA']['useInMSWordWhenAvailable']
is True. This is useful for testing the new UIA support.For these changes it was necessary to move some of the older Microsoft Word support into NVDAObjects.IAccessible.winword, and only leave the object model fetching code, and some toggle scripts in NVDAObjects.window.winword.
Note that in order not to break localization gesture bindings for toggle scripts such as control+b (bold) etc, it was important to keep these toggle scripts in NVDAObjects.window.winword.
Testing performed:
config.conf['UIA']['useInMSWordWhenAvailable']
both true and false, in Microsoft Word 2016, and Windows 10 Mail. this needs much wider testing.Known issues with pull request:
Even with these limitations, this is still a far far improvement for situations where injection is unavailable, thus I feel these issues should be addressed in further PRs. this is already a significant patch.
Change log entry:
From the general user's point of view there will not be any change (yet). However, once we start offering NVDA in the Windows store for Windows 10 S, support for Microsoft word will now be possible.
Changes for developers:
documentBase.documentWithTableNavigation
class that can be inherited from to gain standard table navigation scripts. Please refer to this class to see which helper methods must be provided by your implementation for table navigation to work.