diff options
author | Lei Zhang <thestig@chromium.org> | 2018-01-12 21:49:50 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-01-12 21:49:50 +0000 |
commit | 53c4ba4011ab59ecc8406e144df8aaaa1169801b (patch) | |
tree | e35e5a2e9ae3dbc9e57d2ad28ded618e23019988 /fxbarcode/oned/BC_OnedEAN8Writer.cpp | |
parent | 14e77443e92ce3fdf1cebe85f8f5c8fe705a1558 (diff) | |
download | pdfium-53c4ba4011ab59ecc8406e144df8aaaa1169801b.tar.xz |
Add jumbo build support for fxbarcode.
BUG=pdfium:964
Change-Id: Ic306a374bc9b710e2ac043eebe43504e5bd75926
Reviewed-on: https://pdfium-review.googlesource.com/22870
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
Diffstat (limited to 'fxbarcode/oned/BC_OnedEAN8Writer.cpp')
-rw-r--r-- | fxbarcode/oned/BC_OnedEAN8Writer.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/fxbarcode/oned/BC_OnedEAN8Writer.cpp b/fxbarcode/oned/BC_OnedEAN8Writer.cpp index 865979c396..988528ed09 100644 --- a/fxbarcode/oned/BC_OnedEAN8Writer.cpp +++ b/fxbarcode/oned/BC_OnedEAN8Writer.cpp @@ -36,9 +36,9 @@ namespace { -const int8_t START_END_PATTERN[3] = {1, 1, 1}; -const int8_t MIDDLE_PATTERN[5] = {1, 1, 1, 1, 1}; -const int8_t L_PATTERNS[10][4] = { +const int8_t kOnedEAN8StartPattern[3] = {1, 1, 1}; +const int8_t kOnedEAN8MiddlePattern[5] = {1, 1, 1, 1, 1}; +const int8_t kOnedEAN8LPattern[10][4] = { {3, 2, 1, 1}, {2, 2, 2, 1}, {2, 1, 2, 2}, {1, 4, 1, 1}, {1, 1, 3, 2}, {1, 2, 3, 1}, {1, 1, 1, 4}, {1, 3, 1, 2}, {1, 2, 1, 3}, {3, 1, 1, 2}}; @@ -108,28 +108,28 @@ uint8_t* CBC_OnedEAN8Writer::EncodeImpl(const ByteString& contents, FX_Alloc(uint8_t, m_codeWidth)); int32_t pos = 0; int32_t e = BCExceptionNO; - pos += AppendPattern(result.get(), pos, START_END_PATTERN, 3, 1, e); + pos += AppendPattern(result.get(), pos, kOnedEAN8StartPattern, 3, 1, e); if (e != BCExceptionNO) return nullptr; int32_t i = 0; for (i = 0; i <= 3; i++) { int32_t digit = FXSYS_DecimalCharToInt(contents[i]); - pos += AppendPattern(result.get(), pos, L_PATTERNS[digit], 4, 0, e); + pos += AppendPattern(result.get(), pos, kOnedEAN8LPattern[digit], 4, 0, e); if (e != BCExceptionNO) return nullptr; } - pos += AppendPattern(result.get(), pos, MIDDLE_PATTERN, 5, 0, e); + pos += AppendPattern(result.get(), pos, kOnedEAN8MiddlePattern, 5, 0, e); if (e != BCExceptionNO) return nullptr; for (i = 4; i <= 7; i++) { int32_t digit = FXSYS_DecimalCharToInt(contents[i]); - pos += AppendPattern(result.get(), pos, L_PATTERNS[digit], 4, 1, e); + pos += AppendPattern(result.get(), pos, kOnedEAN8LPattern[digit], 4, 1, e); if (e != BCExceptionNO) return nullptr; } - pos += AppendPattern(result.get(), pos, START_END_PATTERN, 3, 1, e); + pos += AppendPattern(result.get(), pos, kOnedEAN8StartPattern, 3, 1, e); if (e != BCExceptionNO) return nullptr; return result.release(); |