summaryrefslogtreecommitdiff
path: root/xfa/fxbarcode/oned/BC_OnedCode128Writer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'xfa/fxbarcode/oned/BC_OnedCode128Writer.cpp')
-rw-r--r--xfa/fxbarcode/oned/BC_OnedCode128Writer.cpp24
1 files changed, 12 insertions, 12 deletions
diff --git a/xfa/fxbarcode/oned/BC_OnedCode128Writer.cpp b/xfa/fxbarcode/oned/BC_OnedCode128Writer.cpp
index c1e28a50c1..7adbb1f55c 100644
--- a/xfa/fxbarcode/oned/BC_OnedCode128Writer.cpp
+++ b/xfa/fxbarcode/oned/BC_OnedCode128Writer.cpp
@@ -187,7 +187,7 @@ uint8_t* CBC_OnedCode128Writer::Encode(const CFX_ByteString& contents,
e = BCExceptionContentsLengthShouldBetween1and80;
return nullptr;
}
- CFX_ArrayTemplate<const int32_t*> patterns;
+ std::vector<const int32_t*> patterns;
int32_t checkSum = 0;
if (m_codeFormat == BC_CODE128_B) {
checkSum = Encode128B(contents, &patterns);
@@ -198,20 +198,20 @@ uint8_t* CBC_OnedCode128Writer::Encode(const CFX_ByteString& contents,
return nullptr;
}
checkSum %= 103;
- patterns.Add(CODE_PATTERNS[checkSum]);
- patterns.Add(CODE_PATTERNS[CODE_STOP]);
+ patterns.push_back(CODE_PATTERNS[checkSum]);
+ patterns.push_back(CODE_PATTERNS[CODE_STOP]);
m_iContentLen = contents.GetLength() + 3;
int32_t codeWidth = 0;
- for (int32_t k = 0; k < patterns.GetSize(); k++) {
+ for (size_t k = 0; k < patterns.size(); k++) {
const int32_t* pattern = patterns[k];
- for (int32_t j = 0; j < 7; j++) {
+ for (size_t j = 0; j < 7; j++) {
codeWidth += pattern[j];
}
}
outLength = codeWidth;
uint8_t* result = FX_Alloc(uint8_t, outLength);
int32_t pos = 0;
- for (int32_t j = 0; j < patterns.GetSize(); j++) {
+ for (size_t j = 0; j < patterns.size(); j++) {
const int32_t* pattern = patterns[j];
pos += AppendPattern(result, pos, pattern, 7, 1, e);
if (e != BCExceptionNO) {
@@ -224,17 +224,17 @@ uint8_t* CBC_OnedCode128Writer::Encode(const CFX_ByteString& contents,
int32_t CBC_OnedCode128Writer::Encode128B(
const CFX_ByteString& contents,
- CFX_ArrayTemplate<const int32_t*>* patterns) {
+ std::vector<const int32_t*>* patterns) {
int32_t checkSum = 0;
int32_t checkWeight = 1;
int32_t position = 0;
- patterns->Add(CODE_PATTERNS[CODE_START_B]);
+ patterns->push_back(CODE_PATTERNS[CODE_START_B]);
checkSum += CODE_START_B * checkWeight;
while (position < contents.GetLength()) {
int32_t patternIndex = 0;
patternIndex = contents[position] - ' ';
position += 1;
- patterns->Add(CODE_PATTERNS[patternIndex]);
+ patterns->push_back(CODE_PATTERNS[patternIndex]);
checkSum += patternIndex * checkWeight;
if (position != 0) {
checkWeight++;
@@ -245,11 +245,11 @@ int32_t CBC_OnedCode128Writer::Encode128B(
int32_t CBC_OnedCode128Writer::Encode128C(
const CFX_ByteString& contents,
- CFX_ArrayTemplate<const int32_t*>* patterns) {
+ std::vector<const int32_t*>* patterns) {
int32_t checkSum = 0;
int32_t checkWeight = 1;
int32_t position = 0;
- patterns->Add(CODE_PATTERNS[CODE_START_C]);
+ patterns->push_back(CODE_PATTERNS[CODE_START_C]);
checkSum += CODE_START_C * checkWeight;
while (position < contents.GetLength()) {
int32_t patternIndex = 0;
@@ -266,7 +266,7 @@ int32_t CBC_OnedCode128Writer::Encode128C(
position += 2;
}
}
- patterns->Add(CODE_PATTERNS[patternIndex]);
+ patterns->push_back(CODE_PATTERNS[patternIndex]);
checkSum += patternIndex * checkWeight;
if (position != 0) {
checkWeight++;