summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/corelib/tools/qchar.cpp17
-rw-r--r--util/unicode/main.cpp18
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);