diff options
author | Konstantin Ritt <ritt.ks@gmail.com> | 2012-12-21 18:35:58 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2012-12-21 19:01:35 +0100 |
commit | 9b0fab6b62df98519ebfab117f14b9d3465d8c68 (patch) | |
tree | 0f2e28b46868b0f1eebc641ea258547aa00ecc07 /src/corelib/tools/qtextboundaryfinder.cpp | |
parent | dde09c429ae8b7ad0df4e4b36b8459d2b85a1219 (diff) |
Update Qt internals to use QChar::Script
...and remove the outdated QUnicodeTables::Script enum.
QFontEngineData now has one extra slot that never used
(engines[QChar::Script_Inherited]). engines[QChar::Script_Unknown],
if accessed, would be set with a Box engine instance, and could be used
as a minor optimization some time later.
In order to preserve the existing behavior, we map all scripts up to Latin to Common.
Change-Id: Ide4182a0f8447b4bf25713ecc3fe8097b8fed040
Reviewed-by: Pierre Rossi <pierre.rossi@gmail.com>
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Diffstat (limited to 'src/corelib/tools/qtextboundaryfinder.cpp')
-rw-r--r-- | src/corelib/tools/qtextboundaryfinder.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/corelib/tools/qtextboundaryfinder.cpp b/src/corelib/tools/qtextboundaryfinder.cpp index 968a580725..3ffb59b3df 100644 --- a/src/corelib/tools/qtextboundaryfinder.cpp +++ b/src/corelib/tools/qtextboundaryfinder.cpp @@ -41,7 +41,6 @@ #include <QtCore/qtextboundaryfinder.h> #include <QtCore/qvarlengtharray.h> -#include <private/qunicodetables_p.h> #include <private/qunicodetools_p.h> QT_BEGIN_NAMESPACE @@ -61,15 +60,15 @@ static void init(QTextBoundaryFinder::BoundaryType type, const QChar *chars, int // correctly assign script, isTab and isObject to the script analysis const ushort *uc = unicode; const ushort *e = uc + length; - int script = QUnicodeTables::Common; - int lastScript = QUnicodeTables::Common; + uchar script = QChar::Script_Common; + uchar lastScript = QChar::Script_Common; const ushort *start = uc; while (uc < e) { - int s = QUnicodeTables::script(*uc); - if (s != QUnicodeTables::Inherited) + int s = QChar::script(*uc); + if (s != QChar::Script_Inherited) script = s; if (*uc == QChar::ObjectReplacementCharacter || *uc == QChar::LineSeparator || *uc == 9) - script = QUnicodeTables::Common; + script = QChar::Script_Common; if (script != lastScript) { if (uc != start) { QUnicodeTools::ScriptItem item; |