| OLD | NEW |
| 1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 PDFium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
| 6 | 6 |
| 7 #include "xfa/fwl/basewidget/fxmath_barcodeimp.h" | 7 #include "xfa/fwl/basewidget/fxmath_barcodeimp.h" |
| 8 | 8 |
| 9 #include "xfa/fxbarcode/cbc_codabar.h" | 9 #include "xfa/fxbarcode/cbc_codabar.h" |
| 10 #include "xfa/fxbarcode/cbc_code128.h" | 10 #include "xfa/fxbarcode/cbc_code128.h" |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 return new CBC_QRCode(); | 39 return new CBC_QRCode(); |
| 40 case BC_PDF417: | 40 case BC_PDF417: |
| 41 return new CBC_PDF417I(); | 41 return new CBC_PDF417I(); |
| 42 case BC_DATAMATRIX: | 42 case BC_DATAMATRIX: |
| 43 return new CBC_DataMatrix(); | 43 return new CBC_DataMatrix(); |
| 44 case BC_UNKNOWN: | 44 case BC_UNKNOWN: |
| 45 default: | 45 default: |
| 46 return NULL; | 46 return NULL; |
| 47 } | 47 } |
| 48 } | 48 } |
| 49 |
| 49 CFX_Barcode::CFX_Barcode() {} | 50 CFX_Barcode::CFX_Barcode() {} |
| 51 |
| 50 CFX_Barcode::~CFX_Barcode() { | 52 CFX_Barcode::~CFX_Barcode() { |
| 51 if (m_pBCEngine) { | 53 delete m_pBCEngine; |
| 52 delete m_pBCEngine; | |
| 53 m_pBCEngine = NULL; | |
| 54 } | |
| 55 } | 54 } |
| 55 |
| 56 FX_BOOL CFX_Barcode::Create(BC_TYPE type) { | 56 FX_BOOL CFX_Barcode::Create(BC_TYPE type) { |
| 57 m_pBCEngine = FX_Barcode_CreateBarCodeEngineObject(type); | 57 m_pBCEngine = FX_Barcode_CreateBarCodeEngineObject(type); |
| 58 return m_pBCEngine != NULL; | 58 return m_pBCEngine != NULL; |
| 59 } | 59 } |
| 60 void CFX_Barcode::Release() { | 60 void CFX_Barcode::Release() { |
| 61 delete this; | 61 delete this; |
| 62 } | 62 } |
| 63 BC_TYPE CFX_Barcode::GetType() { | 63 BC_TYPE CFX_Barcode::GetType() { |
| 64 return m_pBCEngine ? m_pBCEngine->GetType() : BC_UNKNOWN; | 64 return m_pBCEngine ? m_pBCEngine->GetType() : BC_UNKNOWN; |
| 65 } | 65 } |
| (...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 379 continue; | 379 continue; |
| 380 } | 380 } |
| 381 CFX_WideString ret = pTmpEngine->Decode(pBitmap, errorCode); | 381 CFX_WideString ret = pTmpEngine->Decode(pBitmap, errorCode); |
| 382 if (errorCode == BCExceptionNO) { | 382 if (errorCode == BCExceptionNO) { |
| 383 return ret; | 383 return ret; |
| 384 } | 384 } |
| 385 } | 385 } |
| 386 errorCode = BCExceptionUnSupportedBarcode; | 386 errorCode = BCExceptionUnSupportedBarcode; |
| 387 return CFX_WideString(); | 387 return CFX_WideString(); |
| 388 } | 388 } |
| OLD | NEW |