diff options
author | Michael Weghorn <m.weghorn@posteo.de> | 2023-10-17 14:16:54 +0200 |
---|---|---|
committer | Michael Weghorn <m.weghorn@posteo.de> | 2023-10-18 12:48:49 +0200 |
commit | 15a6e23c4fc160c50a316da3d18980a02fc10ce8 (patch) | |
tree | eefa4cf3ba4e394f59c00bc76285d0ed16aabf18 /vcl/qt5 | |
parent | 0280a9ef0d93bb2c8ec713b6dc36b77962b57e99 (diff) |
tdf#157696 qt a11y: Move handling for text attr offsets to helper
Add a new method
`AccessibleTextAttributeHelper::GetIAccessible2TextAttributes`
and move some more of the logic from
`QtAccessibleWidget::attributes` there to prepare adding handling
for spelling errors via the "invalid:spelling" IAccessible2 text attribute
and for reuse in winaccessibility.
Change-Id: I3b4a89ee680437fa2c35c429639b372a55f5a4b1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158088
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Diffstat (limited to 'vcl/qt5')
-rw-r--r-- | vcl/qt5/QtAccessibleWidget.cxx | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/vcl/qt5/QtAccessibleWidget.cxx b/vcl/qt5/QtAccessibleWidget.cxx index cd50af4aed9f..02a46147ce99 100644 --- a/vcl/qt5/QtAccessibleWidget.cxx +++ b/vcl/qt5/QtAccessibleWidget.cxx @@ -882,15 +882,8 @@ QString QtAccessibleWidget::attributes(int offset, int* startOffset, int* endOff return QString(); } - const Sequence<PropertyValue> attribs - = xText->getCharacterAttributes(offset, Sequence<OUString>()); - const OUString aRet - = AccessibleTextAttributeHelper::ConvertUnoToIAccessible2TextAttributes(attribs); - - accessibility::TextSegment aAttributeRun - = xText->getTextAtIndex(offset, accessibility::AccessibleTextType::ATTRIBUTE_RUN); - *startOffset = aAttributeRun.SegmentStart; - *endOffset = aAttributeRun.SegmentEnd; + const OUString aRet = AccessibleTextAttributeHelper::GetIAccessible2TextAttributes( + xText, offset, *startOffset, *endOffset); return toQString(aRet); } |