diff options
author | Ritt Konstantin <ritt.ks@gmail.com> | 2010-05-10 11:04:06 (GMT) |
---|---|---|
committer | Thiago Macieira <thiago.macieira@nokia.com> | 2010-09-21 10:36:22 (GMT) |
commit | 9fcbca8de0963e2429dc7d25adccbf6a895fa7e8 (patch) | |
tree | a2bf6793a2ba235dcf66e108e6642f3c8cad1492 | |
parent | acaad4c6cc36439b3b836992949d287b53574f06 (diff) | |
download | Qt-9fcbca8de0963e2429dc7d25adccbf6a895fa7e8.zip Qt-9fcbca8de0963e2429dc7d25adccbf6a895fa7e8.tar.gz Qt-9fcbca8de0963e2429dc7d25adccbf6a895fa7e8.tar.bz2 |
move QUnicodeTables:: script() and lineBreakClass() implementations
from qchar.cpp to qunicodetables.cpp
-rw-r--r-- | src/corelib/tools/qchar.cpp | 17 | ||||
-rw-r--r-- | util/unicode/main.cpp | 18 |
2 files changed, 18 insertions, 17 deletions
diff --git a/src/corelib/tools/qchar.cpp b/src/corelib/tools/qchar.cpp index ed0af4e..bb777cd 100644 --- a/src/corelib/tools/qchar.cpp +++ b/src/corelib/tools/qchar.cpp @@ -1630,21 +1630,4 @@ static void canonicalOrderHelper(QString *str, QChar::UnicodeVersion version, in } } -int QT_FASTCALL QUnicodeTables::script(unsigned int uc) -{ - if (uc > 0xffff) - return Common; - int script = uc_scripts[uc >> 7]; - if (script < ScriptSentinel) - return script; - script = (((script - ScriptSentinel) * UnicodeBlockSize) + UnicodeBlockCount); - script = uc_scripts[script + (uc & 0x7f)]; - return script; -} - -Q_CORE_EXPORT QUnicodeTables::LineBreakClass QT_FASTCALL QUnicodeTables::lineBreakClass(uint ucs4) -{ - return (QUnicodeTables::LineBreakClass) qGetProp(ucs4)->line_break_class; -} - QT_END_NAMESPACE diff --git a/util/unicode/main.cpp b/util/unicode/main.cpp index f2ebe7c..5303c0d 100644 --- a/util/unicode/main.cpp +++ b/util/unicode/main.cpp @@ -1908,6 +1908,19 @@ QByteArray createScriptTableDeclaration() } declaration += "\n};\n\n} // namespace QUnicodeTables\n\n"; + declaration += + "Q_CORE_EXPORT int QT_FASTCALL QUnicodeTables::script(uint ucs4)\n" + "{\n" + " if (ucs4 > 0xffff)\n" + " return Common;\n" + " int script = uc_scripts[ucs4 >> 7];\n" + " if (script < ScriptSentinel)\n" + " return script;\n" + " script = (((script - ScriptSentinel) * UnicodeBlockSize) + UnicodeBlockCount);\n" + " script = uc_scripts[script + (ucs4 & 0x7f)];\n" + " return script;\n" + "}\n\n"; + qDebug("createScriptTableDeclaration: table size is %d bytes", unicodeBlockCount + (extraBlockList.size() * unicodeBlockSize)); @@ -2168,6 +2181,11 @@ static QByteArray createPropertyInfo() " return uc_properties + index;\n" "}\n\n"; + out += "Q_CORE_EXPORT QUnicodeTables::LineBreakClass QT_FASTCALL QUnicodeTables::lineBreakClass(uint ucs4)\n" + "{\n" + " return (QUnicodeTables::LineBreakClass)qGetProp(ucs4)->line_break_class;\n" + "}\n\n"; + out += "static const ushort specialCaseMap[] = {\n "; for (int i = 0; i < specialCaseMap.size(); ++i) { out += QByteArray(" 0x") + QByteArray::number(specialCaseMap.at(i), 16); |