diff options
author | thestig <thestig@chromium.org> | 2016-06-09 18:39:33 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-06-09 18:39:33 -0700 |
commit | 6dc1d7753691c0ff2f390e8ffd95a3182064487e (patch) | |
tree | 43d77664973a76c107832ae7b3c3e0f04bba1fe0 /xfa/fxbarcode/datamatrix | |
parent | fcf61b39ee597c73e80ba789833fb7fe49878422 (diff) | |
download | pdfium-6dc1d7753691c0ff2f390e8ffd95a3182064487e.tar.xz |
Get rid of NULLs in xfa/fxbarcode/
Review-Url: https://codereview.chromium.org/2048983002
Diffstat (limited to 'xfa/fxbarcode/datamatrix')
-rw-r--r-- | xfa/fxbarcode/datamatrix/BC_DataMatrixBitMatrixParser.cpp | 12 | ||||
-rw-r--r-- | xfa/fxbarcode/datamatrix/BC_DataMatrixDataBlock.cpp | 2 | ||||
-rw-r--r-- | xfa/fxbarcode/datamatrix/BC_DataMatrixDecoder.cpp | 2 | ||||
-rw-r--r-- | xfa/fxbarcode/datamatrix/BC_DataMatrixReader.cpp | 2 | ||||
-rw-r--r-- | xfa/fxbarcode/datamatrix/BC_DataMatrixWriter.cpp | 22 | ||||
-rw-r--r-- | xfa/fxbarcode/datamatrix/BC_EncoderContext.cpp | 8 | ||||
-rw-r--r-- | xfa/fxbarcode/datamatrix/BC_HighLevelEncoder.cpp | 2 | ||||
-rw-r--r-- | xfa/fxbarcode/datamatrix/BC_SymbolInfo.cpp | 114 | ||||
-rw-r--r-- | xfa/fxbarcode/datamatrix/BC_SymbolInfo.h | 10 |
9 files changed, 84 insertions, 90 deletions
diff --git a/xfa/fxbarcode/datamatrix/BC_DataMatrixBitMatrixParser.cpp b/xfa/fxbarcode/datamatrix/BC_DataMatrixBitMatrixParser.cpp index a0c00e9506..10d5a843e2 100644 --- a/xfa/fxbarcode/datamatrix/BC_DataMatrixBitMatrixParser.cpp +++ b/xfa/fxbarcode/datamatrix/BC_DataMatrixBitMatrixParser.cpp @@ -29,9 +29,9 @@ #include "xfa/fxbarcode/utils.h" CBC_DataMatrixBitMatrixParser::CBC_DataMatrixBitMatrixParser() { - m_mappingBitMatrix = NULL; - m_version = NULL; - m_readMappingMatrix = NULL; + m_mappingBitMatrix = nullptr; + m_version = nullptr; + m_readMappingMatrix = nullptr; } void CBC_DataMatrixBitMatrixParser::Init(CBC_CommonBitMatrix* bitMatrix, int32_t& e) { @@ -62,7 +62,7 @@ CBC_DataMatrixVersion* CBC_DataMatrixBitMatrixParser::ReadVersion( int32_t columns = bitMatrix->GetWidth(); CBC_DataMatrixVersion* temp = CBC_DataMatrixVersion::GetVersionForDimensions(rows, columns, e); - BC_EXCEPTION_CHECK_ReturnValue(e, NULL); + BC_EXCEPTION_CHECK_ReturnValue(e, nullptr); return temp; } CFX_ByteArray* CBC_DataMatrixBitMatrixParser::ReadCodewords(int32_t& e) { @@ -132,7 +132,7 @@ CFX_ByteArray* CBC_DataMatrixBitMatrixParser::ReadCodewords(int32_t& e) { } while ((row < numRows) || (column < numColumns)); if (resultOffset != m_version->GetTotalCodewords()) { e = BCExceptionFormatException; - return NULL; + return nullptr; } return result.release(); } @@ -340,7 +340,7 @@ CBC_CommonBitMatrix* CBC_DataMatrixBitMatrixParser::ExtractDataRegion( int32_t symbolSizeColumns = m_version->GetSymbolSizeColumns(); if (bitMatrix->GetHeight() != symbolSizeRows) { e = BCExceptionCanNotCallGetDimensionOnNonSquareMatrix; - return NULL; + return nullptr; } int32_t dataRegionSizeRows = m_version->GetDataRegionSizeRows(); int32_t dataRegionSizeColumns = m_version->GetDataRegionSizeColumns(); diff --git a/xfa/fxbarcode/datamatrix/BC_DataMatrixDataBlock.cpp b/xfa/fxbarcode/datamatrix/BC_DataMatrixDataBlock.cpp index a41e46afc9..9371dc42e8 100644 --- a/xfa/fxbarcode/datamatrix/BC_DataMatrixDataBlock.cpp +++ b/xfa/fxbarcode/datamatrix/BC_DataMatrixDataBlock.cpp @@ -90,7 +90,7 @@ CBC_DataMatrixDataBlock::GetDataBlocks(CFX_ByteArray* rawCodewords, } if (rawCodewordsOffset != rawCodewords->GetSize()) { e = BCExceptionIllegalArgument; - return NULL; + return nullptr; } return result.release(); } diff --git a/xfa/fxbarcode/datamatrix/BC_DataMatrixDecoder.cpp b/xfa/fxbarcode/datamatrix/BC_DataMatrixDecoder.cpp index ffa0a4d9d1..5bfd51b09a 100644 --- a/xfa/fxbarcode/datamatrix/BC_DataMatrixDecoder.cpp +++ b/xfa/fxbarcode/datamatrix/BC_DataMatrixDecoder.cpp @@ -33,7 +33,7 @@ #include "xfa/fxbarcode/datamatrix/BC_DataMatrixVersion.h" CBC_DataMatrixDecoder::CBC_DataMatrixDecoder() { - m_rsDecoder = NULL; + m_rsDecoder = nullptr; } void CBC_DataMatrixDecoder::Init() { m_rsDecoder = diff --git a/xfa/fxbarcode/datamatrix/BC_DataMatrixReader.cpp b/xfa/fxbarcode/datamatrix/BC_DataMatrixReader.cpp index 9a22d4db3a..31d95b0cb7 100644 --- a/xfa/fxbarcode/datamatrix/BC_DataMatrixReader.cpp +++ b/xfa/fxbarcode/datamatrix/BC_DataMatrixReader.cpp @@ -33,7 +33,7 @@ #include "xfa/fxbarcode/utils.h" CBC_DataMatrixReader::CBC_DataMatrixReader() { - m_decoder = NULL; + m_decoder = nullptr; } void CBC_DataMatrixReader::Init() { m_decoder = new CBC_DataMatrixDecoder; diff --git a/xfa/fxbarcode/datamatrix/BC_DataMatrixWriter.cpp b/xfa/fxbarcode/datamatrix/BC_DataMatrixWriter.cpp index 03cd5fba50..f056ece258 100644 --- a/xfa/fxbarcode/datamatrix/BC_DataMatrixWriter.cpp +++ b/xfa/fxbarcode/datamatrix/BC_DataMatrixWriter.cpp @@ -55,29 +55,29 @@ uint8_t* CBC_DataMatrixWriter::Encode(const CFX_WideString& contents, int32_t& e) { if (outWidth < 0 || outHeight < 0) { e = BCExceptionHeightAndWidthMustBeAtLeast1; - BC_EXCEPTION_CHECK_ReturnValue(e, NULL); + BC_EXCEPTION_CHECK_ReturnValue(e, nullptr); } CBC_SymbolShapeHint::SymbolShapeHint shape = CBC_SymbolShapeHint::FORCE_SQUARE; - CBC_Dimension* minSize = NULL; - CBC_Dimension* maxSize = NULL; + CBC_Dimension* minSize = nullptr; + CBC_Dimension* maxSize = nullptr; CFX_WideString ecLevel; CFX_WideString encoded = CBC_HighLevelEncoder::encodeHighLevel( contents, ecLevel, shape, minSize, maxSize, e); - BC_EXCEPTION_CHECK_ReturnValue(e, NULL); + BC_EXCEPTION_CHECK_ReturnValue(e, nullptr); CBC_SymbolInfo* symbolInfo = CBC_SymbolInfo::lookup( encoded.GetLength(), shape, minSize, maxSize, TRUE, e); - BC_EXCEPTION_CHECK_ReturnValue(e, NULL); + BC_EXCEPTION_CHECK_ReturnValue(e, nullptr); CFX_WideString codewords = CBC_ErrorCorrection::encodeECC200(encoded, symbolInfo, e); - BC_EXCEPTION_CHECK_ReturnValue(e, NULL); + BC_EXCEPTION_CHECK_ReturnValue(e, nullptr); CBC_DefaultPlacement* placement = new CBC_DefaultPlacement(codewords, symbolInfo->getSymbolDataWidth(e), symbolInfo->getSymbolDataHeight(e)); - BC_EXCEPTION_CHECK_ReturnValue(e, NULL); + BC_EXCEPTION_CHECK_ReturnValue(e, nullptr); placement->place(); CBC_CommonByteMatrix* bytematrix = encodeLowLevel(placement, symbolInfo, e); - BC_EXCEPTION_CHECK_ReturnValue(e, NULL); + BC_EXCEPTION_CHECK_ReturnValue(e, nullptr); outWidth = bytematrix->GetWidth(); outHeight = bytematrix->GetHeight(); uint8_t* result = FX_Alloc2D(uint8_t, outWidth, outHeight); @@ -91,12 +91,12 @@ CBC_CommonByteMatrix* CBC_DataMatrixWriter::encodeLowLevel( CBC_SymbolInfo* symbolInfo, int32_t& e) { int32_t symbolWidth = symbolInfo->getSymbolDataWidth(e); - BC_EXCEPTION_CHECK_ReturnValue(e, NULL); + BC_EXCEPTION_CHECK_ReturnValue(e, nullptr); int32_t symbolHeight = symbolInfo->getSymbolDataHeight(e); - BC_EXCEPTION_CHECK_ReturnValue(e, NULL); + BC_EXCEPTION_CHECK_ReturnValue(e, nullptr); CBC_CommonByteMatrix* matrix = new CBC_CommonByteMatrix( symbolInfo->getSymbolWidth(e), symbolInfo->getSymbolHeight(e)); - BC_EXCEPTION_CHECK_ReturnValue(e, NULL); + BC_EXCEPTION_CHECK_ReturnValue(e, nullptr); matrix->Init(); int32_t matrixY = 0; for (int32_t y = 0; y < symbolHeight; y++) { diff --git a/xfa/fxbarcode/datamatrix/BC_EncoderContext.cpp b/xfa/fxbarcode/datamatrix/BC_EncoderContext.cpp index c99dcb7d7a..6e395837d4 100644 --- a/xfa/fxbarcode/datamatrix/BC_EncoderContext.cpp +++ b/xfa/fxbarcode/datamatrix/BC_EncoderContext.cpp @@ -46,10 +46,10 @@ CBC_EncoderContext::CBC_EncoderContext(const CFX_WideString msg, m_shape = FORCE_NONE; m_newEncoding = -1; m_pos = 0; - m_symbolInfo = NULL; + m_symbolInfo = nullptr; m_skipAtEnd = 0; - m_maxSize = NULL; - m_minSize = NULL; + m_maxSize = nullptr; + m_minSize = nullptr; } CBC_EncoderContext::~CBC_EncoderContext() {} void CBC_EncoderContext::setSymbolShape(SymbolShapeHint shape) { @@ -97,7 +97,7 @@ void CBC_EncoderContext::updateSymbolInfo(int32_t& e) { updateSymbolInfo(getCodewordCount(), e); } void CBC_EncoderContext::updateSymbolInfo(int32_t len, int32_t& e) { - if (m_symbolInfo == NULL || len > m_symbolInfo->m_dataCapacity) { + if (!m_symbolInfo || len > m_symbolInfo->m_dataCapacity) { m_symbolInfo = CBC_SymbolInfo::lookup(len, m_shape, m_minSize, m_maxSize, true, e); BC_EXCEPTION_CHECK_ReturnVoid(e); diff --git a/xfa/fxbarcode/datamatrix/BC_HighLevelEncoder.cpp b/xfa/fxbarcode/datamatrix/BC_HighLevelEncoder.cpp index 5388244351..7fcc039721 100644 --- a/xfa/fxbarcode/datamatrix/BC_HighLevelEncoder.cpp +++ b/xfa/fxbarcode/datamatrix/BC_HighLevelEncoder.cpp @@ -69,7 +69,7 @@ CFX_ByteArray& CBC_HighLevelEncoder::getBytesForMessage(CFX_WideString msg) { CFX_WideString CBC_HighLevelEncoder::encodeHighLevel(CFX_WideString msg, CFX_WideString ecLevel, int32_t& e) { - return encodeHighLevel(msg, ecLevel, FORCE_NONE, NULL, NULL, e); + return encodeHighLevel(msg, ecLevel, FORCE_NONE, nullptr, nullptr, e); } CFX_WideString CBC_HighLevelEncoder::encodeHighLevel(CFX_WideString msg, CFX_WideString ecLevel, diff --git a/xfa/fxbarcode/datamatrix/BC_SymbolInfo.cpp b/xfa/fxbarcode/datamatrix/BC_SymbolInfo.cpp index d3d68541c4..b6323041f9 100644 --- a/xfa/fxbarcode/datamatrix/BC_SymbolInfo.cpp +++ b/xfa/fxbarcode/datamatrix/BC_SymbolInfo.cpp @@ -20,67 +20,66 @@ * limitations under the License. */ +#include "xfa/fxbarcode/datamatrix/BC_SymbolInfo.h" + #include "xfa/fxbarcode/BC_Dimension.h" #include "xfa/fxbarcode/common/BC_CommonBitMatrix.h" #include "xfa/fxbarcode/datamatrix/BC_DataMatrixSymbolInfo144.h" #include "xfa/fxbarcode/datamatrix/BC_Encoder.h" -#include "xfa/fxbarcode/datamatrix/BC_SymbolInfo.h" #include "xfa/fxbarcode/datamatrix/BC_SymbolShapeHint.h" -#define SYMBOLS_COUNT 30 +namespace { + +const size_t kSymbolsCount = 30; + +CBC_SymbolInfo* g_symbols[kSymbolsCount] = { + nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, + nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, + nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, + nullptr, nullptr, nullptr, nullptr, nullptr, nullptr}; + +} // namespace -CBC_SymbolInfo* CBC_SymbolInfo::m_PROD_SYMBOLS[30] = { - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL}; -CBC_SymbolInfo* CBC_SymbolInfo::m_symbols[30] = { - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL}; void CBC_SymbolInfo::Initialize() { - m_PROD_SYMBOLS[0] = new CBC_SymbolInfo(FALSE, 3, 5, 8, 8, 1); - m_PROD_SYMBOLS[1] = new CBC_SymbolInfo(FALSE, 5, 7, 10, 10, 1); - m_PROD_SYMBOLS[2] = new CBC_SymbolInfo(TRUE, 5, 7, 16, 6, 1); - m_PROD_SYMBOLS[3] = new CBC_SymbolInfo(FALSE, 8, 10, 12, 12, 1); - m_PROD_SYMBOLS[4] = new CBC_SymbolInfo(TRUE, 10, 11, 14, 6, 2); - m_PROD_SYMBOLS[5] = new CBC_SymbolInfo(FALSE, 12, 12, 14, 14, 1); - m_PROD_SYMBOLS[6] = new CBC_SymbolInfo(TRUE, 16, 14, 24, 10, 1); - m_PROD_SYMBOLS[7] = new CBC_SymbolInfo(FALSE, 18, 14, 16, 16, 1); - m_PROD_SYMBOLS[8] = new CBC_SymbolInfo(FALSE, 22, 18, 18, 18, 1); - m_PROD_SYMBOLS[9] = new CBC_SymbolInfo(TRUE, 22, 18, 16, 10, 2); - m_PROD_SYMBOLS[10] = new CBC_SymbolInfo(FALSE, 30, 20, 20, 20, 1); - m_PROD_SYMBOLS[11] = new CBC_SymbolInfo(TRUE, 32, 24, 16, 14, 2); - m_PROD_SYMBOLS[12] = new CBC_SymbolInfo(FALSE, 36, 24, 22, 22, 1); - m_PROD_SYMBOLS[13] = new CBC_SymbolInfo(FALSE, 44, 28, 24, 24, 1); - m_PROD_SYMBOLS[14] = new CBC_SymbolInfo(TRUE, 49, 28, 22, 14, 2); - m_PROD_SYMBOLS[15] = new CBC_SymbolInfo(FALSE, 62, 36, 14, 14, 4); - m_PROD_SYMBOLS[16] = new CBC_SymbolInfo(FALSE, 86, 42, 16, 16, 4); - m_PROD_SYMBOLS[17] = new CBC_SymbolInfo(FALSE, 114, 48, 18, 18, 4); - m_PROD_SYMBOLS[18] = new CBC_SymbolInfo(FALSE, 144, 56, 20, 20, 4); - m_PROD_SYMBOLS[19] = new CBC_SymbolInfo(FALSE, 174, 68, 22, 22, 4); - m_PROD_SYMBOLS[20] = new CBC_SymbolInfo(FALSE, 204, 84, 24, 24, 4, 102, 42); - m_PROD_SYMBOLS[21] = new CBC_SymbolInfo(FALSE, 280, 112, 14, 14, 16, 140, 56); - m_PROD_SYMBOLS[22] = new CBC_SymbolInfo(FALSE, 368, 144, 16, 16, 16, 92, 36); - m_PROD_SYMBOLS[23] = new CBC_SymbolInfo(FALSE, 456, 192, 18, 18, 16, 114, 48); - m_PROD_SYMBOLS[24] = new CBC_SymbolInfo(FALSE, 576, 224, 20, 20, 16, 144, 56); - m_PROD_SYMBOLS[25] = new CBC_SymbolInfo(FALSE, 696, 272, 22, 22, 16, 174, 68); - m_PROD_SYMBOLS[26] = new CBC_SymbolInfo(FALSE, 816, 336, 24, 24, 16, 136, 56); - m_PROD_SYMBOLS[27] = - new CBC_SymbolInfo(FALSE, 1050, 408, 18, 18, 36, 175, 68); - m_PROD_SYMBOLS[28] = - new CBC_SymbolInfo(FALSE, 1304, 496, 20, 20, 36, 163, 62); - m_PROD_SYMBOLS[29] = new CBC_DataMatrixSymbolInfo144(); - for (int32_t i = 0; i < SYMBOLS_COUNT; i++) { - m_symbols[i] = m_PROD_SYMBOLS[i]; - } + g_symbols[0] = new CBC_SymbolInfo(FALSE, 3, 5, 8, 8, 1); + g_symbols[1] = new CBC_SymbolInfo(FALSE, 5, 7, 10, 10, 1); + g_symbols[2] = new CBC_SymbolInfo(TRUE, 5, 7, 16, 6, 1); + g_symbols[3] = new CBC_SymbolInfo(FALSE, 8, 10, 12, 12, 1); + g_symbols[4] = new CBC_SymbolInfo(TRUE, 10, 11, 14, 6, 2); + g_symbols[5] = new CBC_SymbolInfo(FALSE, 12, 12, 14, 14, 1); + g_symbols[6] = new CBC_SymbolInfo(TRUE, 16, 14, 24, 10, 1); + g_symbols[7] = new CBC_SymbolInfo(FALSE, 18, 14, 16, 16, 1); + g_symbols[8] = new CBC_SymbolInfo(FALSE, 22, 18, 18, 18, 1); + g_symbols[9] = new CBC_SymbolInfo(TRUE, 22, 18, 16, 10, 2); + g_symbols[10] = new CBC_SymbolInfo(FALSE, 30, 20, 20, 20, 1); + g_symbols[11] = new CBC_SymbolInfo(TRUE, 32, 24, 16, 14, 2); + g_symbols[12] = new CBC_SymbolInfo(FALSE, 36, 24, 22, 22, 1); + g_symbols[13] = new CBC_SymbolInfo(FALSE, 44, 28, 24, 24, 1); + g_symbols[14] = new CBC_SymbolInfo(TRUE, 49, 28, 22, 14, 2); + g_symbols[15] = new CBC_SymbolInfo(FALSE, 62, 36, 14, 14, 4); + g_symbols[16] = new CBC_SymbolInfo(FALSE, 86, 42, 16, 16, 4); + g_symbols[17] = new CBC_SymbolInfo(FALSE, 114, 48, 18, 18, 4); + g_symbols[18] = new CBC_SymbolInfo(FALSE, 144, 56, 20, 20, 4); + g_symbols[19] = new CBC_SymbolInfo(FALSE, 174, 68, 22, 22, 4); + g_symbols[20] = new CBC_SymbolInfo(FALSE, 204, 84, 24, 24, 4, 102, 42); + g_symbols[21] = new CBC_SymbolInfo(FALSE, 280, 112, 14, 14, 16, 140, 56); + g_symbols[22] = new CBC_SymbolInfo(FALSE, 368, 144, 16, 16, 16, 92, 36); + g_symbols[23] = new CBC_SymbolInfo(FALSE, 456, 192, 18, 18, 16, 114, 48); + g_symbols[24] = new CBC_SymbolInfo(FALSE, 576, 224, 20, 20, 16, 144, 56); + g_symbols[25] = new CBC_SymbolInfo(FALSE, 696, 272, 22, 22, 16, 174, 68); + g_symbols[26] = new CBC_SymbolInfo(FALSE, 816, 336, 24, 24, 16, 136, 56); + g_symbols[27] = new CBC_SymbolInfo(FALSE, 1050, 408, 18, 18, 36, 175, 68); + g_symbols[28] = new CBC_SymbolInfo(FALSE, 1304, 496, 20, 20, 36, 163, 62); + g_symbols[29] = new CBC_DataMatrixSymbolInfo144(); } + void CBC_SymbolInfo::Finalize() { - for (int32_t i = 0; i < SYMBOLS_COUNT; i++) { - delete m_PROD_SYMBOLS[i]; - m_PROD_SYMBOLS[i] = NULL; - m_symbols[i] = NULL; + for (size_t i = 0; i < kSymbolsCount; i++) { + delete g_symbols[i]; + g_symbols[i] = nullptr; } } + CBC_SymbolInfo::CBC_SymbolInfo(FX_BOOL rectangular, int32_t dataCapacity, int32_t errorCodewords, @@ -134,7 +133,7 @@ CBC_SymbolInfo* CBC_SymbolInfo::lookup(int32_t dataCodewords, SymbolShapeHint shape, FX_BOOL fail, int32_t& e) { - return lookup(dataCodewords, shape, NULL, NULL, fail, e); + return lookup(dataCodewords, shape, nullptr, nullptr, fail, e); } CBC_SymbolInfo* CBC_SymbolInfo::lookup(int32_t dataCodewords, SymbolShapeHint shape, @@ -142,8 +141,8 @@ CBC_SymbolInfo* CBC_SymbolInfo::lookup(int32_t dataCodewords, CBC_Dimension* maxSize, FX_BOOL fail, int32_t& e) { - for (int32_t i = 0; i < SYMBOLS_COUNT; i++) { - CBC_SymbolInfo* symbol = m_symbols[i]; + for (size_t i = 0; i < kSymbolsCount; i++) { + CBC_SymbolInfo* symbol = g_symbols[i]; if (shape == FORCE_SQUARE && symbol->m_rectangular) { continue; } @@ -152,24 +151,23 @@ CBC_SymbolInfo* CBC_SymbolInfo::lookup(int32_t dataCodewords, } if (minSize && (symbol->getSymbolWidth(e) < minSize->getWidth() || symbol->getSymbolHeight(e) < minSize->getHeight())) { - BC_EXCEPTION_CHECK_ReturnValue(e, NULL); + BC_EXCEPTION_CHECK_ReturnValue(e, nullptr); continue; } if (maxSize && (symbol->getSymbolWidth(e) > maxSize->getWidth() || symbol->getSymbolHeight(e) > maxSize->getHeight())) { - BC_EXCEPTION_CHECK_ReturnValue(e, NULL); + BC_EXCEPTION_CHECK_ReturnValue(e, nullptr); continue; } if (dataCodewords <= symbol->m_dataCapacity) { return symbol; } } - if (fail) { + if (fail) e = BCExceptionIllegalDataCodewords; - return NULL; - } - return NULL; + return nullptr; } + int32_t CBC_SymbolInfo::getHorizontalDataRegions(int32_t& e) { switch (m_dataRegions) { case 1: diff --git a/xfa/fxbarcode/datamatrix/BC_SymbolInfo.h b/xfa/fxbarcode/datamatrix/BC_SymbolInfo.h index 7885c8da74..64270dd9ac 100644 --- a/xfa/fxbarcode/datamatrix/BC_SymbolInfo.h +++ b/xfa/fxbarcode/datamatrix/BC_SymbolInfo.h @@ -54,19 +54,12 @@ class CBC_SymbolInfo : public CBC_SymbolShapeHint { int32_t getDataLengthForInterleavedBlock(int32_t index); int32_t getErrorLengthForInterleavedBlock(int32_t index); - public: int32_t m_dataCapacity; int32_t m_errorCodewords; int32_t m_matrixWidth; int32_t m_matrixHeight; int32_t m_rsBlockData; int32_t m_rsBlockError; - static CBC_SymbolInfo* m_PROD_SYMBOLS[30]; - - private: - static CBC_SymbolInfo* m_symbols[30]; - FX_BOOL m_rectangular; - int32_t m_dataRegions; private: CBC_SymbolInfo(FX_BOOL rectangular, @@ -77,6 +70,9 @@ class CBC_SymbolInfo : public CBC_SymbolShapeHint { int32_t dataRegions, int32_t rsBlockData, int32_t rsBlockError); + + FX_BOOL m_rectangular; + int32_t m_dataRegions; }; #endif // XFA_FXBARCODE_DATAMATRIX_BC_SYMBOLINFO_H_ |