Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1774)

Unified Diff: xfa/fwl/basewidget/fxmath_barcodeimp.cpp

Issue 1980973002: Convert border style defines to an enum class. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« fpdfsdk/pdfwindow/PWL_Utils.cpp ('K') | « fpdfsdk/pdfwindow/PWL_Wnd.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: xfa/fwl/basewidget/fxmath_barcodeimp.cpp
diff --git a/xfa/fwl/basewidget/fxmath_barcodeimp.cpp b/xfa/fwl/basewidget/fxmath_barcodeimp.cpp
index 1d3af697b1d8d345c8fe27671e0ed1848916d479..a67952caa6a1983e256bf4b2c998bd0f8a13ea04 100644
--- a/xfa/fwl/basewidget/fxmath_barcodeimp.cpp
+++ b/xfa/fwl/basewidget/fxmath_barcodeimp.cpp
@@ -16,6 +16,7 @@
#include "xfa/fxbarcode/cbc_pdf417i.h"
#include "xfa/fxbarcode/cbc_qrcode.h"
#include "xfa/fxbarcode/cbc_upca.h"
+#include "xfa/fxbarcode/utils.h"
static CBC_CodeBase* FX_Barcode_CreateBarCodeEngineObject(BC_TYPE type) {
switch (type) {
@@ -320,15 +321,7 @@ FX_BOOL CFX_Barcode::SetTruncated(FX_BOOL truncated) {
return m_pBCEngine && memptr ? ((m_pBCEngine->*memptr)(truncated), TRUE)
: FALSE;
}
-#ifndef BCExceptionNO
-#define BCExceptionNO 0
dsinclair 2016/05/16 18:04:24 These are all defined in fxbarcode/utils.h
-#endif
-#ifndef BCExceptionFormatException
-#define BCExceptionFormatException 8
-#endif
-#ifndef BCExceptionUnSupportedBarcode
-#define BCExceptionUnSupportedBarcode 18
-#endif
+
FX_BOOL CFX_Barcode::Encode(const CFX_WideStringC& contents,
FX_BOOL isDevice,
int32_t& e) {
@@ -351,13 +344,12 @@ FX_BOOL CFX_Barcode::RenderBitmap(CFX_DIBitmap*& pOutBitmap, int32_t& e) {
}
return m_pBCEngine->RenderBitmap(pOutBitmap, e);
}
-#define BC_TYPE_MIN BC_CODE39
-#define BC_TYPE_MAX BC_DATAMATRIX
+
CFX_WideString CFX_Barcode::Decode(uint8_t* buf,
int32_t width,
int32_t height,
int32_t& errorCode) {
- for (BC_TYPE t = BC_TYPE_MIN; t <= BC_TYPE_MAX;
+ 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) {
@@ -372,7 +364,7 @@ CFX_WideString CFX_Barcode::Decode(uint8_t* buf,
return CFX_WideString();
}
CFX_WideString CFX_Barcode::Decode(CFX_DIBitmap* pBitmap, int32_t& errorCode) {
- for (BC_TYPE t = BC_TYPE_MIN; t <= BC_TYPE_MAX;
+ 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) {
« fpdfsdk/pdfwindow/PWL_Utils.cpp ('K') | « fpdfsdk/pdfwindow/PWL_Wnd.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698