summaryrefslogtreecommitdiff
path: root/xfa/src/fxbarcode/src/BC_PDF417DecodedBitStreamParser.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'xfa/src/fxbarcode/src/BC_PDF417DecodedBitStreamParser.cpp')
-rw-r--r--xfa/src/fxbarcode/src/BC_PDF417DecodedBitStreamParser.cpp16
1 files changed, 5 insertions, 11 deletions
diff --git a/xfa/src/fxbarcode/src/BC_PDF417DecodedBitStreamParser.cpp b/xfa/src/fxbarcode/src/BC_PDF417DecodedBitStreamParser.cpp
index cf0a1490f4..b832ab94aa 100644
--- a/xfa/src/fxbarcode/src/BC_PDF417DecodedBitStreamParser.cpp
+++ b/xfa/src/fxbarcode/src/BC_PDF417DecodedBitStreamParser.cpp
@@ -18,8 +18,8 @@
#define BEGIN_MACRO_PDF417_OPTIONAL_FIELD 923
#define MACRO_PDF417_TERMINATOR 922
#define MODE_SHIFT_TO_BYTE_COMPACTION_MODE 913
+
FX_INT32 CBC_DecodedBitStreamPaser::MAX_NUMERIC_CODEWORDS = 15;
-FX_INT32 CBC_DecodedBitStreamPaser::EXP900[16] = {0};
FX_INT32 CBC_DecodedBitStreamPaser::NUMBER_OF_SEQUENCE_CODEWORDS = 2;
FX_INT32 CBC_DecodedBitStreamPaser::PL = 25;
FX_INT32 CBC_DecodedBitStreamPaser::LL = 27;
@@ -40,12 +40,6 @@ FX_CHAR CBC_DecodedBitStreamPaser::MIXED_CHARS[30] = {
};
void CBC_DecodedBitStreamPaser::Initialize()
{
- EXP900[0] = 1;
- FX_INT32 nineHundred = 900;
- EXP900[1] = nineHundred;
- for (FX_INT32 i = 2; i < sizeof(EXP900) / sizeof(FX_INT32); i++) {
- EXP900[i] = EXP900[i - 1] * nineHundred;
- }
}
void CBC_DecodedBitStreamPaser::Finalize()
{
@@ -460,12 +454,12 @@ FX_INT32 CBC_DecodedBitStreamPaser::numericCompaction(CFX_Int32Array &codewords,
}
CFX_ByteString CBC_DecodedBitStreamPaser::decodeBase900toBase10(CFX_Int32Array &codewords, FX_INT32 count, FX_INT32 &e)
{
- FX_INT32 result = 0;
+ BigInteger result = 0;
+ BigInteger nineHundred(900);
for (FX_INT32 i = 0; i < count; i++) {
- result += EXP900[count - i - 1] * codewords[i];
+ result = result * nineHundred + BigInteger(codewords[i]);
}
- CFX_ByteString resultString;
- resultString = resultString.FormatInteger(result);
+ CFX_ByteString resultString(bigIntegerToString(result).c_str());
if (resultString.GetAt(0) != '1') {
e = BCExceptionFormatInstance;
return ' ';