From 60cd033adf6c469ff47bdaf85a66b5817fdd188b Mon Sep 17 00:00:00 2001 From: Lei Zhang Date: Thu, 27 Apr 2017 23:58:03 -0700 Subject: Remove dead dimensions code in fxbarcode. Remove more exceptions. Change-Id: I3b8b8b9837b0010b1e0060ddd56e93c78f9f0fb5 Reviewed-on: https://pdfium-review.googlesource.com/4410 Reviewed-by: Tom Sepez Commit-Queue: Lei Zhang --- fxbarcode/datamatrix/BC_SymbolInfo.cpp | 31 ++++--------------------------- 1 file changed, 4 insertions(+), 27 deletions(-) (limited to 'fxbarcode/datamatrix/BC_SymbolInfo.cpp') diff --git a/fxbarcode/datamatrix/BC_SymbolInfo.cpp b/fxbarcode/datamatrix/BC_SymbolInfo.cpp index f98370b90f..5d12f1c090 100644 --- a/fxbarcode/datamatrix/BC_SymbolInfo.cpp +++ b/fxbarcode/datamatrix/BC_SymbolInfo.cpp @@ -22,11 +22,11 @@ #include "fxbarcode/datamatrix/BC_SymbolInfo.h" -#include "fxbarcode/BC_Dimension.h" #include "fxbarcode/common/BC_CommonBitMatrix.h" #include "fxbarcode/datamatrix/BC_DataMatrixSymbolInfo144.h" #include "fxbarcode/datamatrix/BC_Encoder.h" #include "fxbarcode/datamatrix/BC_SymbolShapeHint.h" +#include "fxbarcode/utils.h" namespace { @@ -133,37 +133,14 @@ CBC_SymbolInfo* CBC_SymbolInfo::lookup(int32_t dataCodewords, SymbolShapeHint shape, bool fail, int32_t& e) { - return lookup(dataCodewords, shape, nullptr, nullptr, fail, e); -} -CBC_SymbolInfo* CBC_SymbolInfo::lookup(int32_t dataCodewords, - SymbolShapeHint shape, - CBC_Dimension* minSize, - CBC_Dimension* maxSize, - bool fail, - int32_t& e) { for (size_t i = 0; i < kSymbolsCount; i++) { CBC_SymbolInfo* symbol = g_symbols[i]; - if (shape == FORCE_SQUARE && symbol->m_rectangular) { - continue; - } - if (shape == FORCE_RECTANGLE && !symbol->m_rectangular) { - continue; - } - if (minSize && (symbol->getSymbolWidth(e) < minSize->getWidth() || - symbol->getSymbolHeight(e) < minSize->getHeight())) { - if (e != BCExceptionNO) - return nullptr; + if ((shape == FORCE_SQUARE && symbol->m_rectangular) || + (shape == FORCE_RECTANGLE && !symbol->m_rectangular)) { continue; } - if (maxSize && (symbol->getSymbolWidth(e) > maxSize->getWidth() || - symbol->getSymbolHeight(e) > maxSize->getHeight())) { - if (e != BCExceptionNO) - return nullptr; - continue; - } - if (dataCodewords <= symbol->m_dataCapacity) { + if (dataCodewords <= symbol->m_dataCapacity) return symbol; - } } if (fail) e = BCExceptionIllegalDataCodewords; -- cgit v1.2.3