summaryrefslogtreecommitdiffstats
path: root/src/gui/accessible
diff options
context:
space:
mode:
authorFrederik Gladhorn <frederik.gladhorn@digia.com>2014-10-09 17:56:51 +0200
committerFrederik Gladhorn <frederik.gladhorn@digia.com>2014-10-09 17:56:52 +0200
commit881ceeff428c377d02ae3881beccdbb028385075 (patch)
tree65bd4335d7f67b81b04e33f2cbb17a41cf966dd8 /src/gui/accessible
parentb3d2c867ed14cd6337d5e32b8750f198b5b7d331 (diff)
parent106487387d493dab934e19b33bfed55b8df62d67 (diff)
Merge remote-tracking branch 'origin/5.4' into dev
Diffstat (limited to 'src/gui/accessible')
-rw-r--r--src/gui/accessible/qaccessible.cpp15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/gui/accessible/qaccessible.cpp b/src/gui/accessible/qaccessible.cpp
index 65e3b3f183..858c2e1b9c 100644
--- a/src/gui/accessible/qaccessible.cpp
+++ b/src/gui/accessible/qaccessible.cpp
@@ -1957,7 +1957,8 @@ QString QAccessibleTextInterface::textBeforeOffset(int offset, QAccessible::Text
if (txt.isEmpty() || offset <= 0 || offset > txt.length())
return QString();
- QTextBoundaryFinder::BoundaryType type;
+ // type initialized just to silence a compiler warning [-Werror=maybe-uninitialized]
+ QTextBoundaryFinder::BoundaryType type = QTextBoundaryFinder::Grapheme;
switch (boundaryType) {
case QAccessible::CharBoundary:
type = QTextBoundaryFinder::Grapheme;
@@ -1975,6 +1976,8 @@ QString QAccessibleTextInterface::textBeforeOffset(int offset, QAccessible::Text
case QAccessible::NoBoundary:
// return empty, this function currently only supports single lines, so there can be no line before
return QString();
+ default:
+ Q_UNREACHABLE();
}
// keep behavior in sync with QTextCursor::movePosition()!
@@ -2028,7 +2031,8 @@ QString QAccessibleTextInterface::textAfterOffset(int offset, QAccessible::TextB
if (txt.isEmpty() || offset < 0 || offset >= txt.length())
return QString();
- QTextBoundaryFinder::BoundaryType type;
+ // type initialized just to silence a compiler warning [-Werror=maybe-uninitialized]
+ QTextBoundaryFinder::BoundaryType type = QTextBoundaryFinder::Grapheme;
switch (boundaryType) {
case QAccessible::CharBoundary:
type = QTextBoundaryFinder::Grapheme;
@@ -2046,6 +2050,8 @@ QString QAccessibleTextInterface::textAfterOffset(int offset, QAccessible::TextB
case QAccessible::NoBoundary:
// return empty, this function currently only supports single lines, so there can be no line after
return QString();
+ default:
+ Q_UNREACHABLE();
}
// keep behavior in sync with QTextCursor::movePosition()!
@@ -2113,7 +2119,8 @@ QString QAccessibleTextInterface::textAtOffset(int offset, QAccessible::TextBoun
if (offset == txt.length() && boundaryType == QAccessible::CharBoundary)
return QString();
- QTextBoundaryFinder::BoundaryType type;
+ // type initialized just to silence a compiler warning [-Werror=maybe-uninitialized]
+ QTextBoundaryFinder::BoundaryType type = QTextBoundaryFinder::Grapheme;
switch (boundaryType) {
case QAccessible::CharBoundary:
type = QTextBoundaryFinder::Grapheme;
@@ -2132,6 +2139,8 @@ QString QAccessibleTextInterface::textAtOffset(int offset, QAccessible::TextBoun
*startOffset = 0;
*endOffset = txt.length();
return txt;
+ default:
+ Q_UNREACHABLE();
}
// keep behavior in sync with QTextCursor::movePosition()!