Skip to content

IAccessible2: Evaluate "text-indent" attr for first line indent#17638

Merged
seanbudd merged 2 commits into
nvaccess:masterfrom
michaelweghorn:michaelweghorn/nvda13052_first_line_indent
Jan 23, 2025
Merged

IAccessible2: Evaluate "text-indent" attr for first line indent#17638
seanbudd merged 2 commits into
nvaccess:masterfrom
michaelweghorn:michaelweghorn/nvda13052_first_line_indent

Conversation

@michaelweghorn

Copy link
Copy Markdown
Contributor

Link to issue number:

Fixes #13052

Summary of the issue:

NVDA did not announce the first line indent for paragraphs in LibreOffice Writer.

Description of user facing changes

NVDA supports the "text-indent" IAccessible2 object attribute. As a consequence, announcement of first line indent is now supported for LibreOffice 25.8 and later.

Description of development approach

Implement support for the "text-indent" object attribute as specified in the
IAccessible2 object attribute specification, which references the CSS spec that explains:

This property specifies the indentation of the first line
of text in a block container.

https://gerrit.libreoffice.org/c/core/+/180574 implements support in LibreOffice, i.e. reporting of that attribute by LibreOffice.

This commit implements evaluation of that IAccessible2 object attribute by NVDA.

As recommended in the IAccessible2 object attribute spec, LibreOffice reports the indentation in mm. Add a helper method that converts that to either cm or inches, depending on whether use of imperial measurements is enabled.

Testing strategy:

  1. start NVDA
  2. open sample document https://bugs.documentfoundation.org/attachment.cgi?id=198672 in LibreOffice Writer (current development version also including above-mentioned LibreOffice change)
  3. move focus to the second paragraph that has a first line indentation of 1 cm set
  4. request announcement of text formatting by pressing NVDA+F
  5. Make sure that what NVDA says includes the first line indent ("first line indent 1.00 centimetre")

Known issues with pull request:

None

Code Review Checklist:

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

@coderabbitai summary

 ### Link to issue number:

Fixes nvaccess#13052

 ### Summary of the issue:

NVDA did not announce the first line indent for paragraphs
in LibreOffice Writer.

 ### Description of user facing changes

NVDA supports the "text-indent" IAccessible2 object attribute. As a
consequence, announcement of first line indent is now supported for
LibreOffice 25.8 and later.

 ### Description of development approach

Implement support for the "text-indent" object attribute as
specified in the
[IAccessible2 object attribute specification](https://github.com/LinuxA11y/IAccessible2/blob/master/spec/objectattributes.md),
which references the [CSS spec](https://www.w3.org/TR/CSS2/text.html#propdef-text-indent)
that explains:

> This property specifies the indentation of the first line
> of text in a block container.

https://gerrit.libreoffice.org/c/core/+/180574 implements
support in LibreOffice, i.e. reporting of that attribute by
LibreOffice.

This commit implements evaluation of that IAccessible2
object attribute by NVDA.

As recommended in the IAccessible2 object attribute spec,
LibreOffice reports the indentation in mm. Add a helper
method that converts that to either cm or inches, depending
on whether use of imperial measurements is enabled.

 ### Testing strategy:

1. start NVDA
2. open sample document https://bugs.documentfoundation.org/attachment.cgi?id=198672
   in LibreOffice Writer (current development version also
   including above-mentioned LibreOffice change)
3. move focus to the second paragraph that has a first line
   indentation of 1 cm set
4. request announcement of text formatting by pressing NVDA+F
5. Make sure that what NVDA says includes the first line indent
    ("first line indent 1.00 centimetre")

 ### Known issues with pull request:

None

 ### 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.

<!-- Please keep the following -->
@coderabbitai summary

@seanbudd seanbudd left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Comment thread source/NVDAObjects/IAccessible/__init__.py Outdated
Comment thread source/NVDAObjects/IAccessible/__init__.py Outdated
Comment thread user_docs/en/changes.md Outdated
@seanbudd seanbudd merged commit b48f9de into nvaccess:master Jan 23, 2025
@github-actions github-actions Bot added this to the 2025.1 milestone Jan 23, 2025
@michaelweghorn michaelweghorn deleted the michaelweghorn/nvda13052_first_line_indent branch January 23, 2025 07:54
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.

nvda does not announce first line indentation in libre office writer

2 participants