nvda icon indicating copy to clipboard operation
nvda copied to clipboard

Formatting in Word: style is not properly reported in some cases with UIA enabled

Open aaclause opened this issue 3 years ago • 10 comments

Steps to reproduce:

Several ways to reproduce this, here's one:

  1. Open Microsoft Word, create a new document.
  2. Write an URL (e.g. https://google.com) then press enter.
  3. Move the cursor on the last character of the previous line (i.e. m).
  4. Press NVDA+f.

Actual behavior:

Something like "style <POINTER(IUnknown) ptr=0x5d9bbd24 at 52462b0>" is reported.

Expected behavior:

The correct style should be reported (in this case 'Normal').

System configuration

NVDA installed/portable/running from source:

Installed

NVDA version:

alpha-20601,3a9484fb

Windows version:

10 Insider (64-bit) build 20175.1000

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

Microsoft Office Word 16.0.13001.20384

Other information about your system:

UIA enabled

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.

Not tested

If addons are disabled, is your problem still occuring?

Yes

Did you try to run the COM registry fixing tool in NVDA menu / tools?

Yes

aaclause avatar Jul 27 '20 06:07 aaclause

@Andre9642 this issue does not occur if UIA Support in Word is disabled. Is this correct?

Adriani90 avatar Jul 27 '20 21:07 Adriani90

@Adriani90 Yes, absolutely.

aaclause avatar Jul 27 '20 21:07 aaclause

Also NVDA doesn't read any line or para info for me when UIA is enabled. Works as expected without UIA.

ainekc avatar Mar 24 '21 08:03 ainekc

Technical: When an IUIAutomationTextRange spans the last character of a link, GetAttributeValue given UIA_StyleNameAttributeId returns a ReservedMixedAttributeValue object rather than the name of the style E.g. 'Normal'. This is true even if the style of the link is identical to the style after the link. This seems to be a bug in Microsoft Word. At most we could not include style if its value is MixedAttributeValue, or we can report "Unknown" or "Mixed". But that is as far as we can go in NVDA. @aaclause which do you think would be the best approach until this is addressed in MS word?

michaelDCurran avatar Aug 16 '21 07:08 michaelDCurran

@michaelDCurran In this case, I would prefer not to include the style since it is unknown. "mixed" seems vague to me.

Out of curiosity I tested with JAWS (version 2021.2107.12, UIA in Word enabled), here are the results:

My original line (link): https://google.com/

From position 1 to -1 ("ttps://google.com/"), we get:

Insertion point formatting Single underline 11 point DodgerBlue3 on Blanc Calibri Lien hypertexte style

Line spacing: 1 lines.

Paragraph formatting: Aligned left

Outline level: body text

At position 0 ('h'):

Insertion point formatting 11 point DodgerBlue3 on Blanc Calibri Normal style

Line spacing: 1 lines.

Paragraph formatting: Aligned left

Outline level: body text

For the reference, with NVDA we get:

From position 0 to -2 ("https://google.com"):

style Normal Calibri 11 pt aqua-blue on white underlined baseline align left line spacing 1,08 multiple

At position -1 ('/'):

style <POINTER(IUnknown) ptr=0x6e0e7cdc at bab22b0> Calibri 11 pt white background underlined baseline align left line spacing 1,08 multiple

aaclause avatar Aug 17 '21 12:08 aaclause

Note that also the foreground color is not available for this last character of the link. But on the contrary to style, the information is just omitted.

CyrilleB79 avatar Oct 06 '21 14:10 CyrilleB79

@michaelDCurran versions of this can still be replicated in Word (365 and 2019, at least), as recently asked about on an NVDA users list.

I can replicate it with UIA on, entering/pasting a link, and navigating back up to the line with the link on it. style <POINTER(IUnknown) ptr=0x6e7c6cb4 at 51e2710>

UIA off reports this as style hyperlink.

If the only options are what you describe above, then my vote is for style mixed.

Unknown is untrue, since in non-UIA mode it is knowable.

XLTechie avatar Apr 29 '22 20:04 XLTechie

I have reported the problem to Microsoft accessibility help desk, and have also attached the link of this thread to the supporting staff.

LittleStar-VIP avatar Apr 30 '22 02:04 LittleStar-VIP

Happy for a PR to improve the UX of the failure, reporting "unknown" rather than the object string would be better. This would only be until the issue can be fixed in MS word.

feerrenrut avatar Sep 08 '22 06:09 feerrenrut

@feerrenrut In that case, how about omitting the style information? For instance, when alignment info is not available nothing is reported

aaclause avatar Sep 12 '22 06:09 aaclause