summaryrefslogtreecommitdiff
path: root/xfa/fxbarcode/pdf417/BC_PDF417Writer.cpp
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/BC_PDF417Writer.cpp
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/BC_PDF417Writer.cpp')
-rw-r--r--xfa/fxbarcode/pdf417/BC_PDF417Writer.cpp17
1 files changed, 7 insertions, 10 deletions
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++) {