Don't send font attributes to liblouis when disabled in preferences#8655
Merged
Conversation
…orting of font attributes is disabled in the document formatting preferences.
LeonarddeR
reviewed
Aug 20, 2018
| typeform |= louis.italic | ||
| if field.get("underline", False): | ||
| typeform |= louis.underline | ||
| if formatConfig["reportFontAttributes"]: |
Collaborator
There was a problem hiding this comment.
An early return might result in a much cleaner diff :) I think it also makes the code more readable.
Contributor
Author
There was a problem hiding this comment.
This is true, unless we later want to add other typeforms, e.g. computer_braille or no_contract. Still, I was thinking about an early return and if you think this too I'll push an update.
LeonarddeR
previously approved these changes
Aug 21, 2018
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Link to issue number:
Fixes #7615.
Summary of the issue:
In all cases except IA2, NVDA doesn't fetch font attributes when the corresponding document formatting setting is disabled. For IA2 this information is always fetched as it is part of the text attributes, which are fetched as a whole. Braille sent them straight to liblouis without checking if the user had disabled reporting of font attributes.
Description of how this pull request fixes the issue:
Only send liblouis translation flags for italic, underline and bold if reporting font attributes is enabled.
Testing performed:
Performed the STR outlined in the issue.
Known issues with pull request:
See #7615 (comment)
Change log entry:
Section: Bug fixes