summaryrefslogtreecommitdiff
path: root/xfa/fwl
diff options
context:
space:
mode:
authordsinclair <dsinclair@chromium.org>2016-05-16 11:38:28 -0700
committerCommit bot <commit-bot@chromium.org>2016-05-16 11:38:28 -0700
commit92cb5e580cecf0412b74d51e8863ed557e2bd47a (patch)
treeacdc33aa1bd876742ae62bd5901183413b2ead1b /xfa/fwl
parent719a7a71d4cf1b714ad7f76e5f9ca28cfd5b74d3 (diff)
downloadpdfium-92cb5e580cecf0412b74d51e8863ed557e2bd47a.tar.xz
Convert border style defines to an enum class.
There were two defines, BBS_ and PBS_ for the various border styles in the system. They were the same, except PBS_ had an extra SHADOW define which was never used. This CL combines both of those into a single BorderStyle enum class and updates the code as needed. Also, removes ADDBIT, GETBIT unused defines. Updates barcode code to use the util.h defines instead of redefinition. fsdk_baseannot names starting with _ were cleaned up and some #defines moved to constants. Review-Url: https://codereview.chromium.org/1980973002
Diffstat (limited to 'xfa/fwl')
-rw-r--r--xfa/fwl/basewidget/fxmath_barcodeimp.cpp18
1 files changed, 5 insertions, 13 deletions
diff --git a/xfa/fwl/basewidget/fxmath_barcodeimp.cpp b/xfa/fwl/basewidget/fxmath_barcodeimp.cpp
index 1d3af697b1..a67952caa6 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
-#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) {