diff options
author | Michael Weghorn <m.weghorn@posteo.de> | 2021-07-21 14:12:31 +0200 |
---|---|---|
committer | Michael Weghorn <m.weghorn@posteo.de> | 2021-07-21 17:43:16 +0200 |
commit | bdf14fd8ea18b94cdcdf2b194d6644f87d69d96b (patch) | |
tree | 300e1153bd6cb88d77ec1e889e34572e69f4ca74 /vcl | |
parent | 96869931e35fa4fbc779755e89207062648ed58d (diff) |
qt5 a11y: Implement Qt5AccessibleWidget::cursorPosition
Use 'XAccessibleText::getCaretPosition', similar to
how 'Qt5AccessibleWidget::setCursorPosition' calls
'XAccessibleText::setCaretPosition'.
Change-Id: Ic9e4533d6a39de90fee7ec2e8e0bd3fc6a69bba0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119320
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/qt5/Qt5AccessibleWidget.cxx | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/vcl/qt5/Qt5AccessibleWidget.cxx b/vcl/qt5/Qt5AccessibleWidget.cxx index 0cf79919501c..33ad3634f24e 100644 --- a/vcl/qt5/Qt5AccessibleWidget.cxx +++ b/vcl/qt5/Qt5AccessibleWidget.cxx @@ -872,7 +872,7 @@ QString Qt5AccessibleWidget::attributes(int offset, int* startOffset, int* endOf // handle special values for offset the same way base class's QAccessibleTextWidget::attributes does // (as defined in IAccessible 2: -1 -> length, -2 -> cursor position) if (offset == -2) - offset = cursorPosition(); // currently always returns 0 + offset = cursorPosition(); const int nTextLength = characterCount(); if (offset == -1 || offset == nTextLength) @@ -927,11 +927,15 @@ QRect Qt5AccessibleWidget::characterRect(int /* offset */) const SAL_INFO("vcl.qt5", "Unsupported QAccessibleTextInterface::characterRect"); return QRect(); } + int Qt5AccessibleWidget::cursorPosition() const { - SAL_INFO("vcl.qt5", "Unsupported QAccessibleTextInterface::cursorPosition"); + Reference<XAccessibleText> xText(m_xAccessible, UNO_QUERY); + if (xText.is()) + return xText->getCaretPosition(); return 0; } + int Qt5AccessibleWidget::offsetAtPoint(const QPoint& /* point */) const { SAL_INFO("vcl.qt5", "Unsupported QAccessibleTextInterface::offsetAtPoint"); |