Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(671)

Unified Diff: xfa/fxbarcode/datamatrix/BC_HighLevelEncoder.cpp

Issue 2649563003: Replace CFX_ByteArray with CFX_ArrayTemplate<uint8_t> (Closed)
Patch Set: re-upload Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « xfa/fxbarcode/datamatrix/BC_HighLevelEncoder.h ('k') | xfa/fxbarcode/pdf417/BC_PDF417.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: xfa/fxbarcode/datamatrix/BC_HighLevelEncoder.cpp
diff --git a/xfa/fxbarcode/datamatrix/BC_HighLevelEncoder.cpp b/xfa/fxbarcode/datamatrix/BC_HighLevelEncoder.cpp
index fcd668af6db64709d2f89b50bbfce5870ad56754..4b4b24603855630aeef9920982e8b5b40afe851d 100644
--- a/xfa/fxbarcode/datamatrix/BC_HighLevelEncoder.cpp
+++ b/xfa/fxbarcode/datamatrix/BC_HighLevelEncoder.cpp
@@ -58,7 +58,8 @@ const wchar_t CBC_HighLevelEncoder::MACRO_TRAILER = 0x0004;
CBC_HighLevelEncoder::CBC_HighLevelEncoder() {}
CBC_HighLevelEncoder::~CBC_HighLevelEncoder() {}
-CFX_ByteArray& CBC_HighLevelEncoder::getBytesForMessage(CFX_WideString msg) {
+CFX_ArrayTemplate<uint8_t>& CBC_HighLevelEncoder::getBytesForMessage(
+ CFX_WideString msg) {
CFX_ByteString bytestr;
CBC_UtilCodingConvert::UnicodeToUTF8(msg, bytestr);
for (int32_t i = 0; i < bytestr.GetLength(); i++) {
@@ -159,9 +160,9 @@ int32_t CBC_HighLevelEncoder::lookAheadTest(CFX_WideString msg,
while (true) {
if ((startpos + charsProcessed) == msg.GetLength()) {
int32_t min = std::numeric_limits<int32_t>::max();
- CFX_ByteArray mins;
+ CFX_ArrayTemplate<uint8_t> mins;
mins.SetSize(6);
- CFX_Int32Array intCharCounts;
+ CFX_ArrayTemplate<int32_t> intCharCounts;
intCharCounts.SetSize(6);
min = findMinimums(charCounts, intCharCounts, min, mins);
int32_t minCount = getMinimumCount(mins);
@@ -229,9 +230,9 @@ int32_t CBC_HighLevelEncoder::lookAheadTest(CFX_WideString msg,
charCounts[BASE256_ENCODATION]++;
}
if (charsProcessed >= 4) {
- CFX_Int32Array intCharCounts;
+ CFX_ArrayTemplate<int32_t> intCharCounts;
intCharCounts.SetSize(6);
- CFX_ByteArray mins;
+ CFX_ArrayTemplate<uint8_t> mins;
mins.SetSize(6);
findMinimums(charCounts, intCharCounts,
std::numeric_limits<int32_t>::max(), mins);
@@ -317,10 +318,11 @@ FX_WCHAR CBC_HighLevelEncoder::randomize253State(FX_WCHAR ch,
return tempVariable <= 254 ? (FX_WCHAR)tempVariable
: (FX_WCHAR)(tempVariable - 254);
}
-int32_t CBC_HighLevelEncoder::findMinimums(std::vector<FX_FLOAT>& charCounts,
- CFX_Int32Array& intCharCounts,
- int32_t min,
- CFX_ByteArray& mins) {
+int32_t CBC_HighLevelEncoder::findMinimums(
+ std::vector<FX_FLOAT>& charCounts,
+ CFX_ArrayTemplate<int32_t>& intCharCounts,
+ int32_t min,
+ CFX_ArrayTemplate<uint8_t>& mins) {
for (int32_t l = 0; l < mins.GetSize(); l++) {
mins[l] = (uint8_t)0;
}
@@ -339,7 +341,8 @@ int32_t CBC_HighLevelEncoder::findMinimums(std::vector<FX_FLOAT>& charCounts,
}
return min;
}
-int32_t CBC_HighLevelEncoder::getMinimumCount(CFX_ByteArray& mins) {
+int32_t CBC_HighLevelEncoder::getMinimumCount(
+ CFX_ArrayTemplate<uint8_t>& mins) {
int32_t minCount = 0;
for (int32_t i = 0; i < 6; i++) {
minCount += mins[i];
« no previous file with comments | « xfa/fxbarcode/datamatrix/BC_HighLevelEncoder.h ('k') | xfa/fxbarcode/pdf417/BC_PDF417.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698