From b80fcbdba62ec2324fa9ad29cbc5ac1d9a9fe8a2 Mon Sep 17 00:00:00 2001 From: Konstantin Ritt Date: Sun, 26 Jan 2014 02:42:37 +0200 Subject: Introduce QChar::JoiningType enum and QChar::joiningType() method This aimed to disctinct joining types "L", "T", and "U" from just "U". Unicode 6.3.0 has introduced a character with joining type "L" and Unicode 7.0 will add a few more characters of joining type "L", so we'll have to deal with it anyways. [ChangeLog][QtCore][QChar] Added JoiningType enum and joiningType() method that deprecates the old QChar::Joining enum and joining() method. Change-Id: I4be3a3f745d944e689feb9b62d4ca86d1cf371b0 Reviewed-by: Lars Knoll Reviewed-by: Thiago Macieira --- src/gui/text/qtextengine.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/gui/text') diff --git a/src/gui/text/qtextengine.cpp b/src/gui/text/qtextengine.cpp index 109b7e600f..6c985e2eac 100644 --- a/src/gui/text/qtextengine.cpp +++ b/src/gui/text/qtextengine.cpp @@ -2537,8 +2537,8 @@ static inline bool nextCharJoins(const QString &string, int pos) ++pos; if (pos == string.length()) return false; - // ### U+A872 has joining type L - return string.at(pos) == QChar(0xA872) || string.at(pos).joining() != QChar::OtherJoining; + QChar::JoiningType joining = string.at(pos).joiningType(); + return joining != QChar::Joining_None && joining != QChar::Joining_Transparent; } static inline bool prevCharJoins(const QString &string, int pos) @@ -2547,8 +2547,8 @@ static inline bool prevCharJoins(const QString &string, int pos) --pos; if (pos == 0) return false; - QChar::Joining joining = string.at(pos - 1).joining(); - return (joining == QChar::Dual || joining == QChar::Center); + QChar::JoiningType joining = string.at(pos - 1).joiningType(); + return joining == QChar::Joining_Dual || joining == QChar::Joining_Causing; } static inline bool isRetainableControlCode(QChar c) -- cgit v1.2.3