NVDA reports the text as a heading but is unable to navigate to it when h is pressed #5186

Closed
nvaccessAuto opened this Issue Jun 27, 2015 · 9 comments

Projects

None yet

3 participants

@nvaccessAuto

Reported by pranavlal on 2015-06-27 06:25
I am attaching a word document to this ticket. When I move the cursor over the text, nvda says heading 1. However, if I use quick navigation, I am told that there are no headings in the document. This happens across versions of Microsoft word namely 2010 and 2013.

@nvaccessAuto

Attachment testDoc.docx added by pranavlal on 2015-06-27 06:27
Description:
test document for formatting issue

@nvaccessAuto

Comment 1 by pranavlal on 2015-06-27 06:28
uploaded file.

@nvaccessAuto

Comment 2 by bhavyashah on 2015-06-27 07:04
Hi,
I can confirm this issue.
I am using NVDA version 2015.2 with Microsoft Office Word 2007.
I haven't tested this attached example document, but, will soon attach another document where I experience this issue as well.
Thanks.

@nvaccessAuto

Comment 3 by briang1 on 2015-06-27 09:06
I can confirm this on even older versions of Word, ie 2002/3 using the conversion system downloaded from Microsoft to change the document into the form the earlier versions of word can use.

I can see its a header level 3 on the last line of the document but the browse mode ignorees it. Could it be due to it being at the last line perhaps?
I'm running this test in XP.

@nvaccessAuto

Comment 4 by bhavyashah on 2015-06-28 16:30
Hi,
The Dropbox link of the sample document where I encounter this issue is https://www.dropbox.com/s/o5r41ymxds6ka9z/living_science_grade_8.docx?dl=0
Sorry for the late response...

@nvaccessAuto

Comment 5 by jteh on 2015-06-29 00:48
This text has an outline level, but Word doesn't consider it to be a heading. The question is what Word does consider to be a heading. We should probably restrict NVDA's reporting of heading so that it matches what Word considers to be a heading.

Technical: I think Word only considers something to be a heading if its style is based on the built-in heading styles. There are constants for the built-in styles; see WdBuiltinStyle Enumeration. The problem is that I don't see a way to get this constant from a Style object. You can keep calling BaseStyle on a style until BuiltIn returns true, but there doesn't seem to be a way to get the WdBuiltinStyle constant for that object.

@michaelDCurran
Contributor

So I don't forget (again)... Technical:

  • It seems impossible to detect the built-in style used for a range of text in Microsoft Word. You can get to the style object, but that does not expose any property reflecting the built-in style constant. There is a nameLocal property, but this is localized for the current language.

Some further notes:

  • range.goto (wdGotoHeading) only locates ranges of text directly using one of the heading built-in style constants (I.e. heading1 through heading9). It does not detect styles based off these heading styles.
  • MS Word 2016's UIA implementation only exposes a UIA heading style for the heading built-in styles, again, not ones that are based off of these styles.

If it were possible to detect the built-in style used for a range of text, we decided that we would only expose heading levels in NVDA for MS Word if the range used one of the heading built-in style constants directly, so as to match goto (used by heading quicknav).

@nvaccessAuto

Incubated in 8352d38.

@michaelDCurran
Contributor

In the end we did end up going with matching on the localized name of builtin heading styles, but by creating a cache of builtin heading style localized names on first use.

@jcsteh jcsteh added this to the 2016.2 milestone May 6, 2016
@jcsteh jcsteh added a commit that closed this issue May 6, 2016
@michaelDCurran @jcsteh michaelDCurran + jcsteh In Microsoft word, NVDA no longer incorrectly reports text with an ou…
…tline level (but not a built-in heading style) as a heading.

NVDAHelper winword support: only expose a paragraph as a heading if the paragraph's style matches one of the builtin heading styles. This keeps heading reporting consistant with heading quicknav (which uses range.goto).
Fixes #5186.
99361d7
@jcsteh jcsteh closed this in 99361d7 May 6, 2016
@nvaccessAuto nvaccessAuto removed the incubating label May 6, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment