summaryrefslogtreecommitdiff
path: root/xfa/src/fxbarcode/datamatrix
diff options
context:
space:
mode:
Diffstat (limited to 'xfa/src/fxbarcode/datamatrix')
-rw-r--r--xfa/src/fxbarcode/datamatrix/BC_DataMatrixBitMatrixParser.cpp10
-rw-r--r--xfa/src/fxbarcode/datamatrix/BC_DataMatrixDecoder.cpp5
-rw-r--r--xfa/src/fxbarcode/datamatrix/BC_DataMatrixDetector.cpp7
-rw-r--r--xfa/src/fxbarcode/datamatrix/BC_DataMatrixReader.cpp5
-rw-r--r--xfa/src/fxbarcode/datamatrix/BC_DataMatrixVersion.cpp5
-rw-r--r--xfa/src/fxbarcode/datamatrix/BC_SymbolInfo.cpp10
6 files changed, 11 insertions, 31 deletions
diff --git a/xfa/src/fxbarcode/datamatrix/BC_DataMatrixBitMatrixParser.cpp b/xfa/src/fxbarcode/datamatrix/BC_DataMatrixBitMatrixParser.cpp
index 4ba3a5c44b..be13c8580f 100644
--- a/xfa/src/fxbarcode/datamatrix/BC_DataMatrixBitMatrixParser.cpp
+++ b/xfa/src/fxbarcode/datamatrix/BC_DataMatrixBitMatrixParser.cpp
@@ -46,14 +46,8 @@ void CBC_DataMatrixBitMatrixParser::Init(CBC_CommonBitMatrix* bitMatrix,
m_mappingBitMatrix->GetHeight());
}
CBC_DataMatrixBitMatrixParser::~CBC_DataMatrixBitMatrixParser() {
- if (m_mappingBitMatrix != NULL) {
- delete m_mappingBitMatrix;
- }
- m_mappingBitMatrix = NULL;
- if (m_readMappingMatrix != NULL) {
- delete m_readMappingMatrix;
- }
- m_readMappingMatrix = NULL;
+ delete m_mappingBitMatrix;
+ delete m_readMappingMatrix;
}
CBC_DataMatrixVersion* CBC_DataMatrixBitMatrixParser::GetVersion() {
return m_version;
diff --git a/xfa/src/fxbarcode/datamatrix/BC_DataMatrixDecoder.cpp b/xfa/src/fxbarcode/datamatrix/BC_DataMatrixDecoder.cpp
index 45e9abda1f..49a1d1654a 100644
--- a/xfa/src/fxbarcode/datamatrix/BC_DataMatrixDecoder.cpp
+++ b/xfa/src/fxbarcode/datamatrix/BC_DataMatrixDecoder.cpp
@@ -37,10 +37,7 @@ void CBC_DataMatrixDecoder::Init() {
new CBC_ReedSolomonDecoder(CBC_ReedSolomonGF256::DataMatrixField);
}
CBC_DataMatrixDecoder::~CBC_DataMatrixDecoder() {
- if (m_rsDecoder != NULL) {
- delete m_rsDecoder;
- }
- m_rsDecoder = NULL;
+ delete m_rsDecoder;
}
CBC_CommonDecoderResult* CBC_DataMatrixDecoder::Decode(
CBC_CommonBitMatrix* bits,
diff --git a/xfa/src/fxbarcode/datamatrix/BC_DataMatrixDetector.cpp b/xfa/src/fxbarcode/datamatrix/BC_DataMatrixDetector.cpp
index d1b36b9949..b89ef7066b 100644
--- a/xfa/src/fxbarcode/datamatrix/BC_DataMatrixDetector.cpp
+++ b/xfa/src/fxbarcode/datamatrix/BC_DataMatrixDetector.cpp
@@ -40,10 +40,7 @@ void CBC_DataMatrixDetector::Init(int32_t& e) {
BC_EXCEPTION_CHECK_ReturnVoid(e);
}
CBC_DataMatrixDetector::~CBC_DataMatrixDetector() {
- if (m_rectangleDetector != NULL) {
- delete m_rectangleDetector;
- }
- m_rectangleDetector = NULL;
+ delete m_rectangleDetector;
}
inline FX_BOOL ResultPointsAndTransitionsComparator(void* a, void* b) {
return ((CBC_ResultPointsAndTransitions*)b)->GetTransitions() >
@@ -82,7 +79,7 @@ CBC_QRDetectorResult* CBC_DataMatrixDetector::Detect(int32_t& e) {
CBC_ResultPoint* bottomLeft = NULL;
CBC_ResultPoint* maybeBottomRight = NULL;
FX_POSITION itBegin = pointCount.GetStartPosition();
- while (itBegin != NULL) {
+ while (itBegin) {
CBC_ResultPoint* key = 0;
int32_t value = 0;
pointCount.GetNextAssoc(itBegin, key, value);
diff --git a/xfa/src/fxbarcode/datamatrix/BC_DataMatrixReader.cpp b/xfa/src/fxbarcode/datamatrix/BC_DataMatrixReader.cpp
index 1b2f82d489..2586751107 100644
--- a/xfa/src/fxbarcode/datamatrix/BC_DataMatrixReader.cpp
+++ b/xfa/src/fxbarcode/datamatrix/BC_DataMatrixReader.cpp
@@ -37,10 +37,7 @@ void CBC_DataMatrixReader::Init() {
m_decoder->Init();
}
CBC_DataMatrixReader::~CBC_DataMatrixReader() {
- if (m_decoder != NULL) {
- delete m_decoder;
- }
- m_decoder = NULL;
+ delete m_decoder;
}
CFX_ByteString CBC_DataMatrixReader::Decode(CBC_BinaryBitmap* image,
int32_t hints,
diff --git a/xfa/src/fxbarcode/datamatrix/BC_DataMatrixVersion.cpp b/xfa/src/fxbarcode/datamatrix/BC_DataMatrixVersion.cpp
index 28262ca1f0..4fb3a3fad6 100644
--- a/xfa/src/fxbarcode/datamatrix/BC_DataMatrixVersion.cpp
+++ b/xfa/src/fxbarcode/datamatrix/BC_DataMatrixVersion.cpp
@@ -59,10 +59,7 @@ CBC_DataMatrixVersion::CBC_DataMatrixVersion(int32_t versionNumber,
m_totalCodewords = total;
}
CBC_DataMatrixVersion::~CBC_DataMatrixVersion() {
- if (m_ecBlocks != NULL) {
- delete m_ecBlocks;
- }
- m_ecBlocks = NULL;
+ delete m_ecBlocks;
}
int32_t CBC_DataMatrixVersion::GetVersionNumber() {
return m_versionNumber;
diff --git a/xfa/src/fxbarcode/datamatrix/BC_SymbolInfo.cpp b/xfa/src/fxbarcode/datamatrix/BC_SymbolInfo.cpp
index 7c9d5a9688..7909054533 100644
--- a/xfa/src/fxbarcode/datamatrix/BC_SymbolInfo.cpp
+++ b/xfa/src/fxbarcode/datamatrix/BC_SymbolInfo.cpp
@@ -150,15 +150,13 @@ CBC_SymbolInfo* CBC_SymbolInfo::lookup(int32_t dataCodewords,
if (shape == FORCE_RECTANGLE && !symbol->m_rectangular) {
continue;
}
- if (minSize != NULL &&
- (symbol->getSymbolWidth(e) < minSize->getWidth() ||
- symbol->getSymbolHeight(e) < minSize->getHeight())) {
+ if (minSize && (symbol->getSymbolWidth(e) < minSize->getWidth() ||
+ symbol->getSymbolHeight(e) < minSize->getHeight())) {
BC_EXCEPTION_CHECK_ReturnValue(e, NULL);
continue;
}
- if (maxSize != NULL &&
- (symbol->getSymbolWidth(e) > maxSize->getWidth() ||
- symbol->getSymbolHeight(e) > maxSize->getHeight())) {
+ if (maxSize && (symbol->getSymbolWidth(e) > maxSize->getWidth() ||
+ symbol->getSymbolHeight(e) > maxSize->getHeight())) {
BC_EXCEPTION_CHECK_ReturnValue(e, NULL);
continue;
}