diff options
author | Allan Sandfeld Jensen <allan.jensen@theqtcompany.com> | 2016-06-27 15:43:33 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2016-08-19 18:38:53 +0000 |
commit | 9f888d2fde9c5413e5519e0914e9b13638760985 (patch) | |
tree | 7e211a2ae70c272ea8041d5100f0c9a67b32de1b /src/gui/text/qtextengine.cpp | |
parent | 25dd9c521fc064a71db63b110b7973225ee20c02 (diff) |
Support C++17 fallthrough attribute
Replaces our mix of comments for annotating intended absence of break
in switches with the C++17 attribute [[fallthrough]], or its earlier
a clang extension counterpart.
Change-Id: I4b2d0b9b5e4425819c7f1bf01608093c536b6d14
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/gui/text/qtextengine.cpp')
-rw-r--r-- | src/gui/text/qtextengine.cpp | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/src/gui/text/qtextengine.cpp b/src/gui/text/qtextengine.cpp index d9b648b170..1aaacdd00d 100644 --- a/src/gui/text/qtextengine.cpp +++ b/src/gui/text/qtextengine.cpp @@ -508,7 +508,7 @@ static bool bidiItemize(QTextEngine *engine, QScriptAnalysis *analysis, QBidiCon case QChar::DirAN: if (eor >= 0) appendItems(analysis, sor, eor, control, dir); - // fall through + Q_FALLTHROUGH(); case QChar::DirR: case QChar::DirAL: dir = QChar::DirR; eor = current; status.eor = QChar::DirR; break; @@ -564,7 +564,7 @@ static bool bidiItemize(QTextEngine *engine, QScriptAnalysis *analysis, QBidiCon status.eor = QChar::DirON; dir = QChar::DirAN; } - // fall through + Q_FALLTHROUGH(); case QChar::DirEN: case QChar::DirL: eor = current; @@ -744,7 +744,7 @@ static bool bidiItemize(QTextEngine *engine, QScriptAnalysis *analysis, QBidiCon status.last = QChar::DirL; break; } - // fall through + Q_FALLTHROUGH(); default: status.last = dirCurrent; } @@ -1663,7 +1663,7 @@ void QTextEngine::itemize() const analysis->bidiLevel = control.baseLevel(); break; } - // fall through + Q_FALLTHROUGH(); default: analysis->flags = QScriptAnalysis::None; break; @@ -2250,7 +2250,6 @@ void QTextEngine::justify(const QScriptLine &line) case Justification_Prohibited: break; case Justification_Space: - // fall through case Justification_Arabic_Space: if (kashida_pos >= 0) { // qDebug("kashida position at %d in word", kashida_pos); @@ -2263,7 +2262,7 @@ void QTextEngine::justify(const QScriptLine &line) } kashida_pos = -1; kashida_type = Justification_Arabic_Normal; - // fall through + Q_FALLTHROUGH(); case Justification_Character: set(&justificationPoints[nPoints++], justification, g.mid(i), fontEngine(si)); maxJustify = qMax(maxJustify, justification); @@ -2966,9 +2965,8 @@ QFixed QTextEngine::calculateTabWidth(int item, QFixed x) const switch (tabSpec.type) { case QTextOption::CenterTab: length /= 2; - // fall through + Q_FALLTHROUGH(); case QTextOption::DelimiterTab: - // fall through case QTextOption::RightTab: tab = QFixed::fromReal(tabSpec.position) * dpiScale - length; if (tab < x) // default to tab taking no space |