summaryrefslogtreecommitdiff
path: root/core/src/fxcrt/fx_arabic.cpp
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2015-10-29 15:01:55 -0700
committerLei Zhang <thestig@chromium.org>2015-10-29 15:01:55 -0700
commitee02ea37e8f85920885600d56df706d690e648ff (patch)
tree055bbc66a5c95a8bc75ccc491f73505bb8eb6676 /core/src/fxcrt/fx_arabic.cpp
parent5a88b1131c450dee0500a02f80f0838385e4c4d2 (diff)
downloadpdfium-ee02ea37e8f85920885600d56df706d690e648ff.tar.xz
XFA: Manual merge of Clean up IFX_BidiChar
- Replace IFX_BidiChar with just CFX_BidiChar - Document implementation - Change out parameters to pointers - Remove dead code - Add an enum for bidi directions - Move several externs to a header - Add unit tests Original CL: https://codereview.chromium.org/1197643002 This version does not remove fx_arb.h and fx_arabic.h, as there is code on the XFA branch that still uses parts of it. R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1423103002 .
Diffstat (limited to 'core/src/fxcrt/fx_arabic.cpp')
-rw-r--r--core/src/fxcrt/fx_arabic.cpp383
1 files changed, 202 insertions, 181 deletions
diff --git a/core/src/fxcrt/fx_arabic.cpp b/core/src/fxcrt/fx_arabic.cpp
index 139e9f1f48..1869cb2008 100644
--- a/core/src/fxcrt/fx_arabic.cpp
+++ b/core/src/fxcrt/fx_arabic.cpp
@@ -7,112 +7,209 @@
#include "../../include/fxcrt/fx_ucd.h"
#include "fx_arabic.h"
-#ifdef __cplusplus
-extern "C" {
-#endif
-static const FX_ARBFORMTABLE g_FX_ArabicFormTables[] = {
- {0xFE81, 0xFE82, 0xFE81, 0xFE82}, {0xFE83, 0xFE84, 0xFE83, 0xFE84},
- {0xFE85, 0xFE86, 0xFE85, 0xFE86}, {0xFE87, 0xFE88, 0xFE87, 0xFE88},
- {0xFE89, 0xFE8A, 0xFE8B, 0xFE8C}, {0xFE8D, 0xFE8E, 0xFE8D, 0xFE8E},
- {0xFE8F, 0xFE90, 0xFE91, 0xFE92}, {0xFE93, 0xFE94, 0xFE93, 0xFE94},
- {0xFE95, 0xFE96, 0xFE97, 0xFE98}, {0xFE99, 0xFE9A, 0xFE9B, 0xFE9C},
- {0xFE9D, 0xFE9E, 0xFE9F, 0xFEA0}, {0xFEA1, 0xFEA2, 0xFEA3, 0xFEA4},
- {0xFEA5, 0xFEA6, 0xFEA7, 0xFEA8}, {0xFEA9, 0xFEAA, 0xFEA9, 0xFEAA},
- {0xFEAB, 0xFEAC, 0xFEAB, 0xFEAC}, {0xFEAD, 0xFEAE, 0xFEAD, 0xFEAE},
- {0xFEAF, 0xFEB0, 0xFEAF, 0xFEB0}, {0xFEB1, 0xFEB2, 0xFEB3, 0xFEB4},
- {0xFEB5, 0xFEB6, 0xFEB7, 0xFEB8}, {0xFEB9, 0xFEBA, 0xFEBB, 0xFEBC},
- {0xFEBD, 0xFEBE, 0xFEBF, 0xFEC0}, {0xFEC1, 0xFEC2, 0xFEC3, 0xFEC4},
- {0xFEC5, 0xFEC6, 0xFEC7, 0xFEC8}, {0xFEC9, 0xFECA, 0xFECB, 0xFECC},
- {0xFECD, 0xFECE, 0xFECF, 0xFED0}, {0x063B, 0x063B, 0x063B, 0x063B},
- {0x063C, 0x063C, 0x063C, 0x063C}, {0x063D, 0x063D, 0x063D, 0x063D},
- {0x063E, 0x063E, 0x063E, 0x063E}, {0x063F, 0x063F, 0x063F, 0x063F},
- {0x0640, 0x0640, 0x0640, 0x0640}, {0xFED1, 0xFED2, 0xFED3, 0xFED4},
- {0xFED5, 0xFED6, 0xFED7, 0xFED8}, {0xFED9, 0xFEDA, 0xFEDB, 0xFEDC},
- {0xFEDD, 0xFEDE, 0xFEDF, 0xFEE0}, {0xFEE1, 0xFEE2, 0xFEE3, 0xFEE4},
- {0xFEE5, 0xFEE6, 0xFEE7, 0xFEE8}, {0xFEE9, 0xFEEA, 0xFEEB, 0xFEEC},
- {0xFEED, 0xFEEE, 0xFEED, 0xFEEE}, {0xFEEF, 0xFEF0, 0xFBFE, 0xFBFF},
- {0xFEF1, 0xFEF2, 0xFEF3, 0xFEF4}, {0x064B, 0x064B, 0x064B, 0x064B},
- {0x064C, 0x064C, 0x064C, 0x064C}, {0x064D, 0x064D, 0x064D, 0x064D},
- {0x064E, 0x064E, 0x064E, 0x064E}, {0x064F, 0x064F, 0x064F, 0x064F},
- {0x0650, 0x0650, 0x0650, 0x0650}, {0x0651, 0x0651, 0x0651, 0x0651},
- {0x0652, 0x0652, 0x0652, 0x0652}, {0x0653, 0x0653, 0x0653, 0x0653},
- {0x0654, 0x0654, 0x0654, 0x0654}, {0x0655, 0x0655, 0x0655, 0x0655},
- {0x0656, 0x0656, 0x0656, 0x0656}, {0x0657, 0x0657, 0x0657, 0x0657},
- {0x0658, 0x0658, 0x0658, 0x0658}, {0x0659, 0x0659, 0x0659, 0x0659},
- {0x065A, 0x065A, 0x065A, 0x065A}, {0x065B, 0x065B, 0x065B, 0x065B},
- {0x065C, 0x065C, 0x065C, 0x065C}, {0x065D, 0x065D, 0x065D, 0x065D},
- {0x065E, 0x065E, 0x065E, 0x065E}, {0x065F, 0x065F, 0x065F, 0x065F},
- {0x0660, 0x0660, 0x0660, 0x0660}, {0x0661, 0x0661, 0x0661, 0x0661},
- {0x0662, 0x0662, 0x0662, 0x0662}, {0x0663, 0x0663, 0x0663, 0x0663},
- {0x0664, 0x0664, 0x0664, 0x0664}, {0x0665, 0x0665, 0x0665, 0x0665},
- {0x0666, 0x0666, 0x0666, 0x0666}, {0x0667, 0x0667, 0x0667, 0x0667},
- {0x0668, 0x0668, 0x0668, 0x0668}, {0x0669, 0x0669, 0x0669, 0x0669},
- {0x066A, 0x066A, 0x066A, 0x066A}, {0x066B, 0x066B, 0x066B, 0x066B},
- {0x066C, 0x066C, 0x066C, 0x066C}, {0x066D, 0x066D, 0x066D, 0x066D},
- {0x066E, 0x066E, 0x066E, 0x066E}, {0x066F, 0x066F, 0x066F, 0x066F},
- {0x0670, 0x0670, 0x0670, 0x0670}, {0xFB50, 0xFB51, 0xFB50, 0xFB51},
- {0x0672, 0x0672, 0x0672, 0x0672}, {0x0673, 0x0673, 0x0673, 0x0673},
- {0x0674, 0x0674, 0x0674, 0x0674}, {0x0675, 0x0675, 0x0675, 0x0675},
- {0x0676, 0x0676, 0x0676, 0x0676}, {0x0677, 0x0677, 0x0677, 0x0677},
- {0x0678, 0x0678, 0x0678, 0x0678}, {0xFB66, 0xFB67, 0xFB68, 0xFB69},
- {0xFB5E, 0xFB5F, 0xFB60, 0xFB61}, {0xFB52, 0xFB53, 0xFB54, 0xFB55},
- {0x067C, 0x067C, 0x067C, 0x067C}, {0x067D, 0x067D, 0x067D, 0x067D},
- {0xFB56, 0xFB57, 0xFB58, 0xFB59}, {0xFB62, 0xFB63, 0xFB64, 0xFB65},
- {0xFB5A, 0xFB5B, 0xFB5C, 0xFB5D}, {0x0681, 0x0681, 0x0681, 0x0681},
- {0x0682, 0x0682, 0x0682, 0x0682}, {0xFB76, 0xFB77, 0xFB78, 0xFB79},
- {0xFB72, 0xFB73, 0xFB74, 0xFB75}, {0x0685, 0x0685, 0x0685, 0x0685},
- {0xFB7A, 0xFB7B, 0xFB7C, 0xFB7D}, {0xFB7E, 0xFB7F, 0xFB80, 0xFB81},
- {0xFB88, 0xFB89, 0xFB88, 0xFB89}, {0x0689, 0x0689, 0x0689, 0x0689},
- {0x068A, 0x068A, 0x068A, 0x068A}, {0x068B, 0x068B, 0x068B, 0x068B},
- {0xFB84, 0xFB85, 0xFB84, 0xFB85}, {0xFB82, 0xFB83, 0xFB82, 0xFB83},
- {0xFB86, 0xFB87, 0xFB86, 0xFB87}, {0x068F, 0x068F, 0x068F, 0x068F},
- {0x0690, 0x0690, 0x0690, 0x0690}, {0xFB8C, 0xFB8D, 0xFB8C, 0xFB8D},
- {0x0692, 0x0692, 0x0692, 0x0692}, {0x0693, 0x0693, 0x0693, 0x0693},
- {0x0694, 0x0694, 0x0694, 0x0694}, {0x0695, 0x0695, 0x0695, 0x0695},
- {0x0696, 0x0696, 0x0696, 0x0696}, {0x0697, 0x0697, 0x0697, 0x0697},
- {0xFB8A, 0xFB8B, 0xFB8A, 0xFB8B}, {0x0699, 0x0699, 0x0699, 0x0699},
- {0x069A, 0x069A, 0x069A, 0x069A}, {0x069B, 0x069B, 0x069B, 0x069B},
- {0x069C, 0x069C, 0x069C, 0x069C}, {0x069D, 0x069D, 0x069D, 0x069D},
- {0x069E, 0x069E, 0x069E, 0x069E}, {0x069F, 0x069F, 0x069F, 0x069F},
- {0x06A0, 0x06A0, 0x06A0, 0x06A0}, {0x06A1, 0x06A1, 0x06A1, 0x06A1},
- {0x06A2, 0x06A2, 0x06A2, 0x06A2}, {0x06A3, 0x06A3, 0x06A3, 0x06A3},
- {0xFB6A, 0xFB6B, 0xFB6C, 0xFB6D}, {0x06A5, 0x06A5, 0x06A5, 0x06A5},
- {0xFB6E, 0xFB6F, 0xFB70, 0xFB71}, {0x06A7, 0x06A7, 0x06A7, 0x06A7},
- {0x06A8, 0x06A8, 0x06A8, 0x06A8}, {0xFB8E, 0xFB8F, 0xFB90, 0xFB91},
- {0x06AA, 0x06AA, 0x06AA, 0x06AA}, {0x06AB, 0x06AB, 0x06AB, 0x06AB},
- {0x06AC, 0x06AC, 0x06AC, 0x06AC}, {0xFBD3, 0xFBD4, 0xFBD5, 0xFBD6},
- {0x06AE, 0x06AE, 0x06AE, 0x06AE}, {0xFB92, 0xFB93, 0xFB94, 0xFB95},
- {0x06B0, 0x06B0, 0x06B0, 0x06B0}, {0xFB9A, 0xFB9B, 0xFB9C, 0xFB9D},
- {0x06B2, 0x06B2, 0x06B2, 0x06B2}, {0xFB96, 0xFB97, 0xFB98, 0xFB99},
- {0x06B4, 0x06B4, 0x06B4, 0x06B4}, {0x06B5, 0x06B5, 0x06B5, 0x06B5},
- {0x06B6, 0x06B6, 0x06B6, 0x06B6}, {0x06B7, 0x06B7, 0x06B7, 0x06B7},
- {0x06B8, 0x06B8, 0x06B8, 0x06B8}, {0x06B9, 0x06B9, 0x06B9, 0x06B9},
- {0xFB9E, 0xFB9F, 0xFBE8, 0xFBE9}, {0xFBA0, 0xFBA1, 0xFBA2, 0xFBA3},
- {0x06BC, 0x06BC, 0x06BC, 0x06BC}, {0x06BD, 0x06BD, 0x06BD, 0x06BD},
- {0xFBAA, 0xFBAB, 0xFBAC, 0xFBAD}, {0x06BF, 0x06BF, 0x06BF, 0x06BF},
- {0xFBA4, 0xFBA5, 0xFBA4, 0xFBA5}, {0xFBA6, 0xFBA7, 0xFBA8, 0xFBA9},
- {0x06C2, 0x06C2, 0x06C2, 0x06C2}, {0x06C3, 0x06C3, 0x06C3, 0x06C3},
- {0x06C4, 0x06C4, 0x06C4, 0x06C4}, {0xFBE0, 0xFBE1, 0xFBE0, 0xFBE1},
- {0xFBD9, 0xFBDA, 0xFBD9, 0xFBDA}, {0xFBD7, 0xFBD8, 0xFBD7, 0xFBD8},
- {0xFBDB, 0xFBDC, 0xFBDB, 0xFBDC}, {0xFBE2, 0xFBE3, 0xFBE2, 0xFBE3},
- {0x06CA, 0x06CA, 0x06CA, 0x06CA}, {0xFBDE, 0xFBDF, 0xFBDE, 0xFBDF},
- {0xFBFC, 0xFBFD, 0xFBFE, 0xFBFF}, {0x06CD, 0x06CD, 0x06CD, 0x06CD},
- {0x06CE, 0x06CE, 0x06CE, 0x06CE}, {0x06CF, 0x06CF, 0x06CF, 0x06CF},
- {0xFBE4, 0xFBE5, 0xFBE6, 0xFBE7}, {0x06D1, 0x06D1, 0x06D1, 0x06D1},
- {0xFBAE, 0xFBAF, 0xFBAE, 0xFBAF}, {0xFBB0, 0xFBB1, 0xFBB0, 0xFBB1},
- {0x06D4, 0x06D4, 0x06D4, 0x06D4}, {0x06D5, 0x06D5, 0x06D5, 0x06D5},
+namespace {
+
+const FX_ARBFORMTABLE g_FX_ArabicFormTables[] = {
+ {0xFE81, 0xFE82, 0xFE81, 0xFE82},
+ {0xFE83, 0xFE84, 0xFE83, 0xFE84},
+ {0xFE85, 0xFE86, 0xFE85, 0xFE86},
+ {0xFE87, 0xFE88, 0xFE87, 0xFE88},
+ {0xFE89, 0xFE8A, 0xFE8B, 0xFE8C},
+ {0xFE8D, 0xFE8E, 0xFE8D, 0xFE8E},
+ {0xFE8F, 0xFE90, 0xFE91, 0xFE92},
+ {0xFE93, 0xFE94, 0xFE93, 0xFE94},
+ {0xFE95, 0xFE96, 0xFE97, 0xFE98},
+ {0xFE99, 0xFE9A, 0xFE9B, 0xFE9C},
+ {0xFE9D, 0xFE9E, 0xFE9F, 0xFEA0},
+ {0xFEA1, 0xFEA2, 0xFEA3, 0xFEA4},
+ {0xFEA5, 0xFEA6, 0xFEA7, 0xFEA8},
+ {0xFEA9, 0xFEAA, 0xFEA9, 0xFEAA},
+ {0xFEAB, 0xFEAC, 0xFEAB, 0xFEAC},
+ {0xFEAD, 0xFEAE, 0xFEAD, 0xFEAE},
+ {0xFEAF, 0xFEB0, 0xFEAF, 0xFEB0},
+ {0xFEB1, 0xFEB2, 0xFEB3, 0xFEB4},
+ {0xFEB5, 0xFEB6, 0xFEB7, 0xFEB8},
+ {0xFEB9, 0xFEBA, 0xFEBB, 0xFEBC},
+ {0xFEBD, 0xFEBE, 0xFEBF, 0xFEC0},
+ {0xFEC1, 0xFEC2, 0xFEC3, 0xFEC4},
+ {0xFEC5, 0xFEC6, 0xFEC7, 0xFEC8},
+ {0xFEC9, 0xFECA, 0xFECB, 0xFECC},
+ {0xFECD, 0xFECE, 0xFECF, 0xFED0},
+ {0x063B, 0x063B, 0x063B, 0x063B},
+ {0x063C, 0x063C, 0x063C, 0x063C},
+ {0x063D, 0x063D, 0x063D, 0x063D},
+ {0x063E, 0x063E, 0x063E, 0x063E},
+ {0x063F, 0x063F, 0x063F, 0x063F},
+ {0x0640, 0x0640, 0x0640, 0x0640},
+ {0xFED1, 0xFED2, 0xFED3, 0xFED4},
+ {0xFED5, 0xFED6, 0xFED7, 0xFED8},
+ {0xFED9, 0xFEDA, 0xFEDB, 0xFEDC},
+ {0xFEDD, 0xFEDE, 0xFEDF, 0xFEE0},
+ {0xFEE1, 0xFEE2, 0xFEE3, 0xFEE4},
+ {0xFEE5, 0xFEE6, 0xFEE7, 0xFEE8},
+ {0xFEE9, 0xFEEA, 0xFEEB, 0xFEEC},
+ {0xFEED, 0xFEEE, 0xFEED, 0xFEEE},
+ {0xFEEF, 0xFEF0, 0xFBFE, 0xFBFF},
+ {0xFEF1, 0xFEF2, 0xFEF3, 0xFEF4},
+ {0x064B, 0x064B, 0x064B, 0x064B},
+ {0x064C, 0x064C, 0x064C, 0x064C},
+ {0x064D, 0x064D, 0x064D, 0x064D},
+ {0x064E, 0x064E, 0x064E, 0x064E},
+ {0x064F, 0x064F, 0x064F, 0x064F},
+ {0x0650, 0x0650, 0x0650, 0x0650},
+ {0x0651, 0x0651, 0x0651, 0x0651},
+ {0x0652, 0x0652, 0x0652, 0x0652},
+ {0x0653, 0x0653, 0x0653, 0x0653},
+ {0x0654, 0x0654, 0x0654, 0x0654},
+ {0x0655, 0x0655, 0x0655, 0x0655},
+ {0x0656, 0x0656, 0x0656, 0x0656},
+ {0x0657, 0x0657, 0x0657, 0x0657},
+ {0x0658, 0x0658, 0x0658, 0x0658},
+ {0x0659, 0x0659, 0x0659, 0x0659},
+ {0x065A, 0x065A, 0x065A, 0x065A},
+ {0x065B, 0x065B, 0x065B, 0x065B},
+ {0x065C, 0x065C, 0x065C, 0x065C},
+ {0x065D, 0x065D, 0x065D, 0x065D},
+ {0x065E, 0x065E, 0x065E, 0x065E},
+ {0x065F, 0x065F, 0x065F, 0x065F},
+ {0x0660, 0x0660, 0x0660, 0x0660},
+ {0x0661, 0x0661, 0x0661, 0x0661},
+ {0x0662, 0x0662, 0x0662, 0x0662},
+ {0x0663, 0x0663, 0x0663, 0x0663},
+ {0x0664, 0x0664, 0x0664, 0x0664},
+ {0x0665, 0x0665, 0x0665, 0x0665},
+ {0x0666, 0x0666, 0x0666, 0x0666},
+ {0x0667, 0x0667, 0x0667, 0x0667},
+ {0x0668, 0x0668, 0x0668, 0x0668},
+ {0x0669, 0x0669, 0x0669, 0x0669},
+ {0x066A, 0x066A, 0x066A, 0x066A},
+ {0x066B, 0x066B, 0x066B, 0x066B},
+ {0x066C, 0x066C, 0x066C, 0x066C},
+ {0x066D, 0x066D, 0x066D, 0x066D},
+ {0x066E, 0x066E, 0x066E, 0x066E},
+ {0x066F, 0x066F, 0x066F, 0x066F},
+ {0x0670, 0x0670, 0x0670, 0x0670},
+ {0xFB50, 0xFB51, 0xFB50, 0xFB51},
+ {0x0672, 0x0672, 0x0672, 0x0672},
+ {0x0673, 0x0673, 0x0673, 0x0673},
+ {0x0674, 0x0674, 0x0674, 0x0674},
+ {0x0675, 0x0675, 0x0675, 0x0675},
+ {0x0676, 0x0676, 0x0676, 0x0676},
+ {0x0677, 0x0677, 0x0677, 0x0677},
+ {0x0678, 0x0678, 0x0678, 0x0678},
+ {0xFB66, 0xFB67, 0xFB68, 0xFB69},
+ {0xFB5E, 0xFB5F, 0xFB60, 0xFB61},
+ {0xFB52, 0xFB53, 0xFB54, 0xFB55},
+ {0x067C, 0x067C, 0x067C, 0x067C},
+ {0x067D, 0x067D, 0x067D, 0x067D},
+ {0xFB56, 0xFB57, 0xFB58, 0xFB59},
+ {0xFB62, 0xFB63, 0xFB64, 0xFB65},
+ {0xFB5A, 0xFB5B, 0xFB5C, 0xFB5D},
+ {0x0681, 0x0681, 0x0681, 0x0681},
+ {0x0682, 0x0682, 0x0682, 0x0682},
+ {0xFB76, 0xFB77, 0xFB78, 0xFB79},
+ {0xFB72, 0xFB73, 0xFB74, 0xFB75},
+ {0x0685, 0x0685, 0x0685, 0x0685},
+ {0xFB7A, 0xFB7B, 0xFB7C, 0xFB7D},
+ {0xFB7E, 0xFB7F, 0xFB80, 0xFB81},
+ {0xFB88, 0xFB89, 0xFB88, 0xFB89},
+ {0x0689, 0x0689, 0x0689, 0x0689},
+ {0x068A, 0x068A, 0x068A, 0x068A},
+ {0x068B, 0x068B, 0x068B, 0x068B},
+ {0xFB84, 0xFB85, 0xFB84, 0xFB85},
+ {0xFB82, 0xFB83, 0xFB82, 0xFB83},
+ {0xFB86, 0xFB87, 0xFB86, 0xFB87},
+ {0x068F, 0x068F, 0x068F, 0x068F},
+ {0x0690, 0x0690, 0x0690, 0x0690},
+ {0xFB8C, 0xFB8D, 0xFB8C, 0xFB8D},
+ {0x0692, 0x0692, 0x0692, 0x0692},
+ {0x0693, 0x0693, 0x0693, 0x0693},
+ {0x0694, 0x0694, 0x0694, 0x0694},
+ {0x0695, 0x0695, 0x0695, 0x0695},
+ {0x0696, 0x0696, 0x0696, 0x0696},
+ {0x0697, 0x0697, 0x0697, 0x0697},
+ {0xFB8A, 0xFB8B, 0xFB8A, 0xFB8B},
+ {0x0699, 0x0699, 0x0699, 0x0699},
+ {0x069A, 0x069A, 0x069A, 0x069A},
+ {0x069B, 0x069B, 0x069B, 0x069B},
+ {0x069C, 0x069C, 0x069C, 0x069C},
+ {0x069D, 0x069D, 0x069D, 0x069D},
+ {0x069E, 0x069E, 0x069E, 0x069E},
+ {0x069F, 0x069F, 0x069F, 0x069F},
+ {0x06A0, 0x06A0, 0x06A0, 0x06A0},
+ {0x06A1, 0x06A1, 0x06A1, 0x06A1},
+ {0x06A2, 0x06A2, 0x06A2, 0x06A2},
+ {0x06A3, 0x06A3, 0x06A3, 0x06A3},
+ {0xFB6A, 0xFB6B, 0xFB6C, 0xFB6D},
+ {0x06A5, 0x06A5, 0x06A5, 0x06A5},
+ {0xFB6E, 0xFB6F, 0xFB70, 0xFB71},
+ {0x06A7, 0x06A7, 0x06A7, 0x06A7},
+ {0x06A8, 0x06A8, 0x06A8, 0x06A8},
+ {0xFB8E, 0xFB8F, 0xFB90, 0xFB91},
+ {0x06AA, 0x06AA, 0x06AA, 0x06AA},
+ {0x06AB, 0x06AB, 0x06AB, 0x06AB},
+ {0x06AC, 0x06AC, 0x06AC, 0x06AC},
+ {0xFBD3, 0xFBD4, 0xFBD5, 0xFBD6},
+ {0x06AE, 0x06AE, 0x06AE, 0x06AE},
+ {0xFB92, 0xFB93, 0xFB94, 0xFB95},
+ {0x06B0, 0x06B0, 0x06B0, 0x06B0},
+ {0xFB9A, 0xFB9B, 0xFB9C, 0xFB9D},
+ {0x06B2, 0x06B2, 0x06B2, 0x06B2},
+ {0xFB96, 0xFB97, 0xFB98, 0xFB99},
+ {0x06B4, 0x06B4, 0x06B4, 0x06B4},
+ {0x06B5, 0x06B5, 0x06B5, 0x06B5},
+ {0x06B6, 0x06B6, 0x06B6, 0x06B6},
+ {0x06B7, 0x06B7, 0x06B7, 0x06B7},
+ {0x06B8, 0x06B8, 0x06B8, 0x06B8},
+ {0x06B9, 0x06B9, 0x06B9, 0x06B9},
+ {0xFB9E, 0xFB9F, 0xFBE8, 0xFBE9},
+ {0xFBA0, 0xFBA1, 0xFBA2, 0xFBA3},
+ {0x06BC, 0x06BC, 0x06BC, 0x06BC},
+ {0x06BD, 0x06BD, 0x06BD, 0x06BD},
+ {0xFBAA, 0xFBAB, 0xFBAC, 0xFBAD},
+ {0x06BF, 0x06BF, 0x06BF, 0x06BF},
+ {0xFBA4, 0xFBA5, 0xFBA4, 0xFBA5},
+ {0xFBA6, 0xFBA7, 0xFBA8, 0xFBA9},
+ {0x06C2, 0x06C2, 0x06C2, 0x06C2},
+ {0x06C3, 0x06C3, 0x06C3, 0x06C3},
+ {0x06C4, 0x06C4, 0x06C4, 0x06C4},
+ {0xFBE0, 0xFBE1, 0xFBE0, 0xFBE1},
+ {0xFBD9, 0xFBDA, 0xFBD9, 0xFBDA},
+ {0xFBD7, 0xFBD8, 0xFBD7, 0xFBD8},
+ {0xFBDB, 0xFBDC, 0xFBDB, 0xFBDC},
+ {0xFBE2, 0xFBE3, 0xFBE2, 0xFBE3},
+ {0x06CA, 0x06CA, 0x06CA, 0x06CA},
+ {0xFBDE, 0xFBDF, 0xFBDE, 0xFBDF},
+ {0xFBFC, 0xFBFD, 0xFBFE, 0xFBFF},
+ {0x06CD, 0x06CD, 0x06CD, 0x06CD},
+ {0x06CE, 0x06CE, 0x06CE, 0x06CE},
+ {0x06CF, 0x06CF, 0x06CF, 0x06CF},
+ {0xFBE4, 0xFBE5, 0xFBE6, 0xFBE7},
+ {0x06D1, 0x06D1, 0x06D1, 0x06D1},
+ {0xFBAE, 0xFBAF, 0xFBAE, 0xFBAF},
+ {0xFBB0, 0xFBB1, 0xFBB0, 0xFBB1},
+ {0x06D4, 0x06D4, 0x06D4, 0x06D4},
+ {0x06D5, 0x06D5, 0x06D5, 0x06D5},
};
-static const FX_ARAALEF gs_FX_AlefTable[] = {
+
+const FX_ARAALEF gs_FX_AlefTable[] = {
{0x0622, 0xFEF5},
{0x0623, 0xFEF7},
{0x0625, 0xFEF9},
{0x0627, 0xFEFB},
};
-static const FX_ARASHADDA gs_FX_ShaddaTable[] = {
- {0x064C, 0xFC5E}, {0x064D, 0xFC5F}, {0x064E, 0xFC60},
- {0x064F, 0xFC61}, {0x0650, 0xFC62},
+
+const FX_ARASHADDA gs_FX_ShaddaTable[] = {
+ {0x064C, 0xFC5E},
+ {0x064D, 0xFC5F},
+ {0x064E, 0xFC60},
+ {0x064F, 0xFC61},
+ {0x0650, 0xFC62},
};
-FX_LPCARBFORMTABLE FX_GetArabicFormTable(FX_WCHAR unicode) {
+
+} // namespace
+
+const FX_ARBFORMTABLE* FX_GetArabicFormTable(FX_WCHAR unicode) {
if (unicode < 0x622 || unicode > 0x6d5) {
return NULL;
}
@@ -140,9 +237,7 @@ FX_WCHAR FX_GetArabicFromShaddaTable(FX_WCHAR shadda) {
}
return shadda;
}
-#ifdef __cplusplus
-};
-#endif
+
IFX_ArabicChar* IFX_ArabicChar::Create() {
return new CFX_ArabicChar;
}
@@ -168,7 +263,7 @@ FX_WCHAR CFX_ArabicChar::GetFormChar(const CFX_Char* cur,
const CFX_Char* next) const {
FX_CHARTYPE eCur;
FX_WCHAR wCur;
- FX_LPCARBFORMTABLE ft = ParseChar(cur, wCur, eCur);
+ const FX_ARBFORMTABLE* ft = ParseChar(cur, wCur, eCur);
if (eCur < FX_CHARTYPE_ArabicAlef || eCur >= FX_CHARTYPE_ArabicNormal) {
return wCur;
}
@@ -200,9 +295,9 @@ FX_WCHAR CFX_ArabicChar::GetFormChar(const CFX_Char* cur,
}
}
}
-FX_LPCARBFORMTABLE CFX_ArabicChar::ParseChar(const CFX_Char* pTC,
- FX_WCHAR& wChar,
- FX_CHARTYPE& eType) const {
+const FX_ARBFORMTABLE* CFX_ArabicChar::ParseChar(const CFX_Char* pTC,
+ FX_WCHAR& wChar,
+ FX_CHARTYPE& eType) const {
if (pTC == NULL) {
eType = FX_CHARTYPE_Unknown;
wChar = 0xFEFF;
@@ -210,7 +305,7 @@ FX_LPCARBFORMTABLE CFX_ArabicChar::ParseChar(const CFX_Char* pTC,
}
eType = (FX_CHARTYPE)pTC->GetCharType();
wChar = (FX_WCHAR)pTC->m_wCharCode;
- FX_LPCARBFORMTABLE pFT = FX_GetArabicFormTable(wChar);
+ const FX_ARBFORMTABLE* pFT = FX_GetArabicFormTable(wChar);
if (pFT == NULL || eType >= FX_CHARTYPE_ArabicNormal) {
eType = FX_CHARTYPE_Unknown;
}
@@ -1053,77 +1148,3 @@ void FX_BidiLine(CFX_RTFCharArray& chars, int32_t iCount, int32_t iBaseLevel) {
CFX_BidiLineTemplate<CFX_RTFChar> blt;
blt.FX_BidiLine(chars, iCount, iBaseLevel);
}
-IFX_BidiChar* IFX_BidiChar::Create() {
- return new CFX_BidiChar;
-}
-CFX_BidiChar::CFX_BidiChar()
- : m_bSeparateNeutral(TRUE),
- m_iCurStart(0),
- m_iCurCount(0),
- m_iCurBidi(0),
- m_iLastBidi(0),
- m_iLastStart(0),
- m_iLastCount(0) {}
-void CFX_BidiChar::SetPolicy(FX_BOOL bSeparateNeutral) {
- m_bSeparateNeutral = bSeparateNeutral;
-}
-
-FX_BOOL CFX_BidiChar::AppendChar(FX_WCHAR wch) {
- FX_DWORD dwProps = kTextLayoutCodeProperties[(FX_WORD)wch];
- int32_t iBidiCls = (dwProps & FX_BIDICLASSBITSMASK) >> FX_BIDICLASSBITS;
- int32_t iContext = 0;
- switch (iBidiCls) {
- case FX_BIDICLASS_L:
- case FX_BIDICLASS_AN:
- case FX_BIDICLASS_EN:
- iContext = 1;
- break;
- case FX_BIDICLASS_R:
- case FX_BIDICLASS_AL:
- iContext = 2;
- break;
- }
- FX_BOOL bRet = FALSE;
- if (iContext != m_iCurBidi) {
- if (m_bSeparateNeutral) {
- bRet = TRUE;
- } else {
- if (m_iCurBidi == 0) {
- bRet = (m_iCurCount > 0);
- } else {
- bRet = (iContext != 0);
- }
- }
- if (bRet) {
- m_iLastBidi = m_iCurBidi;
- m_iLastStart = m_iCurStart;
- m_iCurStart = m_iCurCount;
- m_iLastCount = m_iCurCount - m_iLastStart;
- }
- if (m_bSeparateNeutral || iContext != 0) {
- m_iCurBidi = iContext;
- }
- }
- m_iCurCount++;
- return bRet;
-}
-FX_BOOL CFX_BidiChar::EndChar() {
- m_iLastBidi = m_iCurBidi;
- m_iLastStart = m_iCurStart;
- m_iCurStart = m_iCurCount;
- m_iLastCount = m_iCurCount - m_iLastStart;
- return m_iLastCount > 0;
-}
-int32_t CFX_BidiChar::GetBidiInfo(int32_t& iStart, int32_t& iCount) {
- iStart = m_iLastStart;
- iCount = m_iLastCount;
- return m_iLastBidi;
-}
-void CFX_BidiChar::Reset() {
- m_iCurStart = 0;
- m_iCurCount = 0;
- m_iCurBidi = 0;
- m_iLastBidi = 0;
- m_iLastStart = 0;
- m_iLastCount = 0;
-}