summaryrefslogtreecommitdiff
path: root/xfa/fxbarcode/pdf417/BC_PDF417HighLevelEncoder.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_PDF417HighLevelEncoder.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_PDF417HighLevelEncoder.cpp')
-rw-r--r--xfa/fxbarcode/pdf417/BC_PDF417HighLevelEncoder.cpp16
1 files changed, 8 insertions, 8 deletions
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;
}