diff options
author | tsepez <tsepez@chromium.org> | 2016-11-02 15:43:18 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-11-02 15:43:19 -0700 |
commit | d19e912dd469e4bdad9f3020e1f6eb98f10f3470 (patch) | |
tree | 239cb568a80445f14a1ab9b63dcaaddcce67e1cc /xfa/fxbarcode/pdf417 | |
parent | 12f3e4a58f05850b93af35619cb04f0231d86acc (diff) | |
download | pdfium-d19e912dd469e4bdad9f3020e1f6eb98f10f3470.tar.xz |
Remove FX_BOOL from xfa.
Review-Url: https://codereview.chromium.org/2467203003
Diffstat (limited to 'xfa/fxbarcode/pdf417')
-rw-r--r-- | xfa/fxbarcode/pdf417/BC_PDF417.cpp | 10 | ||||
-rw-r--r-- | xfa/fxbarcode/pdf417/BC_PDF417.h | 6 | ||||
-rw-r--r-- | xfa/fxbarcode/pdf417/BC_PDF417BarcodeMatrix.cpp | 2 | ||||
-rw-r--r-- | xfa/fxbarcode/pdf417/BC_PDF417BarcodeMatrix.h | 2 | ||||
-rw-r--r-- | xfa/fxbarcode/pdf417/BC_PDF417BarcodeRow.cpp | 4 | ||||
-rw-r--r-- | xfa/fxbarcode/pdf417/BC_PDF417BarcodeRow.h | 4 | ||||
-rw-r--r-- | xfa/fxbarcode/pdf417/BC_PDF417HighLevelEncoder.cpp | 16 | ||||
-rw-r--r-- | xfa/fxbarcode/pdf417/BC_PDF417HighLevelEncoder.h | 12 | ||||
-rw-r--r-- | xfa/fxbarcode/pdf417/BC_PDF417Writer.cpp | 16 | ||||
-rw-r--r-- | xfa/fxbarcode/pdf417/BC_PDF417Writer.h | 6 |
10 files changed, 39 insertions, 39 deletions
diff --git a/xfa/fxbarcode/pdf417/BC_PDF417.cpp b/xfa/fxbarcode/pdf417/BC_PDF417.cpp index 843ee23364..9d827acff6 100644 --- a/xfa/fxbarcode/pdf417/BC_PDF417.cpp +++ b/xfa/fxbarcode/pdf417/BC_PDF417.cpp @@ -381,9 +381,9 @@ const int32_t CBC_PDF417::CODEWORD_TABLE[][929] = { 0x10396, 0x107b6, 0x187d4, 0x187d2, 0x10794, 0x10fb4, 0x10792, 0x10fb2, 0x1c7ea}}; -CBC_PDF417::CBC_PDF417() : CBC_PDF417(FALSE) {} +CBC_PDF417::CBC_PDF417() : CBC_PDF417(false) {} -CBC_PDF417::CBC_PDF417(FX_BOOL compact) +CBC_PDF417::CBC_PDF417(bool compact) : m_compact(compact), m_compaction(AUTO), m_minCols(1), @@ -451,7 +451,7 @@ void CBC_PDF417::setCompaction(Compaction compaction) { m_compaction = compaction; } -void CBC_PDF417::setCompact(FX_BOOL compact) { +void CBC_PDF417::setCompact(bool compact) { m_compact = compact; } @@ -475,10 +475,10 @@ void CBC_PDF417::encodeChar(int32_t pattern, int32_t len, CBC_BarcodeRow* logic) { int32_t map = 1 << (len - 1); - FX_BOOL last = ((pattern & map) != 0); + bool last = ((pattern & map) != 0); int32_t width = 0; for (int32_t i = 0; i < len; i++) { - FX_BOOL black = ((pattern & map) != 0); + bool black = ((pattern & map) != 0); if (last == black) { width++; } else { diff --git a/xfa/fxbarcode/pdf417/BC_PDF417.h b/xfa/fxbarcode/pdf417/BC_PDF417.h index c3a9f4c477..5f7c2d49b9 100644 --- a/xfa/fxbarcode/pdf417/BC_PDF417.h +++ b/xfa/fxbarcode/pdf417/BC_PDF417.h @@ -18,7 +18,7 @@ class CBC_BarcodeMatrix; class CBC_PDF417 { public: CBC_PDF417(); - explicit CBC_PDF417(FX_BOOL compact); + explicit CBC_PDF417(bool compact); virtual ~CBC_PDF417(); CBC_BarcodeMatrix* getBarcodeMatrix(); @@ -30,7 +30,7 @@ class CBC_PDF417 { int32_t maxRows, int32_t minRows); void setCompaction(Compaction compaction); - void setCompact(FX_BOOL compact); + void setCompact(bool compact); private: static const int32_t START_PATTERN = 0x1fea8; @@ -56,7 +56,7 @@ class CBC_PDF417 { int32_t& e); std::unique_ptr<CBC_BarcodeMatrix> m_barcodeMatrix; - FX_BOOL m_compact; + bool m_compact; Compaction m_compaction; int32_t m_minCols; int32_t m_maxCols; diff --git a/xfa/fxbarcode/pdf417/BC_PDF417BarcodeMatrix.cpp b/xfa/fxbarcode/pdf417/BC_PDF417BarcodeMatrix.cpp index a9d1fedef0..f348d2c934 100644 --- a/xfa/fxbarcode/pdf417/BC_PDF417BarcodeMatrix.cpp +++ b/xfa/fxbarcode/pdf417/BC_PDF417BarcodeMatrix.cpp @@ -44,7 +44,7 @@ CBC_BarcodeMatrix::~CBC_BarcodeMatrix() { void CBC_BarcodeMatrix::set(int32_t x, int32_t y, uint8_t value) { m_matrix[y]->set(x, value); } -void CBC_BarcodeMatrix::setMatrix(int32_t x, int32_t y, FX_BOOL black) { +void CBC_BarcodeMatrix::setMatrix(int32_t x, int32_t y, bool black) { set(x, y, (uint8_t)(black ? 1 : 0)); } void CBC_BarcodeMatrix::startRow() { diff --git a/xfa/fxbarcode/pdf417/BC_PDF417BarcodeMatrix.h b/xfa/fxbarcode/pdf417/BC_PDF417BarcodeMatrix.h index 853b9eea98..0f6922233d 100644 --- a/xfa/fxbarcode/pdf417/BC_PDF417BarcodeMatrix.h +++ b/xfa/fxbarcode/pdf417/BC_PDF417BarcodeMatrix.h @@ -18,7 +18,7 @@ class CBC_BarcodeMatrix { virtual ~CBC_BarcodeMatrix(); void set(int32_t x, int32_t y, uint8_t value); - void setMatrix(int32_t x, int32_t y, FX_BOOL black); + void setMatrix(int32_t x, int32_t y, bool black); void startRow(); CBC_BarcodeRow* getCurrentRow(); CFX_ByteArray& getMatrix(); diff --git a/xfa/fxbarcode/pdf417/BC_PDF417BarcodeRow.cpp b/xfa/fxbarcode/pdf417/BC_PDF417BarcodeRow.cpp index 6f88b33877..b721ffc3ef 100644 --- a/xfa/fxbarcode/pdf417/BC_PDF417BarcodeRow.cpp +++ b/xfa/fxbarcode/pdf417/BC_PDF417BarcodeRow.cpp @@ -33,10 +33,10 @@ CBC_BarcodeRow::~CBC_BarcodeRow() { void CBC_BarcodeRow::set(int32_t x, uint8_t value) { m_row.SetAt(x, value); } -void CBC_BarcodeRow::set(int32_t x, FX_BOOL black) { +void CBC_BarcodeRow::set(int32_t x, bool black) { m_row.SetAt(x, (uint8_t)(black ? 1 : 0)); } -void CBC_BarcodeRow::addBar(FX_BOOL black, int32_t width) { +void CBC_BarcodeRow::addBar(bool black, int32_t width) { for (int32_t ii = 0; ii < width; ii++) { set(m_currentLocation++, black); } diff --git a/xfa/fxbarcode/pdf417/BC_PDF417BarcodeRow.h b/xfa/fxbarcode/pdf417/BC_PDF417BarcodeRow.h index 4325acc05f..802a49cb5e 100644 --- a/xfa/fxbarcode/pdf417/BC_PDF417BarcodeRow.h +++ b/xfa/fxbarcode/pdf417/BC_PDF417BarcodeRow.h @@ -15,8 +15,8 @@ class CBC_BarcodeRow { virtual ~CBC_BarcodeRow(); void set(int32_t x, uint8_t value); - void set(int32_t x, FX_BOOL black); - void addBar(FX_BOOL black, int32_t width); + void set(int32_t x, bool black); + void addBar(bool black, int32_t width); CFX_ByteArray& getRow(); CFX_ByteArray& getScaledRow(int32_t scale); diff --git a/xfa/fxbarcode/pdf417/BC_PDF417HighLevelEncoder.cpp b/xfa/fxbarcode/pdf417/BC_PDF417HighLevelEncoder.cpp index 7617d526c1..fa0e9bc67d 100644 --- a/xfa/fxbarcode/pdf417/BC_PDF417HighLevelEncoder.cpp +++ b/xfa/fxbarcode/pdf417/BC_PDF417HighLevelEncoder.cpp @@ -155,7 +155,7 @@ int32_t CBC_PDF417HighLevelEncoder::encodeText(CFX_WideString msg, CFX_WideString tmp; int32_t submode = initialSubmode; int32_t idx = 0; - while (TRUE) { + while (true) { FX_WCHAR ch = msg.GetAt(startpos + idx); switch (submode) { case SUBMODE_ALPHA: @@ -247,7 +247,7 @@ int32_t CBC_PDF417HighLevelEncoder::encodeText(CFX_WideString msg, FX_WCHAR h = 0; int32_t len = tmp.GetLength(); for (int32_t i = 0; i < len; i++) { - FX_BOOL odd = (i % 2) != 0; + bool odd = (i % 2) != 0; if (odd) { h = (FX_WCHAR)((h * 30) + tmp.GetAt(i)); sb += h; @@ -320,22 +320,22 @@ void CBC_PDF417HighLevelEncoder::encodeNumeric(CFX_WideString msg, idx += len; } } -FX_BOOL CBC_PDF417HighLevelEncoder::isDigit(FX_WCHAR ch) { +bool CBC_PDF417HighLevelEncoder::isDigit(FX_WCHAR ch) { return ch >= '0' && ch <= '9'; } -FX_BOOL CBC_PDF417HighLevelEncoder::isAlphaUpper(FX_WCHAR ch) { +bool CBC_PDF417HighLevelEncoder::isAlphaUpper(FX_WCHAR ch) { return ch == ' ' || (ch >= 'A' && ch <= 'Z'); } -FX_BOOL CBC_PDF417HighLevelEncoder::isAlphaLower(FX_WCHAR ch) { +bool CBC_PDF417HighLevelEncoder::isAlphaLower(FX_WCHAR ch) { return ch == ' ' || (ch >= 'a' && ch <= 'z'); } -FX_BOOL CBC_PDF417HighLevelEncoder::isMixed(FX_WCHAR ch) { +bool CBC_PDF417HighLevelEncoder::isMixed(FX_WCHAR ch) { return MIXED[ch] != -1; } -FX_BOOL CBC_PDF417HighLevelEncoder::isPunctuation(FX_WCHAR ch) { +bool CBC_PDF417HighLevelEncoder::isPunctuation(FX_WCHAR ch) { return PUNCTUATION[ch] != -1; } -FX_BOOL CBC_PDF417HighLevelEncoder::isText(FX_WCHAR ch) { +bool CBC_PDF417HighLevelEncoder::isText(FX_WCHAR ch) { return ch == '\t' || ch == '\n' || ch == '\r' || (ch >= 32 && ch <= 126); } int32_t CBC_PDF417HighLevelEncoder::determineConsecutiveDigitCount( diff --git a/xfa/fxbarcode/pdf417/BC_PDF417HighLevelEncoder.h b/xfa/fxbarcode/pdf417/BC_PDF417HighLevelEncoder.h index fb7664d4a3..39abe0f1df 100644 --- a/xfa/fxbarcode/pdf417/BC_PDF417HighLevelEncoder.h +++ b/xfa/fxbarcode/pdf417/BC_PDF417HighLevelEncoder.h @@ -48,12 +48,12 @@ class CBC_PDF417HighLevelEncoder { int32_t startpos, int32_t count, CFX_WideString& sb); - static FX_BOOL isDigit(FX_WCHAR ch); - static FX_BOOL isAlphaUpper(FX_WCHAR ch); - static FX_BOOL isAlphaLower(FX_WCHAR ch); - static FX_BOOL isMixed(FX_WCHAR ch); - static FX_BOOL isPunctuation(FX_WCHAR ch); - static FX_BOOL isText(FX_WCHAR ch); + static bool isDigit(FX_WCHAR ch); + static bool isAlphaUpper(FX_WCHAR ch); + static bool isAlphaLower(FX_WCHAR ch); + static bool isMixed(FX_WCHAR ch); + static bool isPunctuation(FX_WCHAR ch); + static bool isText(FX_WCHAR ch); static int32_t determineConsecutiveDigitCount(CFX_WideString msg, int32_t startpos); static int32_t determineConsecutiveTextCount(CFX_WideString msg, diff --git a/xfa/fxbarcode/pdf417/BC_PDF417Writer.cpp b/xfa/fxbarcode/pdf417/BC_PDF417Writer.cpp index 43cf09e549..4c9b5cb15c 100644 --- a/xfa/fxbarcode/pdf417/BC_PDF417Writer.cpp +++ b/xfa/fxbarcode/pdf417/BC_PDF417Writer.cpp @@ -29,19 +29,19 @@ #include "xfa/fxbarcode/pdf417/BC_PDF417Writer.h" CBC_PDF417Writer::CBC_PDF417Writer() { - m_bFixedSize = FALSE; + m_bFixedSize = false; } CBC_PDF417Writer::~CBC_PDF417Writer() { - m_bTruncated = TRUE; + m_bTruncated = true; } -FX_BOOL CBC_PDF417Writer::SetErrorCorrectionLevel(int32_t level) { +bool CBC_PDF417Writer::SetErrorCorrectionLevel(int32_t level) { if (level < 0 || level > 8) { - return FALSE; + return false; } m_iCorrectLevel = level; - return TRUE; + return true; } -void CBC_PDF417Writer::SetTruncated(FX_BOOL truncated) { +void CBC_PDF417Writer::SetTruncated(bool truncated) { m_bTruncated = truncated; } uint8_t* CBC_PDF417Writer::Encode(const CFX_WideString& contents, @@ -70,10 +70,10 @@ uint8_t* CBC_PDF417Writer::Encode(const CFX_WideString& contents, int32_t height = outHeight; outWidth = barcodeMatrix->getWidth(); outHeight = barcodeMatrix->getHeight(); - FX_BOOL rotated = FALSE; + bool rotated = false; if ((height > width) ^ (outWidth < outHeight)) { rotateArray(originalScale, outHeight, outWidth); - rotated = TRUE; + rotated = true; int32_t temp = outHeight; outHeight = outWidth; outWidth = temp; diff --git a/xfa/fxbarcode/pdf417/BC_PDF417Writer.h b/xfa/fxbarcode/pdf417/BC_PDF417Writer.h index 12b8e8baa9..178d251bfe 100644 --- a/xfa/fxbarcode/pdf417/BC_PDF417Writer.h +++ b/xfa/fxbarcode/pdf417/BC_PDF417Writer.h @@ -22,13 +22,13 @@ class CBC_PDF417Writer : public CBC_TwoDimWriter { int32_t& e); // CBC_TwoDimWriter - FX_BOOL SetErrorCorrectionLevel(int32_t level) override; + bool SetErrorCorrectionLevel(int32_t level) override; - void SetTruncated(FX_BOOL truncated); + void SetTruncated(bool truncated); private: void rotateArray(CFX_ByteArray& bitarray, int32_t width, int32_t height); - FX_BOOL m_bTruncated; + bool m_bTruncated; }; #endif // XFA_FXBARCODE_PDF417_BC_PDF417WRITER_H_ |