aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/tcime/3rdparty/tcime/zhuyintable.cpp
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@kdab.com>2019-07-18 23:03:17 +0200
committerMarc Mutz <marc.mutz@kdab.com>2019-07-19 09:07:49 +0200
commit68375389bf09427103ab3ff2b7fb1517e9b55615 (patch)
tree3d54e974591ae0a5b2142254e12e24c85973764b /src/plugins/tcime/3rdparty/tcime/zhuyintable.cpp
parent1de3b00963d1fb55e732893fad5005c998280792 (diff)
Port from implicit QChar(*int*) to explicit ones
Found a nice misuse of QChar <=> Qt::Key, which happens to work for '\'', but not for all other keys (e.g. Esc)... I want to note that, yes, I took note of the code's abuse of Qt containers, and no, I _did_ constrain myself; this patch is just fixing implicit *int*->QChar conversions. Change-Id: I3cb43417f3922fdc500783b7e0b8caecc0d3c5f5 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Diffstat (limited to 'src/plugins/tcime/3rdparty/tcime/zhuyintable.cpp')
-rw-r--r--src/plugins/tcime/3rdparty/tcime/zhuyintable.cpp21
1 files changed, 10 insertions, 11 deletions
diff --git a/src/plugins/tcime/3rdparty/tcime/zhuyintable.cpp b/src/plugins/tcime/3rdparty/tcime/zhuyintable.cpp
index 8198122a..7dc62f37 100644
--- a/src/plugins/tcime/3rdparty/tcime/zhuyintable.cpp
+++ b/src/plugins/tcime/3rdparty/tcime/zhuyintable.cpp
@@ -26,21 +26,21 @@ using namespace tcime;
const int ZhuyinTable::INITIALS_SIZE = 22;
const QList<QChar> ZhuyinTable::yiEndingFinals = QList<QChar>()
- << 0x311a << 0x311b << 0x311d << 0x311e << 0x3120 << 0x3121 << 0x3122
- << 0x3123 << 0x3124 << 0x3125;
+ << QChar(0x311a) << QChar(0x311b) << QChar(0x311d) << QChar(0x311e) << QChar(0x3120) << QChar(0x3121) << QChar(0x3122)
+ << QChar(0x3123) << QChar(0x3124) << QChar(0x3125);
const QList<QChar> ZhuyinTable::wuEndingFinals = QList<QChar>()
- << 0x311a << 0x311b << 0x311e << 0x311f << 0x3122 << 0x3123 << 0x3124
- << 0x3125;
+ << QChar(0x311a) << QChar(0x311b) << QChar(0x311e) << QChar(0x311f) << QChar(0x3122) << QChar(0x3123) << QChar(0x3124)
+ << QChar(0x3125);
const QList<QChar> ZhuyinTable::yuEndingFinals = QList<QChar>()
- << 0x311d << 0x3122 << 0x3123 << 0x3125;
+ << QChar(0x311d) << QChar(0x3122) << QChar(0x3123) << QChar(0x3125);
const int ZhuyinTable::YI_FINALS_INDEX = 14;
const int ZhuyinTable::WU_FINALS_INDEX = 25;
const int ZhuyinTable::YU_FINALS_INDEX = 34;
-const QChar ZhuyinTable::YI_FINALS = 0x3127;
-const QChar ZhuyinTable::WU_FINALS = 0x3128;
-const QChar ZhuyinTable::YU_FINALS = 0x3129;
+const QChar ZhuyinTable::YI_FINALS(0x3127);
+const QChar ZhuyinTable::WU_FINALS(0x3128);
+const QChar ZhuyinTable::YU_FINALS (0x3129);
const QList<QChar> ZhuyinTable::tones = QList<QChar>()
- << ZhuyinTable::DEFAULT_TONE << 0x02d9 << 0x02ca << 0x02c7 << 0x02cb;
+ << ZhuyinTable::DEFAULT_TONE << QChar(0x02d9) << QChar(0x02ca) << QChar(0x02c7) << QChar(0x02cb);
const QChar ZhuyinTable::DEFAULT_TONE = QLatin1Char(' ');
int ZhuyinTable::getInitials(const QChar &initials)
@@ -139,8 +139,7 @@ bool ZhuyinTable::isTone(const QChar &c)
bool ZhuyinTable::isYiWuYuFinals(const QChar &c)
{
- ushort unicode = c.unicode();
- return unicode == YI_FINALS || unicode == WU_FINALS || unicode == YU_FINALS;
+ return c == YI_FINALS || c == WU_FINALS || c == YU_FINALS;
}
QStringList ZhuyinTable::stripTones(const QString &input)