Skip to content

Fix up of #11969: correct logic for heading levels in getFormatfieldSpeech#12026

Merged
michaelDCurran merged 1 commit into
masterfrom
fix_11969_headingLevel
Feb 3, 2021
Merged

Fix up of #11969: correct logic for heading levels in getFormatfieldSpeech#12026
michaelDCurran merged 1 commit into
masterfrom
fix_11969_headingLevel

Conversation

@michaelDCurran

Copy link
Copy Markdown
Member

Link to issue number:

None.

Summary of the issue:

In pr #11969 REASON_* constants were replaced with OutputReason.* enum constants.
However, a logic error was introduced in speech.getFormatFieldSpeech which caused NVDA to no longer be able to read content in edgeHTML (Edge classic) documents. Causing the following exception:

File "speech\__init__.py", line 2033, in getFormatFieldSpeech
    text=_("heading level %d")%headingLevel
TypeError: %d format: a number is required, not NoneType

This is due to the

headingLevel != oldHeadingLevel

being moved out of its original brackets and into a new set of outer brackets.

Description of how this pull request fixes the issue:

Moves the code back into the original place, maintaining linting rules.

Testing performed:

Did a search in the start screen, and arrowed down into the extra content (which is an Edge classic document). Previusly this caused an exception. Now all the content reads again.

Known issues with pull request:

None.

Change log entry:

None.

@michaelDCurran

Copy link
Copy Markdown
Member Author

@lukaszgo1

@lukaszgo1 lukaszgo1 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks fine to me.

@michaelDCurran michaelDCurran merged commit 376780f into master Feb 3, 2021
@michaelDCurran michaelDCurran deleted the fix_11969_headingLevel branch February 3, 2021 00:25
@nvaccessAuto nvaccessAuto added this to the 2021.1 milestone Feb 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants