summaryrefslogtreecommitdiff
path: root/xfa/fxbarcode/pdf417
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2017-03-28 12:06:45 -0700
committerChromium commit bot <commit-bot@chromium.org>2017-03-28 19:22:50 +0000
commit8b6186f89002099d406508acecf4bccc4ef64c95 (patch)
treedf104ee415cfa90a53a23b88f1f66c3c2fd8d84e /xfa/fxbarcode/pdf417
parentb0baff546bdcd911c80007829d9af5f05d0c04b0 (diff)
downloadpdfium-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')
-rw-r--r--xfa/fxbarcode/pdf417/BC_PDF417.cpp28
-rw-r--r--xfa/fxbarcode/pdf417/BC_PDF417.h8
-rw-r--r--xfa/fxbarcode/pdf417/BC_PDF417BarcodeMatrix.cpp44
-rw-r--r--xfa/fxbarcode/pdf417/BC_PDF417BarcodeMatrix.h12
-rw-r--r--xfa/fxbarcode/pdf417/BC_PDF417BarcodeRow.cpp35
-rw-r--r--xfa/fxbarcode/pdf417/BC_PDF417BarcodeRow.h12
-rw-r--r--xfa/fxbarcode/pdf417/BC_PDF417HighLevelEncoder.cpp16
-rw-r--r--xfa/fxbarcode/pdf417/BC_PDF417HighLevelEncoder.h13
-rw-r--r--xfa/fxbarcode/pdf417/BC_PDF417HighLevelEncoder_unittest.cpp6
-rw-r--r--xfa/fxbarcode/pdf417/BC_PDF417Writer.cpp17
-rw-r--r--xfa/fxbarcode/pdf417/BC_PDF417Writer.h4
11 files changed, 97 insertions, 98 deletions
diff --git a/xfa/fxbarcode/pdf417/BC_PDF417.cpp b/xfa/fxbarcode/pdf417/BC_PDF417.cpp
index f7aad69953..0bc6680108 100644
--- a/xfa/fxbarcode/pdf417/BC_PDF417.cpp
+++ b/xfa/fxbarcode/pdf417/BC_PDF417.cpp
@@ -412,12 +412,12 @@ void CBC_PDF417::generateBarcodeLogic(CFX_WideString msg,
if (e != BCExceptionNO)
return;
int32_t sourceCodeWords = highLevel.GetLength();
- CFX_ArrayTemplate<int32_t>* dimension =
+ std::vector<int32_t>* dimension =
determineDimensions(sourceCodeWords, errorCorrectionCodeWords, e);
if (e != BCExceptionNO)
return;
- int32_t cols = dimension->GetAt(0);
- int32_t rows = dimension->GetAt(1);
+ int32_t cols = (*dimension)[0];
+ int32_t rows = (*dimension)[1];
delete dimension;
int32_t pad = getNumberOfPadCodewords(sourceCodeWords,
errorCorrectionCodeWords, cols, rows);
@@ -536,12 +536,12 @@ void CBC_PDF417::encodeLowLevel(CFX_WideString fullCodewords,
}
}
-CFX_ArrayTemplate<int32_t>* CBC_PDF417::determineDimensions(
+std::vector<int32_t>* CBC_PDF417::determineDimensions(
int32_t sourceCodeWords,
int32_t errorCorrectionCodeWords,
int32_t& e) {
float ratio = 0.0f;
- CFX_ArrayTemplate<int32_t>* dimension = nullptr;
+ std::vector<int32_t>* dimension = nullptr;
for (int32_t cols = m_minCols; cols <= m_maxCols; cols++) {
int32_t rows =
calculateNumberOfRows(sourceCodeWords, errorCorrectionCodeWords, cols);
@@ -559,21 +559,21 @@ CFX_ArrayTemplate<int32_t>* CBC_PDF417::determineDimensions(
}
ratio = newRatio;
delete dimension;
- dimension = new CFX_ArrayTemplate<int32_t>;
- dimension->Add(cols);
- dimension->Add(rows);
+ dimension = new std::vector<int32_t>;
+ dimension->push_back(cols);
+ dimension->push_back(rows);
}
if (!dimension) {
int32_t rows = calculateNumberOfRows(sourceCodeWords,
errorCorrectionCodeWords, m_minCols);
if (rows < m_minRows) {
- dimension = new CFX_ArrayTemplate<int32_t>;
- dimension->Add(m_minCols);
- dimension->Add(m_minRows);
+ dimension = new std::vector<int32_t>;
+ dimension->push_back(m_minCols);
+ dimension->push_back(m_minRows);
} else if (rows >= 3 && rows <= 90) {
- dimension = new CFX_ArrayTemplate<int32_t>;
- dimension->Add(m_minCols);
- dimension->Add(rows);
+ dimension = new std::vector<int32_t>;
+ dimension->push_back(m_minCols);
+ dimension->push_back(rows);
}
}
if (!dimension) {
diff --git a/xfa/fxbarcode/pdf417/BC_PDF417.h b/xfa/fxbarcode/pdf417/BC_PDF417.h
index b382e5d26e..0d8fbfaf5f 100644
--- a/xfa/fxbarcode/pdf417/BC_PDF417.h
+++ b/xfa/fxbarcode/pdf417/BC_PDF417.h
@@ -8,6 +8,7 @@
#define XFA_FXBARCODE_PDF417_BC_PDF417_H_
#include <memory>
+#include <vector>
#include "core/fxcrt/fx_basic.h"
#include "xfa/fxbarcode/pdf417/BC_PDF417Compaction.h"
@@ -51,10 +52,9 @@ class CBC_PDF417 {
int32_t r,
int32_t errorCorrectionLevel,
CBC_BarcodeMatrix* logic);
- CFX_ArrayTemplate<int32_t>* determineDimensions(
- int32_t sourceCodeWords,
- int32_t errorCorrectionCodeWords,
- int32_t& e);
+ std::vector<int32_t>* determineDimensions(int32_t sourceCodeWords,
+ int32_t errorCorrectionCodeWords,
+ int32_t& e);
std::unique_ptr<CBC_BarcodeMatrix> m_barcodeMatrix;
bool m_compact;
diff --git a/xfa/fxbarcode/pdf417/BC_PDF417BarcodeMatrix.cpp b/xfa/fxbarcode/pdf417/BC_PDF417BarcodeMatrix.cpp
index c1f4da1e3b..68bc799ec0 100644
--- a/xfa/fxbarcode/pdf417/BC_PDF417BarcodeMatrix.cpp
+++ b/xfa/fxbarcode/pdf417/BC_PDF417BarcodeMatrix.cpp
@@ -24,23 +24,22 @@
#include "xfa/fxbarcode/pdf417/BC_PDF417BarcodeRow.h"
CBC_BarcodeMatrix::CBC_BarcodeMatrix(int32_t height, int32_t width) {
- m_matrix.SetSize(height + 2);
- for (int32_t i = 0, matrixLength = m_matrix.GetSize(); i < matrixLength;
- i++) {
+ m_matrix.resize(height + 2);
+ for (size_t i = 0, matrixLength = m_matrix.size(); i < matrixLength; ++i)
m_matrix[i] = new CBC_BarcodeRow((width + 4) * 17 + 1);
- }
+
m_width = width * 17;
m_height = height + 2;
m_currentRow = 0;
m_outHeight = 0;
m_outWidth = 0;
}
-CBC_BarcodeMatrix::~CBC_BarcodeMatrix() {
- for (int32_t i = 0; i < m_matrix.GetSize(); i++)
- delete m_matrix.GetAt(i);
- m_matrixOut.RemoveAll();
+CBC_BarcodeMatrix::~CBC_BarcodeMatrix() {
+ for (size_t i = 0; i < m_matrix.size(); i++)
+ delete m_matrix[i];
}
+
void CBC_BarcodeMatrix::set(int32_t x, int32_t y, uint8_t value) {
m_matrix[y]->set(x, value);
}
@@ -59,30 +58,27 @@ int32_t CBC_BarcodeMatrix::getWidth() {
int32_t CBC_BarcodeMatrix::getHeight() {
return m_outHeight;
}
-CFX_ArrayTemplate<uint8_t>& CBC_BarcodeMatrix::getMatrix() {
+std::vector<uint8_t>& CBC_BarcodeMatrix::getMatrix() {
return getScaledMatrix(1, 1);
}
-CFX_ArrayTemplate<uint8_t>& CBC_BarcodeMatrix::getScaledMatrix(int32_t scale) {
+std::vector<uint8_t>& CBC_BarcodeMatrix::getScaledMatrix(int32_t scale) {
return getScaledMatrix(scale, scale);
}
-CFX_ArrayTemplate<uint8_t>& CBC_BarcodeMatrix::getScaledMatrix(int32_t xScale,
- int32_t yScale) {
- int32_t yMax = m_height * yScale;
- CFX_ArrayTemplate<uint8_t> bytearray;
- bytearray.Copy(m_matrix[0]->getScaledRow(xScale));
- int32_t xMax = bytearray.GetSize();
- m_matrixOut.SetSize(xMax * yMax);
+std::vector<uint8_t>& CBC_BarcodeMatrix::getScaledMatrix(int32_t xScale,
+ int32_t yScale) {
+ size_t yMax = m_height * yScale;
+ std::vector<uint8_t> bytearray = m_matrix[0]->getScaledRow(xScale);
+ size_t xMax = bytearray.size();
+ m_matrixOut.resize(xMax * yMax);
m_outWidth = xMax;
m_outHeight = yMax;
int32_t k = 0;
- for (int32_t i = 0; i < yMax; i++) {
- if (i != 0) {
- bytearray.Copy(m_matrix[i / yScale]->getScaledRow(xScale));
- }
+ for (size_t i = 0; i < yMax; i++) {
+ if (i != 0)
+ bytearray = m_matrix[i / yScale]->getScaledRow(xScale);
k = i * xMax;
- for (int32_t l = 0; l < xMax; l++) {
- m_matrixOut[k + l] = bytearray.GetAt(l);
- }
+ for (size_t l = 0; l < xMax; l++)
+ m_matrixOut[k + l] = bytearray[l];
}
return m_matrixOut;
}
diff --git a/xfa/fxbarcode/pdf417/BC_PDF417BarcodeMatrix.h b/xfa/fxbarcode/pdf417/BC_PDF417BarcodeMatrix.h
index 95ab547c90..bf86b7b55a 100644
--- a/xfa/fxbarcode/pdf417/BC_PDF417BarcodeMatrix.h
+++ b/xfa/fxbarcode/pdf417/BC_PDF417BarcodeMatrix.h
@@ -7,6 +7,8 @@
#ifndef XFA_FXBARCODE_PDF417_BC_PDF417BARCODEMATRIX_H_
#define XFA_FXBARCODE_PDF417_BC_PDF417BARCODEMATRIX_H_
+#include <vector>
+
#include "core/fxcrt/fx_basic.h"
class CBC_BarcodeRow;
@@ -21,15 +23,15 @@ class CBC_BarcodeMatrix {
void setMatrix(int32_t x, int32_t y, bool black);
void startRow();
CBC_BarcodeRow* getCurrentRow();
- CFX_ArrayTemplate<uint8_t>& getMatrix();
- CFX_ArrayTemplate<uint8_t>& getScaledMatrix(int32_t scale);
- CFX_ArrayTemplate<uint8_t>& getScaledMatrix(int32_t xScale, int32_t yScale);
+ std::vector<uint8_t>& getMatrix();
+ std::vector<uint8_t>& getScaledMatrix(int32_t scale);
+ std::vector<uint8_t>& getScaledMatrix(int32_t xScale, int32_t yScale);
int32_t getWidth();
int32_t getHeight();
private:
- CFX_ArrayTemplate<CBC_BarcodeRow*> m_matrix;
- CFX_ArrayTemplate<uint8_t> m_matrixOut;
+ std::vector<CBC_BarcodeRow*> m_matrix;
+ std::vector<uint8_t> m_matrixOut;
int32_t m_currentRow;
int32_t m_height;
int32_t m_width;
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;
}
diff --git a/xfa/fxbarcode/pdf417/BC_PDF417BarcodeRow.h b/xfa/fxbarcode/pdf417/BC_PDF417BarcodeRow.h
index 7d9d19cb56..9130a0c38f 100644
--- a/xfa/fxbarcode/pdf417/BC_PDF417BarcodeRow.h
+++ b/xfa/fxbarcode/pdf417/BC_PDF417BarcodeRow.h
@@ -7,22 +7,24 @@
#ifndef XFA_FXBARCODE_PDF417_BC_PDF417BARCODEROW_H_
#define XFA_FXBARCODE_PDF417_BC_PDF417BARCODEROW_H_
+#include <vector>
+
#include "core/fxcrt/fx_basic.h"
class CBC_BarcodeRow {
public:
- explicit CBC_BarcodeRow(int32_t width);
+ explicit CBC_BarcodeRow(size_t width);
virtual ~CBC_BarcodeRow();
void set(int32_t x, uint8_t value);
void set(int32_t x, bool black);
void addBar(bool black, int32_t width);
- CFX_ArrayTemplate<uint8_t>& getRow();
- CFX_ArrayTemplate<uint8_t>& getScaledRow(int32_t scale);
+ std::vector<uint8_t>& getRow();
+ std::vector<uint8_t>& getScaledRow(int32_t scale);
private:
- CFX_ArrayTemplate<uint8_t> m_row;
- CFX_ArrayTemplate<uint8_t> m_output;
+ std::vector<uint8_t> m_row;
+ std::vector<uint8_t> m_output;
int32_t m_currentLocation;
};
diff --git a/xfa/fxbarcode/pdf417/BC_PDF417HighLevelEncoder.cpp b/xfa/fxbarcode/pdf417/BC_PDF417HighLevelEncoder.cpp
index 0d9c7cfbd0..5402f3d7f7 100644
--- a/xfa/fxbarcode/pdf417/BC_PDF417HighLevelEncoder.cpp
+++ b/xfa/fxbarcode/pdf417/BC_PDF417HighLevelEncoder.cpp
@@ -71,9 +71,9 @@ CFX_WideString CBC_PDF417HighLevelEncoder::encodeHighLevel(
}
msg += ch;
}
- CFX_ArrayTemplate<uint8_t> byteArr;
+ std::vector<uint8_t> byteArr;
for (int32_t k = 0; k < bytes.GetLength(); k++) {
- byteArr.Add(bytes.GetAt(k));
+ byteArr.push_back(bytes.GetAt(k));
}
CFX_WideString sb;
len = msg.GetLength();
@@ -82,7 +82,7 @@ CFX_WideString CBC_PDF417HighLevelEncoder::encodeHighLevel(
if (compaction == TEXT) {
encodeText(msg, p, len, sb, textSubMode);
} else if (compaction == BYTES) {
- encodeBinary(&byteArr, p, byteArr.GetSize(), BYTE_COMPACTION, sb);
+ encodeBinary(&byteArr, p, byteArr.size(), BYTE_COMPACTION, sb);
} else if (compaction == NUMERIC) {
sb += (wchar_t)LATCH_TO_NUMERIC;
encodeNumeric(msg, p, len, sb);
@@ -261,7 +261,7 @@ int32_t CBC_PDF417HighLevelEncoder::encodeText(CFX_WideString msg,
}
return submode;
}
-void CBC_PDF417HighLevelEncoder::encodeBinary(CFX_ArrayTemplate<uint8_t>* bytes,
+void CBC_PDF417HighLevelEncoder::encodeBinary(std::vector<uint8_t>* bytes,
int32_t startpos,
int32_t count,
int32_t startmode,
@@ -278,7 +278,7 @@ void CBC_PDF417HighLevelEncoder::encodeBinary(CFX_ArrayTemplate<uint8_t>* bytes,
int64_t t = 0;
for (i = 0; i < 6; i++) {
t <<= 8;
- t += bytes->GetAt(idx + i) & 0xff;
+ t += (*bytes)[idx + i] & 0xff;
}
for (i = 0; i < 5; i++) {
chars[i] = (wchar_t)(t % 900);
@@ -294,7 +294,7 @@ void CBC_PDF417HighLevelEncoder::encodeBinary(CFX_ArrayTemplate<uint8_t>* bytes,
sb += (wchar_t)LATCH_TO_BYTE_PADDED;
}
for (i = idx; i < startpos + count; i++) {
- int32_t ch = bytes->GetAt(i) & 0xff;
+ int32_t ch = (*bytes)[i] & 0xff;
sb += (wchar_t)ch;
}
}
@@ -388,7 +388,7 @@ int32_t CBC_PDF417HighLevelEncoder::determineConsecutiveTextCount(
}
int32_t CBC_PDF417HighLevelEncoder::determineConsecutiveBinaryCount(
CFX_WideString msg,
- CFX_ArrayTemplate<uint8_t>* bytes,
+ std::vector<uint8_t>* bytes,
int32_t startpos,
int32_t& e) {
int32_t len = msg.GetLength();
@@ -420,7 +420,7 @@ int32_t CBC_PDF417HighLevelEncoder::determineConsecutiveBinaryCount(
return idx - startpos;
}
ch = msg.GetAt(idx);
- if (bytes->GetAt(idx) == 63 && ch != '?') {
+ if ((*bytes)[idx] == 63 && ch != '?') {
e = BCExceptionNonEncodableCharacterDetected;
return -1;
}
diff --git a/xfa/fxbarcode/pdf417/BC_PDF417HighLevelEncoder.h b/xfa/fxbarcode/pdf417/BC_PDF417HighLevelEncoder.h
index 01c2be02f8..48b8d009fc 100644
--- a/xfa/fxbarcode/pdf417/BC_PDF417HighLevelEncoder.h
+++ b/xfa/fxbarcode/pdf417/BC_PDF417HighLevelEncoder.h
@@ -7,6 +7,8 @@
#ifndef XFA_FXBARCODE_PDF417_BC_PDF417HIGHLEVELENCODER_H_
#define XFA_FXBARCODE_PDF417_BC_PDF417HIGHLEVELENCODER_H_
+#include <vector>
+
#include "core/fxcrt/fx_basic.h"
#include "core/fxcrt/fx_string.h"
#include "xfa/fxbarcode/pdf417/BC_PDF417Compaction.h"
@@ -39,7 +41,7 @@ class CBC_PDF417HighLevelEncoder {
int32_t count,
CFX_WideString& sb,
int32_t initialSubmode);
- static void encodeBinary(CFX_ArrayTemplate<uint8_t>* bytes,
+ static void encodeBinary(std::vector<uint8_t>* bytes,
int32_t startpos,
int32_t count,
int32_t startmode,
@@ -58,11 +60,10 @@ class CBC_PDF417HighLevelEncoder {
int32_t startpos);
static int32_t determineConsecutiveTextCount(CFX_WideString msg,
int32_t startpos);
- static int32_t determineConsecutiveBinaryCount(
- CFX_WideString msg,
- CFX_ArrayTemplate<uint8_t>* bytes,
- int32_t startpos,
- int32_t& e);
+ static int32_t determineConsecutiveBinaryCount(CFX_WideString msg,
+ std::vector<uint8_t>* bytes,
+ int32_t startpos,
+ int32_t& e);
friend class PDF417HighLevelEncoder_EncodeNumeric_Test;
friend class PDF417HighLevelEncoder_EncodeBinary_Test;
diff --git a/xfa/fxbarcode/pdf417/BC_PDF417HighLevelEncoder_unittest.cpp b/xfa/fxbarcode/pdf417/BC_PDF417HighLevelEncoder_unittest.cpp
index 2cd60fef41..a1f3283dd8 100644
--- a/xfa/fxbarcode/pdf417/BC_PDF417HighLevelEncoder_unittest.cpp
+++ b/xfa/fxbarcode/pdf417/BC_PDF417HighLevelEncoder_unittest.cpp
@@ -43,11 +43,11 @@ TEST(PDF417HighLevelEncoder, EncodeBinary) {
CBC_PDF417HighLevelEncoder::Initialize();
for (size_t i = 0; i < FX_ArraySize(encode_binary_cases); ++i) {
EncodeBinaryCase* ptr = &encode_binary_cases[i];
- CFX_ArrayTemplate<uint8_t> input_array;
+ std::vector<uint8_t> input_array;
size_t input_length = strlen(ptr->input);
- input_array.SetSize(input_length);
+ input_array.resize(input_length);
for (size_t j = 0; j < input_length; ++j) {
- input_array.SetAt(j, ptr->input[j]);
+ input_array[j] = ptr->input[j];
}
CFX_WideString expected(ptr->expected, ptr->expected_length);
CFX_WideString result;
diff --git a/xfa/fxbarcode/pdf417/BC_PDF417Writer.cpp b/xfa/fxbarcode/pdf417/BC_PDF417Writer.cpp
index 2c75a14a80..ddd740d12e 100644
--- a/xfa/fxbarcode/pdf417/BC_PDF417Writer.cpp
+++ b/xfa/fxbarcode/pdf417/BC_PDF417Writer.cpp
@@ -64,9 +64,8 @@ uint8_t* CBC_PDF417Writer::Encode(const CFX_WideString& contents,
int32_t lineThickness = 2;
int32_t aspectRatio = 4;
CBC_BarcodeMatrix* barcodeMatrix = encoder.getBarcodeMatrix();
- CFX_ArrayTemplate<uint8_t> originalScale;
- originalScale.Copy(barcodeMatrix->getScaledMatrix(
- lineThickness, aspectRatio * lineThickness));
+ std::vector<uint8_t> originalScale = barcodeMatrix->getScaledMatrix(
+ lineThickness, aspectRatio * lineThickness);
int32_t width = outWidth;
int32_t height = outHeight;
outWidth = barcodeMatrix->getWidth();
@@ -88,9 +87,8 @@ uint8_t* CBC_PDF417Writer::Encode(const CFX_WideString& contents,
scale = scaleY;
}
if (scale > 1) {
- originalScale.RemoveAll();
- originalScale.Copy(barcodeMatrix->getScaledMatrix(
- scale * lineThickness, scale * aspectRatio * lineThickness));
+ originalScale = barcodeMatrix->getScaledMatrix(
+ scale * lineThickness, scale * aspectRatio * lineThickness);
if (rotated) {
rotateArray(originalScale, outHeight, outWidth);
int32_t temp = outHeight;
@@ -99,14 +97,13 @@ uint8_t* CBC_PDF417Writer::Encode(const CFX_WideString& contents,
}
}
uint8_t* result = FX_Alloc2D(uint8_t, outHeight, outWidth);
- FXSYS_memcpy(result, originalScale.GetData(), outHeight * outWidth);
+ FXSYS_memcpy(result, originalScale.data(), outHeight * outWidth);
return result;
}
-void CBC_PDF417Writer::rotateArray(CFX_ArrayTemplate<uint8_t>& bitarray,
+void CBC_PDF417Writer::rotateArray(std::vector<uint8_t>& bitarray,
int32_t height,
int32_t width) {
- CFX_ArrayTemplate<uint8_t> temp;
- temp.Copy(bitarray);
+ std::vector<uint8_t> temp = bitarray;
for (int32_t ii = 0; ii < height; ii++) {
int32_t inverseii = height - ii - 1;
for (int32_t jj = 0; jj < width; jj++) {
diff --git a/xfa/fxbarcode/pdf417/BC_PDF417Writer.h b/xfa/fxbarcode/pdf417/BC_PDF417Writer.h
index 420c441bc9..564f80849c 100644
--- a/xfa/fxbarcode/pdf417/BC_PDF417Writer.h
+++ b/xfa/fxbarcode/pdf417/BC_PDF417Writer.h
@@ -7,6 +7,8 @@
#ifndef XFA_FXBARCODE_PDF417_BC_PDF417WRITER_H_
#define XFA_FXBARCODE_PDF417_BC_PDF417WRITER_H_
+#include <vector>
+
#include "core/fxcrt/fx_string.h"
#include "core/fxcrt/fx_system.h"
#include "xfa/fxbarcode/BC_TwoDimWriter.h"
@@ -27,7 +29,7 @@ class CBC_PDF417Writer : public CBC_TwoDimWriter {
void SetTruncated(bool truncated);
private:
- void rotateArray(CFX_ArrayTemplate<uint8_t>& bitarray,
+ void rotateArray(std::vector<uint8_t>& bitarray,
int32_t width,
int32_t height);
bool m_bTruncated;