diff options
author | Tom Sepez <tsepez@chromium.org> | 2017-03-28 12:06:45 -0700 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-03-28 19:22:50 +0000 |
commit | 8b6186f89002099d406508acecf4bccc4ef64c95 (patch) | |
tree | df104ee415cfa90a53a23b88f1f66c3c2fd8d84e /xfa/fxbarcode/pdf417/BC_PDF417BarcodeRow.cpp | |
parent | b0baff546bdcd911c80007829d9af5f05d0c04b0 (diff) | |
download | pdfium-8b6186f89002099d406508acecf4bccc4ef64c95.tar.xz |
Remove CFX_ArrayTemplate from FX barcode code.
This is now the last usage in pdfium, types to be removed
in a follow-on CL.
Change-Id: I16f67eb3eb99f21bb231829168203be125129ad7
Reviewed-on: https://pdfium-review.googlesource.com/3247
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'xfa/fxbarcode/pdf417/BC_PDF417BarcodeRow.cpp')
-rw-r--r-- | xfa/fxbarcode/pdf417/BC_PDF417BarcodeRow.cpp | 35 |
1 files changed, 17 insertions, 18 deletions
diff --git a/xfa/fxbarcode/pdf417/BC_PDF417BarcodeRow.cpp b/xfa/fxbarcode/pdf417/BC_PDF417BarcodeRow.cpp index 243af70d94..427da9d588 100644 --- a/xfa/fxbarcode/pdf417/BC_PDF417BarcodeRow.cpp +++ b/xfa/fxbarcode/pdf417/BC_PDF417BarcodeRow.cpp @@ -22,32 +22,31 @@ #include "xfa/fxbarcode/pdf417/BC_PDF417BarcodeRow.h" -CBC_BarcodeRow::CBC_BarcodeRow(int32_t width) { - m_row.SetSize(width); - m_currentLocation = 0; -} -CBC_BarcodeRow::~CBC_BarcodeRow() { - m_output.RemoveAll(); - m_row.RemoveAll(); -} +CBC_BarcodeRow::CBC_BarcodeRow(size_t width) + : m_row(width), m_currentLocation(0) {} + +CBC_BarcodeRow::~CBC_BarcodeRow() {} + void CBC_BarcodeRow::set(int32_t x, uint8_t value) { - m_row.SetAt(x, value); + m_row[x] = value; } + void CBC_BarcodeRow::set(int32_t x, bool black) { - m_row.SetAt(x, (uint8_t)(black ? 1 : 0)); + m_row[x] = black ? 1 : 0; } + void CBC_BarcodeRow::addBar(bool black, int32_t width) { - for (int32_t ii = 0; ii < width; ii++) { + for (int32_t ii = 0; ii < width; ii++) set(m_currentLocation++, black); - } } -CFX_ArrayTemplate<uint8_t>& CBC_BarcodeRow::getRow() { + +std::vector<uint8_t>& CBC_BarcodeRow::getRow() { return m_row; } -CFX_ArrayTemplate<uint8_t>& CBC_BarcodeRow::getScaledRow(int32_t scale) { - m_output.SetSize(m_row.GetSize() * scale); - for (int32_t i = 0; i < m_output.GetSize(); i++) { - m_output[i] = (m_row[i / scale]); - } + +std::vector<uint8_t>& CBC_BarcodeRow::getScaledRow(int32_t scale) { + m_output.resize(m_row.size() * scale); + for (size_t i = 0; i < m_output.size(); i++) + m_output[i] = m_row[i / scale]; return m_output; } |