summaryrefslogtreecommitdiffstats
path: root/src/widgets/accessible
diff options
context:
space:
mode:
authorFrederik Gladhorn <frederik.gladhorn@digia.com>2014-07-03 11:19:21 +0200
committerFrederik Gladhorn <frederik.gladhorn@digia.com>2014-09-04 14:50:32 +0200
commit52f859604ddc12d273111644bbfd78f7f8a030ea (patch)
treeee16318ea8b7f8220ff210922ca0910acf4d039e /src/widgets/accessible
parentf4ae4f41b06d61f32dbef3cac90e8e3b187ee378 (diff)
Accessibility: Improve line boundary helper functions
These functions are supposed to make it easy for third parties (and QLineEdit) to implement the textAt/Before/AfterOffset functions. Before the functions were ignoring newlines completely and thus only somewhat useful. Change-Id: I7136b9502a7fa6f8ad9ad7236761a34c1a7fd4da Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
Diffstat (limited to 'src/widgets/accessible')
-rw-r--r--src/widgets/accessible/simplewidgets.cpp6
1 files changed, 0 insertions, 6 deletions
diff --git a/src/widgets/accessible/simplewidgets.cpp b/src/widgets/accessible/simplewidgets.cpp
index e8827f4537..2064914683 100644
--- a/src/widgets/accessible/simplewidgets.cpp
+++ b/src/widgets/accessible/simplewidgets.cpp
@@ -729,8 +729,6 @@ QString QAccessibleLineEdit::textBeforeOffset(int offset, QAccessible::TextBound
*startOffset = *endOffset = -1;
return QString();
}
- if (offset == -1)
- offset = lineEdit()->text().length();
if (offset == -2)
offset = cursorPosition();
return QAccessibleTextInterface::textBeforeOffset(offset, boundaryType, startOffset, endOffset);
@@ -743,8 +741,6 @@ QString QAccessibleLineEdit::textAfterOffset(int offset, QAccessible::TextBounda
*startOffset = *endOffset = -1;
return QString();
}
- if (offset == -1)
- offset = lineEdit()->text().length();
if (offset == -2)
offset = cursorPosition();
return QAccessibleTextInterface::textAfterOffset(offset, boundaryType, startOffset, endOffset);
@@ -757,8 +753,6 @@ QString QAccessibleLineEdit::textAtOffset(int offset, QAccessible::TextBoundaryT
*startOffset = *endOffset = -1;
return QString();
}
- if (offset == -1)
- offset = lineEdit()->text().length();
if (offset == -2)
offset = cursorPosition();
return QAccessibleTextInterface::textAtOffset(offset, boundaryType, startOffset, endOffset);