Be more strict about accessible text selection
authorFrederik Gladhorn <frederik.gladhorn@digia.com>
Wed, 3 Apr 2013 20:03:09 +0000 (22:03 +0200)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Sun, 28 Apr 2013 23:21:43 +0000 (01:21 +0200)
Change-Id: I0eda4c29235035824105992f3db2d9a0c06dc6b5
Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
src/plugins/accessible/quick/qaccessiblequickitem.cpp

index f24d508..12884ff 100644 (file)
@@ -421,8 +421,13 @@ QString QAccessibleQuickItem::textAtOffset(int offset, QAccessible::TextBoundary
 
 void QAccessibleQuickItem::selection(int selectionIndex, int *startOffset, int *endOffset) const
 {
-    *startOffset = item()->property("selectionStart").toInt();
-    *endOffset = item()->property("selectionEnd").toInt();
+    if (selectionIndex == 0) {
+        *startOffset = item()->property("selectionStart").toInt();
+        *endOffset = item()->property("selectionEnd").toInt();
+    } else {
+        *startOffset = 0;
+        *endOffset = 0;
+    }
 }
 
 int QAccessibleQuickItem::selectionCount() const