Skip to content
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

NVDA doesn't announce spelling error for words when reading line in LibreOffice Writer #15648

Closed
michaelweghorn opened this issue Oct 18, 2023 · 1 comment · Fixed by #15649
Closed
Labels
app/libreoffice blocked/needs-external-fix p4 https://github.com/nvaccess/nvda/blob/master/projectDocs/issues/triage.md#priority triaged Has been triaged, issue is waiting for implementation.
Milestone

Comments

@michaelweghorn
Copy link
Contributor

Originally reported on the LibreOffice a11y mailing list: https://listarchives.libreoffice.org/global/accessibility/msg01055.html

Corresponding bug report for LibreOffice: https://bugs.documentfoundation.org/show_bug.cgi?id=157696

Steps to reproduce:

  1. make sure to have a dictionary installed in LibreOffice, like https://extensions.libreoffice.org/en/extensions/show/english-dictionaries
  2. start NVDA screen reader
  3. start Writer
  4. type "Hello world, wrrong spelling." for first paragraph
  5. double-check that "wrrong" is visually marked as having a spelling error (red underline)
  6. hit Enter to create a second paragraph
  7. press Up key to move to the first paragraph again

Actual behavior:

NVDA announces the text of the first paragraph without indicating that there is a spelling error in the word "wrrong", just says: "Hello world, wrrong spelling."

Expected behavior:

NVDA should indicate that there is a spelling error in the word "wrrong", as it does when taking the above steps in MS Word instead:
"Hello world, spelling error wrrong spelling."

NVDA logs, crash dumps and other attachments:

n/a

System configuration

NVDA installed/portable/running from source:

installed

NVDA version:

2023.2

Windows version:

Windows 10

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

LibreOffice 7.6.2:

Version: 7.6.2.1 (X86_64) / LibreOffice Community
Build ID: 56f7684011345957bbf33a7ee678afaf4d2ba333
CPU threads: 8; OS: Windows 10.0 Build 19045; UI render: Skia/Raster; VCL: win
Locale: en-US (en_DE); UI: en-GB
Calc: threaded

Other information about your system:

n/a

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.

same behavior with NVDA git master as of 9878248

If NVDA add-ons are disabled, is your problem still occurring?

n/a

Does the issue still occur after you run the COM Registration Fixing Tool in NVDA's tools menu?

n/a

@michaelweghorn
Copy link
Contributor Author

This needs work in both, LibreOffice and NVDA. I'm planning to submit a PR.

michaelweghorn added a commit to michaelweghorn/nvda that referenced this issue Oct 18, 2023
 ### Link to issue number:

Fixes nvaccess#15648

 ### Summary of the issue:

So far, LibreOffice was using custom attribute and value
names for reporting text attributes. Spelling errors were
not reported via any attribute. NVDA was using the presence
of a specific underline as heuristic to detect and report
spelling errors.
This works for some cases, but e.g. does not cause misspelled
words on a line being annonced as such when reading a
line in LibreOffice Writer (issue nvaccess#15648).

 ### Description of user facing changes

Announcement of text attributes also works with
LibreOffice version 24.2 and above.
When announcing a line in LibreOffice Writer, misspelled
words are announced as such with LibreOffice version 24.2
and above.

 ### Description of development approach

Switch LibreOffice from using custom text attribute names
and values to using attributes according to the IAccessible2
text attributes specification
( https://wiki.linuxfoundation.org/accessibility/iaccessible2/textattributes )
instead and implement reporting of the "invalid:spelling;"
attribute for misspelled words:

https://gerrit.libreoffice.org/c/core/+/157804
https://gerrit.libreoffice.org/c/core/+/157845
https://gerrit.libreoffice.org/c/core/+/157867
https://gerrit.libreoffice.org/c/core/+/157939
https://gerrit.libreoffice.org/c/core/+/158088
https://gerrit.libreoffice.org/c/core/+/158089
https://gerrit.libreoffice.org/c/core/+/158090

These changes are contained in LibreOffice >= 24.2.

Adapt NVDA to evaluate those text attributes by
using the already existing implementation from
the `IA2TextTextInfo` base class in
`SymphonyTextInfo._getFormatFieldAndOffsets`.

For backwards-compatibility with LibreOffice
versions <= 7.6, keep support for the legacy
attributes and move the handling for that into
a new helper method
`SymphonyTextInfo_getFormatFieldFromLegacyAttributesString`.

For the case where the legacy attributes are used,
the text attribute string starts with "Version:1;"
(s. the LibreOffice code dropped in
https://gerrit.libreoffice.org/c/core/+/158090 ),
so use that as a criterion what code path to take.

Address some of the pre-existing lint issues, but silence
the C901 ones
("'SymphonyTextInfo._getFormatFieldFromLegacyAttributesString' is too complex (27)",
same for "_SymphonyTextInfo._getFormatFieldAndOffsets").
Each one of them is at least already less complex than the single
one was before, now that it has been split into two methods.
The easiest way to simplify that further is to drop the
legacy handling once support for LibreOffice <= 7.6 is no more
a concern.

 ### Testing strategy:

Test that incorrect spelling in the middle of a line in LibreOffice
Writer gets announced when testing the scenario described in
issue nvaccess#15648 with both, the LibreOffice and the NVDA changes
in place.

Test that the character attributes from the sample document
attached to
https://bugs.documentfoundation.org/show_bug.cgi?id=157696
works with these changes in NVDA in place, and *both*,

* a current LibreOffice development version containing
  the above-mentioned LibreOffice changes
* LibreOffice 7.6.2 which does not contain the above-mentioned
  changes and therefore triggers the "legacy" code path.

 ### Known issues with pull request:

Requires the above-mentioned LibreOffice changes in addition
to actually make the scenario described in issue nvaccess#15648
work.

 ### Code Review Checklist:

- [x] Documentation:
  - Change log entry
  - User Documentation
  - Developer / Technical Documentation
  - Context sensitive help for GUI changes
- [x] Testing:
  - Unit tests
  - System (end to end) tests
  - Manual testing
- [x] UX of all users considered:
  - Speech
  - Braille
  - Low Vision
  - Different web browsers
  - Localization in other languages / culture than English
- [x] API is compatible with existing add-ons.
- [x] Security precautions taken.
@seanbudd seanbudd added blocked/needs-external-fix p4 https://github.com/nvaccess/nvda/blob/master/projectDocs/issues/triage.md#priority app/libreoffice triaged Has been triaged, issue is waiting for implementation. labels Oct 18, 2023
michaelweghorn added a commit to michaelweghorn/nvda that referenced this issue Oct 19, 2023
 ### Link to issue number:

Fixes nvaccess#15648

 ### Summary of the issue:

So far, LibreOffice was using custom attribute and value
names for reporting text attributes. Spelling errors were
not reported via any attribute. NVDA was using the presence
of a specific underline as heuristic to detect and report
spelling errors.
This works for some cases, but e.g. does not cause misspelled
words on a line being annonced as such when reading a
line in LibreOffice Writer (issue nvaccess#15648).

 ### Description of user facing changes

Announcement of text attributes also works with
LibreOffice version 24.2 and above.
When announcing a line in LibreOffice Writer, misspelled
words are announced as such with LibreOffice version 24.2
and above.

 ### Description of development approach

Switch LibreOffice from using custom text attribute names
and values to using attributes according to the IAccessible2
text attributes specification
( https://wiki.linuxfoundation.org/accessibility/iaccessible2/textattributes )
instead and implement reporting of the "invalid:spelling;"
attribute for misspelled words:

https://gerrit.libreoffice.org/c/core/+/157804
https://gerrit.libreoffice.org/c/core/+/157845
https://gerrit.libreoffice.org/c/core/+/157867
https://gerrit.libreoffice.org/c/core/+/157939
https://gerrit.libreoffice.org/c/core/+/158088
https://gerrit.libreoffice.org/c/core/+/158089
https://gerrit.libreoffice.org/c/core/+/158090

These changes are contained in LibreOffice >= 24.2.

Adapt NVDA to evaluate those text attributes by
using the already existing implementation from
the `IA2TextTextInfo` base class in
`SymphonyTextInfo._getFormatFieldAndOffsets`.

For backwards-compatibility with LibreOffice
versions <= 7.6, keep support for the legacy
attributes and move the handling for that into
a new helper method
`SymphonyTextInfo_getFormatFieldFromLegacyAttributesString`.

For the case where the legacy attributes are used,
the text attribute string starts with "Version:1;"
(s. the LibreOffice code dropped in
https://gerrit.libreoffice.org/c/core/+/158090 ),
so use that as a criterion what code path to take.

Address some of the pre-existing lint issues, but silence
the C901 ones
("'SymphonyTextInfo._getFormatFieldFromLegacyAttributesString' is too complex (27)",
same for "_SymphonyTextInfo._getFormatFieldAndOffsets").
Each one of them is at least already less complex than the single
one was before, now that it has been split into two methods.
The easiest way to simplify that further is to drop the
legacy handling once support for LibreOffice <= 7.6 is no more
a concern.

 ### Testing strategy:

Test that incorrect spelling in the middle of a line in LibreOffice
Writer gets announced when testing the scenario described in
issue nvaccess#15648 with both, the LibreOffice and the NVDA changes
in place.

Test that the character attributes from the sample document
attached to
https://bugs.documentfoundation.org/show_bug.cgi?id=157696
works with these changes in NVDA in place, and *both*,

* a current LibreOffice development version containing
  the above-mentioned LibreOffice changes
* LibreOffice 7.6.2 which does not contain the above-mentioned
  changes and therefore triggers the "legacy" code path.

 ### Known issues with pull request:

Requires the above-mentioned LibreOffice changes in addition
to actually make the scenario described in issue nvaccess#15648
work.

 ### Code Review Checklist:

- [x] Documentation:
  - Change log entry
  - User Documentation
  - Developer / Technical Documentation
  - Context sensitive help for GUI changes
- [x] Testing:
  - Unit tests
  - System (end to end) tests
  - Manual testing
- [x] UX of all users considered:
  - Speech
  - Braille
  - Low Vision
  - Different web browsers
  - Localization in other languages / culture than English
- [x] API is compatible with existing add-ons.
- [x] Security precautions taken.
michaelweghorn added a commit to michaelweghorn/nvda that referenced this issue Oct 19, 2023
 ### Link to issue number:

Fixes nvaccess#15648

 ### Summary of the issue:

So far, LibreOffice was using custom attribute and value
names for reporting text attributes. Spelling errors were
not reported via any attribute. NVDA was using the presence
of a specific underline as heuristic to detect and report
spelling errors.
This works for some cases, but e.g. does not cause misspelled
words on a line being annonced as such when reading a
line in LibreOffice Writer (issue nvaccess#15648).

 ### Description of user facing changes

Announcement of text attributes also works with
LibreOffice version 24.2 and above.
When announcing a line in LibreOffice Writer, misspelled
words are announced as such with LibreOffice version 24.2
and above.

 ### Description of development approach

Switch LibreOffice from using custom text attribute names
and values to using attributes according to the IAccessible2
text attributes specification
( https://wiki.linuxfoundation.org/accessibility/iaccessible2/textattributes )
instead and implement reporting of the "invalid:spelling;"
attribute for misspelled words:

https://gerrit.libreoffice.org/c/core/+/157804
https://gerrit.libreoffice.org/c/core/+/157845
https://gerrit.libreoffice.org/c/core/+/157867
https://gerrit.libreoffice.org/c/core/+/157939
https://gerrit.libreoffice.org/c/core/+/158088
https://gerrit.libreoffice.org/c/core/+/158089
https://gerrit.libreoffice.org/c/core/+/158090

These changes are contained in LibreOffice >= 24.2.

Adapt NVDA to evaluate those text attributes by
using the already existing implementation from
the `IA2TextTextInfo` base class in
`SymphonyTextInfo._getFormatFieldAndOffsets`.

For backwards-compatibility with LibreOffice
versions <= 7.6, keep support for the legacy
attributes and move the handling for that into
a new helper method
`SymphonyTextInfo_getFormatFieldFromLegacyAttributesString`.

For the case where the legacy attributes are used,
the text attribute string starts with "Version:1;"
(s. the LibreOffice code dropped in
https://gerrit.libreoffice.org/c/core/+/158090 ),
so use that as a criterion what code path to take.

Address some of the pre-existing lint issues, but silence
the C901 ones
("'SymphonyTextInfo._getFormatFieldFromLegacyAttributesString' is too complex (27)",
same for "_SymphonyTextInfo._getFormatFieldAndOffsets").
Each one of them is at least already less complex than the single
one was before, now that it has been split into two methods.
The easiest way to simplify that further is to drop the
legacy handling once support for LibreOffice <= 7.6 is no more
a concern.

 ### Testing strategy:

Test that incorrect spelling in the middle of a line in LibreOffice
Writer gets announced when testing the scenario described in
issue nvaccess#15648 with both, the LibreOffice and the NVDA changes
in place.

Test that the character attributes from the sample document
attached to
https://bugs.documentfoundation.org/show_bug.cgi?id=157696
works with these changes in NVDA in place, and *both*,

* a current LibreOffice development version containing
  the above-mentioned LibreOffice changes
* LibreOffice 7.6.2 which does not contain the above-mentioned
  changes and therefore triggers the "legacy" code path.

 ### Known issues with pull request:

Requires the above-mentioned LibreOffice changes in addition
to actually make the scenario described in issue nvaccess#15648
work.

 ### Code Review Checklist:

- [x] Documentation:
  - Change log entry
  - User Documentation
  - Developer / Technical Documentation
  - Context sensitive help for GUI changes
- [x] Testing:
  - Unit tests
  - System (end to end) tests
  - Manual testing
- [x] UX of all users considered:
  - Speech
  - Braille
  - Low Vision
  - Different web browsers
  - Localization in other languages / culture than English
- [x] API is compatible with existing add-ons.
- [x] Security precautions taken.
michaelweghorn added a commit to michaelweghorn/nvda that referenced this issue Oct 19, 2023
 ### Link to issue number:

Fixes nvaccess#15648

 ### Summary of the issue:

So far, LibreOffice was using custom attribute and value
names for reporting text attributes. Spelling errors were
not reported via any attribute. NVDA was using the presence
of a specific underline as heuristic to detect and report
spelling errors.
This works for some cases, but e.g. does not cause misspelled
words on a line being annonced as such when reading a
line in LibreOffice Writer (issue nvaccess#15648).

 ### Description of user facing changes

Announcement of text attributes also works with
LibreOffice version 24.2 and above.
When announcing a line in LibreOffice Writer, misspelled
words are announced as such with LibreOffice version 24.2
and above.

 ### Description of development approach

Switch LibreOffice from using custom text attribute names
and values to using attributes according to the IAccessible2
text attributes specification
( https://wiki.linuxfoundation.org/accessibility/iaccessible2/textattributes )
instead and implement reporting of the "invalid:spelling;"
attribute for misspelled words:

https://gerrit.libreoffice.org/c/core/+/157804
https://gerrit.libreoffice.org/c/core/+/157845
https://gerrit.libreoffice.org/c/core/+/157867
https://gerrit.libreoffice.org/c/core/+/157939
https://gerrit.libreoffice.org/c/core/+/158088
https://gerrit.libreoffice.org/c/core/+/158089
https://gerrit.libreoffice.org/c/core/+/158090

These changes are contained in LibreOffice >= 24.2.

Adapt NVDA to evaluate those text attributes by
using the already existing implementation from
the `IA2TextTextInfo` base class in
`SymphonyTextInfo._getFormatFieldAndOffsets`.

For backwards-compatibility with LibreOffice
versions <= 7.6, keep support for the legacy
attributes and move the handling for that into
a new helper method
`SymphonyTextInfo_getFormatFieldFromLegacyAttributesString`.

For the case where the legacy attributes are used,
the text attribute string starts with "Version:1;"
(s. the LibreOffice code dropped in
https://gerrit.libreoffice.org/c/core/+/158090 ),
so use that as a criterion what code path to take.

Address some of the pre-existing lint issues, but silence
the C901 ones
("'SymphonyTextInfo._getFormatFieldFromLegacyAttributesString' is too complex (27)",
same for "_SymphonyTextInfo._getFormatFieldAndOffsets").
Each one of them is at least already less complex than the single
one was before, now that it has been split into two methods.

 ### Testing strategy:

Test that incorrect spelling in the middle of a line in LibreOffice
Writer gets announced when testing the scenario described in
issue nvaccess#15648 with both, the LibreOffice and the NVDA changes
in place.

Test that the character attributes from the sample document
attached to
https://bugs.documentfoundation.org/show_bug.cgi?id=157696
works with these changes in NVDA in place, and *both*,

* a current LibreOffice development version containing
  the above-mentioned LibreOffice changes
* LibreOffice 7.6.2 which does not contain the above-mentioned
  changes and therefore triggers the "legacy" code path.

 ### Known issues with pull request:

Requires the above-mentioned LibreOffice changes in addition
to actually make the scenario described in issue nvaccess#15648
work.

 ### Code Review Checklist:

- [x] Documentation:
  - Change log entry
  - User Documentation
  - Developer / Technical Documentation
  - Context sensitive help for GUI changes
- [x] Testing:
  - Unit tests
  - System (end to end) tests
  - Manual testing
- [x] UX of all users considered:
  - Speech
  - Braille
  - Low Vision
  - Different web browsers
  - Localization in other languages / culture than English
- [x] API is compatible with existing add-ons.
- [x] Security precautions taken.
michaelweghorn added a commit to michaelweghorn/nvda that referenced this issue Oct 20, 2023
 ### Link to issue number:

Fixes nvaccess#15648

 ### Summary of the issue:

So far, LibreOffice was using custom attribute and value
names for reporting text attributes. Spelling errors were
not reported via any attribute. NVDA was using the presence
of a specific underline as heuristic to detect and report
spelling errors.
This works for some cases, but e.g. does not cause misspelled
words on a line being annonced as such when reading a
line in LibreOffice Writer (issue nvaccess#15648).

 ### Description of user facing changes

Announcement of text attributes also works with
LibreOffice version 24.2 and above.
When announcing a line in LibreOffice Writer, misspelled
words are announced as such with LibreOffice version 24.2
and above.

 ### Description of development approach

Switch LibreOffice from using custom text attribute names
and values to using attributes according to the IAccessible2
text attributes specification
( https://wiki.linuxfoundation.org/accessibility/iaccessible2/textattributes )
instead and implement reporting of the "invalid:spelling;"
attribute for misspelled words:

https://gerrit.libreoffice.org/c/core/+/157804
https://gerrit.libreoffice.org/c/core/+/157845
https://gerrit.libreoffice.org/c/core/+/157867
https://gerrit.libreoffice.org/c/core/+/157939
https://gerrit.libreoffice.org/c/core/+/158088
https://gerrit.libreoffice.org/c/core/+/158089
https://gerrit.libreoffice.org/c/core/+/158090

These changes are contained in LibreOffice >= 24.2.

Adapt NVDA to evaluate those text attributes by
using the already existing implementation from
the `IA2TextTextInfo` base class in
`SymphonyTextInfo._getFormatFieldAndOffsets`.

For backwards-compatibility with LibreOffice
versions <= 7.6, keep support for the legacy
attributes and move the handling for that into
a new helper method
`SymphonyTextInfo_getFormatFieldFromLegacyAttributesString`.

For the case where the legacy attributes are used,
the text attribute string starts with "Version:1;"
(s. the LibreOffice code dropped in
https://gerrit.libreoffice.org/c/core/+/158090 ),
so use that as a criterion what code path to take.

Extract another helper method and address some of the
pre-existing lint issues, but silence
the C901 one for the method that was extracted to handle
the legacy attributes
("'SymphonyTextInfo._getFormatFieldFromLegacyAttributesString' is
too complex (27)").
It's at least already less complex than the single
one was before.

 ### Testing strategy:

Test that incorrect spelling in the middle of a line in LibreOffice
Writer gets announced when testing the scenario described in
issue nvaccess#15648 with both, the LibreOffice and the NVDA changes
in place.

Test that the character attributes from the sample document
attached to
https://bugs.documentfoundation.org/show_bug.cgi?id=157696
works with these changes in NVDA in place, and *both*,

* a current LibreOffice development version containing
  the above-mentioned LibreOffice changes
* LibreOffice 7.6.2 which does not contain the above-mentioned
  changes and therefore triggers the "legacy" code path.

 ### Known issues with pull request:

Requires the above-mentioned LibreOffice changes in addition
to actually make the scenario described in issue nvaccess#15648
work.

 ### Code Review Checklist:

- [x] Documentation:
  - Change log entry
  - User Documentation
  - Developer / Technical Documentation
  - Context sensitive help for GUI changes
- [x] Testing:
  - Unit tests
  - System (end to end) tests
  - Manual testing
- [x] UX of all users considered:
  - Speech
  - Braille
  - Low Vision
  - Different web browsers
  - Localization in other languages / culture than English
- [x] API is compatible with existing add-ons.
- [x] Security precautions taken.

Extrtact another helper method

Tweak whitespace

Do what's still necessary

Mention AOO

Fix typos

Add comment as suggested

Tweak comment, fix var name
michaelweghorn added a commit to michaelweghorn/nvda that referenced this issue Oct 20, 2023
 ### Link to issue number:

Fixes nvaccess#15648

 ### Summary of the issue:

So far, LibreOffice was using custom attribute and value
names for reporting text attributes. Spelling errors were
not reported via any attribute. NVDA was using the presence
of a specific underline as heuristic to detect and report
spelling errors.
This works for some cases, but e.g. does not cause misspelled
words on a line being annonced as such when reading a
line in LibreOffice Writer (issue nvaccess#15648).

 ### Description of user facing changes

Announcement of text attributes also works with
LibreOffice version 24.2 and above.
When announcing a line in LibreOffice Writer, misspelled
words are announced as such with LibreOffice version 24.2
and above.

 ### Description of development approach

Switch LibreOffice from using custom text attribute names
and values to using attributes according to the IAccessible2
text attributes specification
( https://wiki.linuxfoundation.org/accessibility/iaccessible2/textattributes )
instead and implement reporting of the "invalid:spelling;"
attribute for misspelled words:

https://gerrit.libreoffice.org/c/core/+/157804
https://gerrit.libreoffice.org/c/core/+/157845
https://gerrit.libreoffice.org/c/core/+/157867
https://gerrit.libreoffice.org/c/core/+/157939
https://gerrit.libreoffice.org/c/core/+/158088
https://gerrit.libreoffice.org/c/core/+/158089
https://gerrit.libreoffice.org/c/core/+/158090

These changes are contained in LibreOffice >= 24.2.

Adapt NVDA to evaluate those text attributes by
using the already existing implementation from
the `IA2TextTextInfo` base class in
`SymphonyTextInfo._getFormatFieldAndOffsets`.

For backwards-compatibility with LibreOffice
versions <= 7.6, keep support for the legacy
attributes and move the handling for that into
a new helper method
`SymphonyTextInfo_getFormatFieldFromLegacyAttributesString`.

For the case where the legacy attributes are used,
the text attribute string starts with "Version:1;"
(s. the LibreOffice code dropped in
https://gerrit.libreoffice.org/c/core/+/158090 ),
so use that as a criterion what code path to take.

Extract another helper method and address some of the
pre-existing lint issues, but silence
the C901 one for the method that was extracted to handle
the legacy attributes
("'SymphonyTextInfo._getFormatFieldFromLegacyAttributesString' is
too complex (27)").
It's at least already less complex than the single
one was before.

 ### Testing strategy:

Test that incorrect spelling in the middle of a line in LibreOffice
Writer gets announced when testing the scenario described in
issue nvaccess#15648 with both, the LibreOffice and the NVDA changes
in place.

Test that the character attributes from the sample document
attached to
https://bugs.documentfoundation.org/show_bug.cgi?id=157696
works with these changes in NVDA in place, and *both*,

* a current LibreOffice development version containing
  the above-mentioned LibreOffice changes
* LibreOffice 7.6.2 which does not contain the above-mentioned
  changes and therefore triggers the "legacy" code path.

 ### Known issues with pull request:

Requires the above-mentioned LibreOffice changes in addition
to actually make the scenario described in issue nvaccess#15648
work.

 ### Code Review Checklist:

- [x] Documentation:
  - Change log entry
  - User Documentation
  - Developer / Technical Documentation
  - Context sensitive help for GUI changes
- [x] Testing:
  - Unit tests
  - System (end to end) tests
  - Manual testing
- [x] UX of all users considered:
  - Speech
  - Braille
  - Low Vision
  - Different web browsers
  - Localization in other languages / culture than English
- [x] API is compatible with existing add-ons.
- [x] Security precautions taken.
seanbudd pushed a commit that referenced this issue Oct 23, 2023
Fixes #15648

Summary of the issue:
So far, LibreOffice was using custom attribute and value
names for reporting text attributes. Spelling errors were
not reported via any attribute. NVDA was using the presence
of a specific underline as heuristic to detect and report
spelling errors.
This works for some cases, but e.g. does not cause misspelled
words on a line being annonced as such when reading a
line in LibreOffice Writer (issue #15648).

Description of user facing changes
Announcement of text attributes also works with
LibreOffice version 24.2 and above.
When announcing a line in LibreOffice Writer, misspelled
words are announced as such with LibreOffice version 24.2
and above.

Description of development approach
Switch LibreOffice from using custom text attribute names
and values to using attributes according to the IAccessible2
text attributes specification
( https://wiki.linuxfoundation.org/accessibility/iaccessible2/textattributes )
instead and implement reporting of the "invalid:spelling;"
attribute for misspelled words:

https://gerrit.libreoffice.org/c/core/+/157804
https://gerrit.libreoffice.org/c/core/+/157845
https://gerrit.libreoffice.org/c/core/+/157867
https://gerrit.libreoffice.org/c/core/+/157939
https://gerrit.libreoffice.org/c/core/+/158088
https://gerrit.libreoffice.org/c/core/+/158089
https://gerrit.libreoffice.org/c/core/+/158090

These changes are contained in LibreOffice >= 24.2.

Adapt NVDA to evaluate those text attributes by
using the already existing implementation from
the IA2TextTextInfo base class in
SymphonyTextInfo._getFormatFieldAndOffsets.

For backwards-compatibility with LibreOffice
versions <= 7.6, keep support for the legacy
attributes and move the handling for that into
a new helper method
SymphonyTextInfo_getFormatFieldFromLegacyAttributesString.

For the case where the legacy attributes are used,
the text attribute string starts with "Version:1;"
(s. the LibreOffice code dropped in
https://gerrit.libreoffice.org/c/core/+/158090 ),
so use that as a criterion what code path to take.

Extract another helper method and address some of the
pre-existing lint issues, but silence
the C901 one for the method that was extracted to handle
the legacy attributes
("'SymphonyTextInfo._getFormatFieldFromLegacyAttributesString' is
too complex (27)").
It's at least already less complex than the single
one was before.
@nvaccessAuto nvaccessAuto added this to the 2024.1 milestone Oct 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
app/libreoffice blocked/needs-external-fix p4 https://github.com/nvaccess/nvda/blob/master/projectDocs/issues/triage.md#priority triaged Has been triaged, issue is waiting for implementation.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants