diff options
Diffstat (limited to 'xfa/fwl/basewidget')
-rw-r--r-- | xfa/fwl/basewidget/cfx_barcode.cpp | 42 | ||||
-rw-r--r-- | xfa/fwl/basewidget/cfx_barcode.h | 5 |
2 files changed, 6 insertions, 41 deletions
diff --git a/xfa/fwl/basewidget/cfx_barcode.cpp b/xfa/fwl/basewidget/cfx_barcode.cpp index 795c834181..665317989a 100644 --- a/xfa/fwl/basewidget/cfx_barcode.cpp +++ b/xfa/fwl/basewidget/cfx_barcode.cpp @@ -18,7 +18,9 @@ #include "xfa/fxbarcode/cbc_upca.h" #include "xfa/fxbarcode/utils.h" -static CBC_CodeBase* FX_Barcode_CreateBarCodeEngineObject(BC_TYPE type) { +namespace { + +CBC_CodeBase* CreateBarCodeEngineObject(BC_TYPE type) { switch (type) { case BC_CODE39: return new CBC_Code39(); @@ -48,6 +50,8 @@ static CBC_CodeBase* FX_Barcode_CreateBarCodeEngineObject(BC_TYPE type) { } } +} // namespace + CFX_Barcode::CFX_Barcode() {} CFX_Barcode::~CFX_Barcode() { @@ -55,7 +59,7 @@ CFX_Barcode::~CFX_Barcode() { } FX_BOOL CFX_Barcode::Create(BC_TYPE type) { - m_pBCEngine = FX_Barcode_CreateBarCodeEngineObject(type); + m_pBCEngine = CreateBarCodeEngineObject(type); return m_pBCEngine != NULL; } BC_TYPE CFX_Barcode::GetType() { @@ -341,37 +345,3 @@ FX_BOOL CFX_Barcode::RenderBitmap(CFX_DIBitmap*& pOutBitmap, int32_t& e) { } return m_pBCEngine->RenderBitmap(pOutBitmap, e); } - -CFX_WideString CFX_Barcode::Decode(uint8_t* buf, - int32_t width, - int32_t height, - int32_t& errorCode) { - for (BC_TYPE t = BC_CODE39; t <= BC_DATAMATRIX; - t = (BC_TYPE)((int32_t)t + 1)) { - CBC_CodeBase* pTmpEngine = FX_Barcode_CreateBarCodeEngineObject(t); - if (!pTmpEngine) { - continue; - } - CFX_WideString ret = pTmpEngine->Decode(buf, width, height, errorCode); - if (errorCode == BCExceptionNO) { - return ret; - } - } - errorCode = BCExceptionUnSupportedBarcode; - return CFX_WideString(); -} -CFX_WideString CFX_Barcode::Decode(CFX_DIBitmap* pBitmap, int32_t& errorCode) { - for (BC_TYPE t = BC_CODE39; t <= BC_DATAMATRIX; - t = (BC_TYPE)((int32_t)t + 1)) { - CBC_CodeBase* pTmpEngine = FX_Barcode_CreateBarCodeEngineObject(t); - if (!pTmpEngine) { - continue; - } - CFX_WideString ret = pTmpEngine->Decode(pBitmap, errorCode); - if (errorCode == BCExceptionNO) { - return ret; - } - } - errorCode = BCExceptionUnSupportedBarcode; - return CFX_WideString(); -} diff --git a/xfa/fwl/basewidget/cfx_barcode.h b/xfa/fwl/basewidget/cfx_barcode.h index fbe16306bd..2ba1f7f77d 100644 --- a/xfa/fwl/basewidget/cfx_barcode.h +++ b/xfa/fwl/basewidget/cfx_barcode.h @@ -30,11 +30,6 @@ class CFX_Barcode { const CFX_Matrix* matrix, int32_t& e); FX_BOOL RenderBitmap(CFX_DIBitmap*& pOutBitmap, int32_t& e); - CFX_WideString Decode(uint8_t* buf, - int32_t width, - int32_t height, - int32_t& errorCode); - CFX_WideString Decode(CFX_DIBitmap* pBitmap, int32_t& errorCode); FX_BOOL SetCharEncoding(BC_CHAR_ENCODING encoding); FX_BOOL SetModuleHeight(int32_t moduleHeight); FX_BOOL SetModuleWidth(int32_t moduleWidth); |