summaryrefslogtreecommitdiff
path: root/core/fxcrt/fx_bidi.cpp
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2017-08-31 14:53:44 -0400
committerChromium commit bot <commit-bot@chromium.org>2017-08-31 19:20:55 +0000
commit47a90b894ecca2d3547226169602d7f8729d564f (patch)
tree117cc6d17c8887e10dbf8ba315d7605d9191d2a0 /core/fxcrt/fx_bidi.cpp
parent235818f45eda6fd47114c076bfa818b2ef3ba894 (diff)
downloadpdfium-47a90b894ecca2d3547226169602d7f8729d564f.tar.xz
More BIDI code shufflingchromium/3206chromium/3205
Change-Id: I6df7e7d1283541ea2e6b9bcf3de172f6a886054a Reviewed-on: https://pdfium-review.googlesource.com/12731 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'core/fxcrt/fx_bidi.cpp')
-rw-r--r--core/fxcrt/fx_bidi.cpp32
1 files changed, 30 insertions, 2 deletions
diff --git a/core/fxcrt/fx_bidi.cpp b/core/fxcrt/fx_bidi.cpp
index 8b20cfbf46..5b5b1982cc 100644
--- a/core/fxcrt/fx_bidi.cpp
+++ b/core/fxcrt/fx_bidi.cpp
@@ -13,9 +13,37 @@
#ifdef PDF_ENABLE_XFA
#include "core/fxcrt/fx_extension.h"
+#endif // PDF_ENABLE_XFA
namespace {
+enum FX_BIDICLASS {
+ FX_BIDICLASS_ON = 0, // Other Neutral
+ FX_BIDICLASS_L = 1, // Left Letter
+ FX_BIDICLASS_R = 2, // Right Letter
+ FX_BIDICLASS_AN = 3, // Arabic Number
+ FX_BIDICLASS_EN = 4, // European Number
+ FX_BIDICLASS_AL = 5, // Arabic Letter
+ FX_BIDICLASS_NSM = 6, // Non-spacing Mark
+ FX_BIDICLASS_CS = 7, // Common Number Separator
+ FX_BIDICLASS_ES = 8, // European Separator
+ FX_BIDICLASS_ET = 9, // European Number Terminator
+ FX_BIDICLASS_BN = 10, // Boundary Neutral
+ FX_BIDICLASS_S = 11, // Segment Separator
+ FX_BIDICLASS_WS = 12, // Whitespace
+ FX_BIDICLASS_B = 13, // Paragraph Separator
+ FX_BIDICLASS_RLO = 14, // Right-to-Left Override
+ FX_BIDICLASS_RLE = 15, // Right-to-Left Embedding
+ FX_BIDICLASS_LRO = 16, // Left-to-Right Override
+ FX_BIDICLASS_LRE = 17, // Left-to-Right Embedding
+ FX_BIDICLASS_PDF = 18, // Pop Directional Format
+ FX_BIDICLASS_N = FX_BIDICLASS_ON,
+};
+constexpr uint32_t FX_BIDICLASSBITS = 6;
+constexpr uint32_t FX_BIDICLASSBITSMASK = 0x1F << FX_BIDICLASSBITS;
+
+#ifdef PDF_ENABLE_XFA
+
#ifndef NDEBUG
constexpr int32_t kBidiMaxLevel = 61;
#endif // NDEBUG
@@ -510,10 +538,10 @@ class CFX_BidiLine {
}
};
-} // namespace
-
#endif // PDF_ENABLE_XFA
+} // namespace
+
CFX_BidiChar::CFX_BidiChar()
: m_CurrentSegment({0, 0, NEUTRAL}), m_LastSegment({0, 0, NEUTRAL}) {}