Replace CFX_ByteArray with CFX_ArrayTemplate<uint8_t> Also replace CFX_Int32Array typedef with CFX_ArrayTemplate<int32_t>. Removing the typedefs makes subsequent conversion to std::vector<> easier on a case-by-case basis. Review-Url: https://codereview.chromium.org/2649563003
diff --git a/core/fxcrt/fx_arabic.cpp b/core/fxcrt/fx_arabic.cpp index d6b3c65..a649e49 100644 --- a/core/fxcrt/fx_arabic.cpp +++ b/core/fxcrt/fx_arabic.cpp
@@ -374,7 +374,7 @@ int32_t FX_BidiReorderLevel(int32_t iBaseLevel, CFX_WideString& wsText, - const CFX_Int32Array& levels, + const CFX_ArrayTemplate<int32_t>& levels, int32_t iStart, bool bReverse) { ASSERT(iBaseLevel >= 0 && iBaseLevel <= FX_BIDIMAXLEVEL); @@ -403,7 +403,7 @@ } void FX_BidiReorder(int32_t iBaseLevel, CFX_WideString& wsText, - const CFX_Int32Array& levels) { + const CFX_ArrayTemplate<int32_t>& levels) { ASSERT(iBaseLevel >= 0 && iBaseLevel <= FX_BIDIMAXLEVEL); ASSERT(wsText.GetLength() == levels.GetSize()); int32_t iSize = wsText.GetLength();
diff --git a/core/fxcrt/fx_arabic.h b/core/fxcrt/fx_arabic.h index 1f4d38b..e7ba079 100644 --- a/core/fxcrt/fx_arabic.h +++ b/core/fxcrt/fx_arabic.h
@@ -30,17 +30,17 @@ void FX_BidiReverseString(CFX_WideString& wsText, int32_t iStart, int32_t iCount); -void FX_BidiSetDeferredRun(CFX_Int32Array& values, +void FX_BidiSetDeferredRun(CFX_ArrayTemplate<int32_t>& values, int32_t iStart, int32_t iCount, int32_t iValue); void FX_BidiClassify(const CFX_WideString& wsText, - CFX_Int32Array& classes, + CFX_ArrayTemplate<int32_t>& classes, bool bWS = false); int32_t FX_BidiResolveExplicit(int32_t iBaseLevel, int32_t iDirection, - CFX_Int32Array& classes, - CFX_Int32Array& levels, + CFX_ArrayTemplate<int32_t>& classes, + CFX_ArrayTemplate<int32_t>& levels, int32_t iStart, int32_t iCount, int32_t iNest = 0); @@ -136,8 +136,8 @@ #define FX_BWALxx FX_BIDIWEAKACTION_Lxx void FX_BidiResolveWeak(int32_t iBaseLevel, - CFX_Int32Array& classes, - CFX_Int32Array& levels); + CFX_ArrayTemplate<int32_t>& classes, + CFX_ArrayTemplate<int32_t>& levels); enum FX_BIDINEUTRALSTATE { FX_BIDINEUTRALSTATE_r = 0, FX_BIDINEUTRALSTATE_l, @@ -169,20 +169,20 @@ int32_t FX_BidiGetDeferredNeutrals(int32_t iAction, int32_t iLevel); int32_t FX_BidiGetResolvedNeutrals(int32_t iAction); void FX_BidiResolveNeutrals(int32_t iBaseLevel, - CFX_Int32Array& classes, - const CFX_Int32Array& levels); -void FX_BidiResolveImplicit(const CFX_Int32Array& classes, - CFX_Int32Array& levels); + CFX_ArrayTemplate<int32_t>& classes, + const CFX_ArrayTemplate<int32_t>& levels); +void FX_BidiResolveImplicit(const CFX_ArrayTemplate<int32_t>& classes, + CFX_ArrayTemplate<int32_t>& levels); void FX_BidiResolveWhitespace(int32_t iBaseLevel, - const CFX_Int32Array& classes, - CFX_Int32Array& levels); + const CFX_ArrayTemplate<int32_t>& classes, + CFX_ArrayTemplate<int32_t>& levels); int32_t FX_BidiReorderLevel(int32_t iBaseLevel, CFX_WideString& wsText, - const CFX_Int32Array& levels, + const CFX_ArrayTemplate<int32_t>& levels, int32_t iStart, bool bReverse = false); void FX_BidiReorder(int32_t iBaseLevel, CFX_WideString& wsText, - const CFX_Int32Array& levels); + const CFX_ArrayTemplate<int32_t>& levels); #endif // CORE_FXCRT_FX_ARABIC_H_
diff --git a/core/fxcrt/fx_basic.h b/core/fxcrt/fx_basic.h index 5adcf70..31850f5 100644 --- a/core/fxcrt/fx_basic.h +++ b/core/fxcrt/fx_basic.h
@@ -313,11 +313,6 @@ } }; -#ifdef PDF_ENABLE_XFA -typedef CFX_ArrayTemplate<uint8_t> CFX_ByteArray; -typedef CFX_ArrayTemplate<int32_t> CFX_Int32Array; -#endif // PDF_ENABLE_XFA - template <class DataType, int FixedSize> class CFX_FixedBufGrow { public:
diff --git a/xfa/fde/tto/fde_textout.h b/xfa/fde/tto/fde_textout.h index 94b72f8..084af42 100644 --- a/xfa/fde/tto/fde_textout.h +++ b/xfa/fde/tto/fde_textout.h
@@ -179,7 +179,7 @@ int32_t m_iTotalLines; std::vector<FXTEXT_CHARPOS> m_CharPos; std::unique_ptr<CFDE_RenderDevice> m_pRenderDevice; - CFX_Int32Array m_hotKeys; + CFX_ArrayTemplate<int32_t> m_hotKeys; CFX_RectFArray m_rectArray; };
diff --git a/xfa/fde/xml/cfx_saxreader.h b/xfa/fde/xml/cfx_saxreader.h index 8e06d9b..129399d 100644 --- a/xfa/fde/xml/cfx_saxreader.h +++ b/xfa/fde/xml/cfx_saxreader.h
@@ -128,7 +128,7 @@ bool m_bCharData; uint8_t m_CurByte; uint32_t m_dwDataOffset; - CFX_ByteArray m_SkipStack; + CFX_ArrayTemplate<uint8_t> m_SkipStack; uint8_t m_SkipChar; uint32_t m_dwNodePos; uint8_t* m_pszData;
diff --git a/xfa/fgas/layout/fgas_rtfbreak.h b/xfa/fgas/layout/fgas_rtfbreak.h index 6edd860..91862dc 100644 --- a/xfa/fgas/layout/fgas_rtfbreak.h +++ b/xfa/fgas/layout/fgas_rtfbreak.h
@@ -298,7 +298,7 @@ int32_t m_iFontHeight; int32_t m_iFontSize; int32_t m_iTabWidth; - CFX_Int32Array m_PositionedTabs; + CFX_ArrayTemplate<int32_t> m_PositionedTabs; bool m_bOrphanLine; FX_WCHAR m_wDefChar; int32_t m_iDefChar;
diff --git a/xfa/fxbarcode/BC_UtilCodingConvert.cpp b/xfa/fxbarcode/BC_UtilCodingConvert.cpp index 7347575..c06cffc 100644 --- a/xfa/fxbarcode/BC_UtilCodingConvert.cpp +++ b/xfa/fxbarcode/BC_UtilCodingConvert.cpp
@@ -22,7 +22,7 @@ } void CBC_UtilCodingConvert::LocaleToUtf8(const CFX_ByteString& src, - CFX_ByteArray& dst) { + CFX_ArrayTemplate<uint8_t>& dst) { CFX_WideString unicode = CFX_WideString::FromLocal(src.AsStringC()); CFX_ByteString utf8 = unicode.UTF8Encode(); for (int32_t i = 0; i < utf8.GetLength(); i++) { @@ -30,7 +30,7 @@ } } -void CBC_UtilCodingConvert::Utf8ToLocale(const CFX_ByteArray& src, +void CBC_UtilCodingConvert::Utf8ToLocale(const CFX_ArrayTemplate<uint8_t>& src, CFX_ByteString& dst) { CFX_ByteString utf8; for (int32_t i = 0; i < src.GetSize(); i++) {
diff --git a/xfa/fxbarcode/BC_UtilCodingConvert.h b/xfa/fxbarcode/BC_UtilCodingConvert.h index 698cd85..859eeea 100644 --- a/xfa/fxbarcode/BC_UtilCodingConvert.h +++ b/xfa/fxbarcode/BC_UtilCodingConvert.h
@@ -17,8 +17,10 @@ CFX_ByteString& result); static void LocaleToUtf8(const CFX_ByteString& source, CFX_ByteString& result); - static void LocaleToUtf8(const CFX_ByteString& source, CFX_ByteArray& result); - static void Utf8ToLocale(const CFX_ByteArray& source, CFX_ByteString& result); + static void LocaleToUtf8(const CFX_ByteString& source, + CFX_ArrayTemplate<uint8_t>& result); + static void Utf8ToLocale(const CFX_ArrayTemplate<uint8_t>& source, + CFX_ByteString& result); static void Utf8ToLocale(const uint8_t* source, int32_t count, CFX_ByteString& result);
diff --git a/xfa/fxbarcode/BC_Utils.cpp b/xfa/fxbarcode/BC_Utils.cpp index 807b048..5d881c7 100644 --- a/xfa/fxbarcode/BC_Utils.cpp +++ b/xfa/fxbarcode/BC_Utils.cpp
@@ -26,7 +26,8 @@ dst += c; } } -void BC_FX_ByteString_Append(CFX_ByteString& dst, const CFX_ByteArray& ba) { +void BC_FX_ByteString_Append(CFX_ByteString& dst, + const CFX_ArrayTemplate<uint8_t>& ba) { for (int32_t i = 0; i < ba.GetSize(); i++) { dst += ba[i]; }
diff --git a/xfa/fxbarcode/common/BC_CommonBitArray.cpp b/xfa/fxbarcode/common/BC_CommonBitArray.cpp index 722bbc5..0371837 100644 --- a/xfa/fxbarcode/common/BC_CommonBitArray.cpp +++ b/xfa/fxbarcode/common/BC_CommonBitArray.cpp
@@ -41,7 +41,7 @@ int32_t CBC_CommonBitArray::GetSize() { return m_size; } -CFX_Int32Array& CBC_CommonBitArray::GetBits() { +CFX_ArrayTemplate<int32_t>& CBC_CommonBitArray::GetBits() { return m_bits; } int32_t CBC_CommonBitArray::GetSizeInBytes() {
diff --git a/xfa/fxbarcode/common/BC_CommonBitArray.h b/xfa/fxbarcode/common/BC_CommonBitArray.h index 80a56d1..6ad8ab3 100644 --- a/xfa/fxbarcode/common/BC_CommonBitArray.h +++ b/xfa/fxbarcode/common/BC_CommonBitArray.h
@@ -17,7 +17,7 @@ virtual ~CBC_CommonBitArray(); int32_t GetSize(); - CFX_Int32Array& GetBits(); + CFX_ArrayTemplate<int32_t>& GetBits(); int32_t GetSizeInBytes(); bool Get(int32_t i); void Set(int32_t i); @@ -30,7 +30,7 @@ private: int32_t m_size; - CFX_Int32Array m_bits; + CFX_ArrayTemplate<int32_t> m_bits; }; #endif // XFA_FXBARCODE_COMMON_BC_COMMONBITARRAY_H_
diff --git a/xfa/fxbarcode/common/BC_CommonByteArray.cpp b/xfa/fxbarcode/common/BC_CommonByteArray.cpp index 71fa85f..050ecb0 100644 --- a/xfa/fxbarcode/common/BC_CommonByteArray.cpp +++ b/xfa/fxbarcode/common/BC_CommonByteArray.cpp
@@ -85,7 +85,7 @@ FXSYS_memcpy(m_bytes, source + offset, count); m_index = count; } -void CBC_CommonByteArray::Set(CFX_ByteArray* source, +void CBC_CommonByteArray::Set(CFX_ArrayTemplate<uint8_t>* source, int32_t offset, int32_t count) { FX_Free(m_bytes);
diff --git a/xfa/fxbarcode/common/BC_CommonByteArray.h b/xfa/fxbarcode/common/BC_CommonByteArray.h index dd6ee58..009f625 100644 --- a/xfa/fxbarcode/common/BC_CommonByteArray.h +++ b/xfa/fxbarcode/common/BC_CommonByteArray.h
@@ -25,7 +25,7 @@ void AppendByte(int32_t value); void Reserve(int32_t capacity); void Set(uint8_t* source, int32_t offset, int32_t count); - void Set(CFX_ByteArray* source, int32_t offset, int32_t count); + void Set(CFX_ArrayTemplate<uint8_t>* source, int32_t offset, int32_t count); private: int32_t m_size;
diff --git a/xfa/fxbarcode/common/reedsolomon/BC_ReedSolomon.cpp b/xfa/fxbarcode/common/reedsolomon/BC_ReedSolomon.cpp index 352dc3d..eac1a10 100644 --- a/xfa/fxbarcode/common/reedsolomon/BC_ReedSolomon.cpp +++ b/xfa/fxbarcode/common/reedsolomon/BC_ReedSolomon.cpp
@@ -39,7 +39,7 @@ CBC_ReedSolomonGF256Poly* lastGenerator = m_cachedGenerators[m_cachedGenerators.GetSize() - 1]; for (int32_t d = m_cachedGenerators.GetSize(); d <= degree; d++) { - CFX_Int32Array temp; + CFX_ArrayTemplate<int32_t> temp; temp.Add(1); temp.Add(m_field->Exp(d - 1)); CBC_ReedSolomonGF256Poly temp_poly; @@ -54,7 +54,7 @@ } return m_cachedGenerators[degree]; } -void CBC_ReedSolomonEncoder::Encode(CFX_Int32Array* toEncode, +void CBC_ReedSolomonEncoder::Encode(CFX_ArrayTemplate<int32_t>* toEncode, int32_t ecBytes, int32_t& e) { if (ecBytes == 0) { @@ -68,7 +68,7 @@ } CBC_ReedSolomonGF256Poly* generator = BuildGenerator(ecBytes, e); BC_EXCEPTION_CHECK_ReturnVoid(e); - CFX_Int32Array infoCoefficients; + CFX_ArrayTemplate<int32_t> infoCoefficients; infoCoefficients.SetSize(dataBytes); for (int32_t x = 0; x < dataBytes; x++) { infoCoefficients[x] = toEncode->operator[](x); @@ -83,7 +83,7 @@ infoTemp->Divide(generator, e)); BC_EXCEPTION_CHECK_ReturnVoid(e); CBC_ReedSolomonGF256Poly* remainder = (*temp)[1]; - CFX_Int32Array* coefficients = remainder->GetCoefficients(); + CFX_ArrayTemplate<int32_t>* coefficients = remainder->GetCoefficients(); int32_t numZeroCoefficients = ecBytes - coefficients->GetSize(); for (int32_t i = 0; i < numZeroCoefficients; i++) { (*toEncode)[dataBytes + i] = 0;
diff --git a/xfa/fxbarcode/common/reedsolomon/BC_ReedSolomon.h b/xfa/fxbarcode/common/reedsolomon/BC_ReedSolomon.h index b71cfb4..95828f1 100644 --- a/xfa/fxbarcode/common/reedsolomon/BC_ReedSolomon.h +++ b/xfa/fxbarcode/common/reedsolomon/BC_ReedSolomon.h
@@ -17,7 +17,9 @@ explicit CBC_ReedSolomonEncoder(CBC_ReedSolomonGF256* field); virtual ~CBC_ReedSolomonEncoder(); - void Encode(CFX_Int32Array* toEncode, int32_t ecBytes, int32_t& e); + void Encode(CFX_ArrayTemplate<int32_t>* toEncode, + int32_t ecBytes, + int32_t& e); virtual void Init(); private:
diff --git a/xfa/fxbarcode/common/reedsolomon/BC_ReedSolomonGF256.cpp b/xfa/fxbarcode/common/reedsolomon/BC_ReedSolomonGF256.cpp index 33b828c..030048a 100644 --- a/xfa/fxbarcode/common/reedsolomon/BC_ReedSolomonGF256.cpp +++ b/xfa/fxbarcode/common/reedsolomon/BC_ReedSolomonGF256.cpp
@@ -85,7 +85,7 @@ BC_EXCEPTION_CHECK_ReturnValue(e, nullptr); return temp; } - CFX_Int32Array coefficients; + CFX_ArrayTemplate<int32_t> coefficients; coefficients.SetSize(degree + 1); coefficients[0] = coefficient; CBC_ReedSolomonGF256Poly* temp = new CBC_ReedSolomonGF256Poly();
diff --git a/xfa/fxbarcode/common/reedsolomon/BC_ReedSolomonGF256Poly.cpp b/xfa/fxbarcode/common/reedsolomon/BC_ReedSolomonGF256Poly.cpp index 60f1f1b..748646b 100644 --- a/xfa/fxbarcode/common/reedsolomon/BC_ReedSolomonGF256Poly.cpp +++ b/xfa/fxbarcode/common/reedsolomon/BC_ReedSolomonGF256Poly.cpp
@@ -38,7 +38,7 @@ m_field = nullptr; } void CBC_ReedSolomonGF256Poly::Init(CBC_ReedSolomonGF256* field, - CFX_Int32Array* coefficients, + CFX_ArrayTemplate<int32_t>* coefficients, int32_t& e) { if (!coefficients || coefficients->GetSize() == 0) { e = BCExceptionCoefficientsSizeIsNull; @@ -64,7 +64,7 @@ m_coefficients.Copy(*coefficients); } } -CFX_Int32Array* CBC_ReedSolomonGF256Poly::GetCoefficients() { +CFX_ArrayTemplate<int32_t>* CBC_ReedSolomonGF256Poly::GetCoefficients() { return &m_coefficients; } int32_t CBC_ReedSolomonGF256Poly::GetDegree() { @@ -109,17 +109,17 @@ if (other->IsZero()) return Clone(e); - CFX_Int32Array smallerCoefficients; + CFX_ArrayTemplate<int32_t> smallerCoefficients; smallerCoefficients.Copy(m_coefficients); - CFX_Int32Array largerCoefficients; + CFX_ArrayTemplate<int32_t> largerCoefficients; largerCoefficients.Copy(*(other->GetCoefficients())); if (smallerCoefficients.GetSize() > largerCoefficients.GetSize()) { - CFX_Int32Array temp; + CFX_ArrayTemplate<int32_t> temp; temp.Copy(smallerCoefficients); smallerCoefficients.Copy(largerCoefficients); largerCoefficients.Copy(temp); } - CFX_Int32Array sumDiff; + CFX_ArrayTemplate<int32_t> sumDiff; sumDiff.SetSize(largerCoefficients.GetSize()); int32_t lengthDiff = largerCoefficients.GetSize() - smallerCoefficients.GetSize(); @@ -141,13 +141,13 @@ if (IsZero() || other->IsZero()) return m_field->GetZero()->Clone(e); - CFX_Int32Array aCoefficients; + CFX_ArrayTemplate<int32_t> aCoefficients; aCoefficients.Copy(m_coefficients); int32_t aLength = m_coefficients.GetSize(); - CFX_Int32Array bCoefficients; + CFX_ArrayTemplate<int32_t> bCoefficients; bCoefficients.Copy(*(other->GetCoefficients())); int32_t bLength = other->GetCoefficients()->GetSize(); - CFX_Int32Array product; + CFX_ArrayTemplate<int32_t> product; product.SetSize(aLength + bLength - 1); for (int32_t i = 0; i < aLength; i++) { int32_t aCoeff = m_coefficients[i]; @@ -170,7 +170,7 @@ return Clone(e); int32_t size = m_coefficients.GetSize(); - CFX_Int32Array product; + CFX_ArrayTemplate<int32_t> product; product.SetSize(size); for (int32_t i = 0; i < size; i++) { product[i] = m_field->Multiply(m_coefficients[i], scalar); @@ -192,7 +192,7 @@ return m_field->GetZero()->Clone(e); int32_t size = m_coefficients.GetSize(); - CFX_Int32Array product; + CFX_ArrayTemplate<int32_t> product; product.SetSize(size + degree); for (int32_t i = 0; i < size; i++) { product[i] = (m_field->Multiply(m_coefficients[i], coefficient));
diff --git a/xfa/fxbarcode/common/reedsolomon/BC_ReedSolomonGF256Poly.h b/xfa/fxbarcode/common/reedsolomon/BC_ReedSolomonGF256Poly.h index 3eff31b..ff93264 100644 --- a/xfa/fxbarcode/common/reedsolomon/BC_ReedSolomonGF256Poly.h +++ b/xfa/fxbarcode/common/reedsolomon/BC_ReedSolomonGF256Poly.h
@@ -17,11 +17,11 @@ CBC_ReedSolomonGF256Poly(); ~CBC_ReedSolomonGF256Poly(); void Init(CBC_ReedSolomonGF256* field, - CFX_Int32Array* coefficients, + CFX_ArrayTemplate<int32_t>* coefficients, int32_t& e); int32_t GetCoefficients(int32_t degree); - CFX_Int32Array* GetCoefficients(); + CFX_ArrayTemplate<int32_t>* GetCoefficients(); int32_t GetDegree(); bool IsZero(); int32_t EvaluateAt(int32_t a); @@ -41,7 +41,7 @@ private: CBC_ReedSolomonGF256* m_field; - CFX_Int32Array m_coefficients; + CFX_ArrayTemplate<int32_t> m_coefficients; }; #endif // XFA_FXBARCODE_COMMON_REEDSOLOMON_BC_REEDSOLOMONGF256POLY_H_
diff --git a/xfa/fxbarcode/datamatrix/BC_DefaultPlacement.cpp b/xfa/fxbarcode/datamatrix/BC_DefaultPlacement.cpp index bc0aa72..e7eef07 100644 --- a/xfa/fxbarcode/datamatrix/BC_DefaultPlacement.cpp +++ b/xfa/fxbarcode/datamatrix/BC_DefaultPlacement.cpp
@@ -43,7 +43,7 @@ int32_t CBC_DefaultPlacement::getNumcols() { return m_numcols; } -CFX_ByteArray& CBC_DefaultPlacement::getBits() { +CFX_ArrayTemplate<uint8_t>& CBC_DefaultPlacement::getBits() { return m_bits; } bool CBC_DefaultPlacement::getBit(int32_t col, int32_t row) {
diff --git a/xfa/fxbarcode/datamatrix/BC_DefaultPlacement.h b/xfa/fxbarcode/datamatrix/BC_DefaultPlacement.h index 64d0288..36a7ab2 100644 --- a/xfa/fxbarcode/datamatrix/BC_DefaultPlacement.h +++ b/xfa/fxbarcode/datamatrix/BC_DefaultPlacement.h
@@ -18,7 +18,7 @@ int32_t getNumrows(); int32_t getNumcols(); - CFX_ByteArray& getBits(); + CFX_ArrayTemplate<uint8_t>& getBits(); bool getBit(int32_t col, int32_t row); void setBit(int32_t col, int32_t row, bool bit); bool hasBit(int32_t col, int32_t row); @@ -28,7 +28,7 @@ CFX_WideString m_codewords; int32_t m_numrows; int32_t m_numcols; - CFX_ByteArray m_bits; + CFX_ArrayTemplate<uint8_t> m_bits; void module(int32_t row, int32_t col, int32_t pos, int32_t bit); void utah(int32_t row, int32_t col, int32_t pos); void corner1(int32_t pos);
diff --git a/xfa/fxbarcode/datamatrix/BC_ErrorCorrection.cpp b/xfa/fxbarcode/datamatrix/BC_ErrorCorrection.cpp index f52f0ff..7782830 100644 --- a/xfa/fxbarcode/datamatrix/BC_ErrorCorrection.cpp +++ b/xfa/fxbarcode/datamatrix/BC_ErrorCorrection.cpp
@@ -132,11 +132,11 @@ BC_EXCEPTION_CHECK_ReturnValue(e, CFX_WideString()); sb += ecc; } else { - CFX_Int32Array dataSizes; + CFX_ArrayTemplate<int32_t> dataSizes; dataSizes.SetSize(blockCount); - CFX_Int32Array errorSizes; + CFX_ArrayTemplate<int32_t> errorSizes; errorSizes.SetSize(blockCount); - CFX_Int32Array startPos; + CFX_ArrayTemplate<int32_t> startPos; startPos.SetSize(blockCount); for (int32_t i = 0; i < blockCount; i++) { dataSizes[i] = symbolInfo->getDataLengthForInterleavedBlock(i + 1);
diff --git a/xfa/fxbarcode/datamatrix/BC_HighLevelEncoder.cpp b/xfa/fxbarcode/datamatrix/BC_HighLevelEncoder.cpp index fcd668a..4b4b246 100644 --- a/xfa/fxbarcode/datamatrix/BC_HighLevelEncoder.cpp +++ b/xfa/fxbarcode/datamatrix/BC_HighLevelEncoder.cpp
@@ -58,7 +58,8 @@ 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 @@ 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 @@ 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 @@ 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 @@ } 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];
diff --git a/xfa/fxbarcode/datamatrix/BC_HighLevelEncoder.h b/xfa/fxbarcode/datamatrix/BC_HighLevelEncoder.h index 3b88f88..5d72f10 100644 --- a/xfa/fxbarcode/datamatrix/BC_HighLevelEncoder.h +++ b/xfa/fxbarcode/datamatrix/BC_HighLevelEncoder.h
@@ -23,7 +23,7 @@ CBC_HighLevelEncoder(); ~CBC_HighLevelEncoder() override; - CFX_ByteArray& getBytesForMessage(CFX_WideString msg); + CFX_ArrayTemplate<uint8_t>& getBytesForMessage(CFX_WideString msg); static CFX_WideString encodeHighLevel(CFX_WideString msg, CFX_WideString ecLevel, int32_t& e); @@ -59,15 +59,15 @@ static const wchar_t* MACRO_05_HEADER; static const wchar_t* MACRO_06_HEADER; static const wchar_t MACRO_TRAILER; - CFX_ByteArray m_bytearray; + CFX_ArrayTemplate<uint8_t> m_bytearray; private: static FX_WCHAR randomize253State(FX_WCHAR ch, int32_t codewordPosition); static int32_t findMinimums(std::vector<FX_FLOAT>& charCounts, - CFX_Int32Array& intCharCounts, + CFX_ArrayTemplate<int32_t>& intCharCounts, int32_t min, - CFX_ByteArray& mins); - static int32_t getMinimumCount(CFX_ByteArray& mins); + CFX_ArrayTemplate<uint8_t>& mins); + static int32_t getMinimumCount(CFX_ArrayTemplate<uint8_t>& mins); static bool isNativeC40(FX_WCHAR ch); static bool isNativeText(FX_WCHAR ch); static bool isNativeX12(FX_WCHAR ch);
diff --git a/xfa/fxbarcode/pdf417/BC_PDF417.cpp b/xfa/fxbarcode/pdf417/BC_PDF417.cpp index 9b8d0c1..16ed6fd 100644 --- a/xfa/fxbarcode/pdf417/BC_PDF417.cpp +++ b/xfa/fxbarcode/pdf417/BC_PDF417.cpp
@@ -410,7 +410,7 @@ CBC_PDF417HighLevelEncoder::encodeHighLevel(msg, m_compaction, e); BC_EXCEPTION_CHECK_ReturnVoid(e); int32_t sourceCodeWords = highLevel.GetLength(); - CFX_Int32Array* dimension = + CFX_ArrayTemplate<int32_t>* dimension = determineDimensions(sourceCodeWords, errorCorrectionCodeWords, e); BC_EXCEPTION_CHECK_ReturnVoid(e); int32_t cols = dimension->GetAt(0); @@ -532,12 +532,12 @@ } } -CFX_Int32Array* CBC_PDF417::determineDimensions( +CFX_ArrayTemplate<int32_t>* CBC_PDF417::determineDimensions( int32_t sourceCodeWords, int32_t errorCorrectionCodeWords, int32_t& e) { FX_FLOAT ratio = 0.0f; - CFX_Int32Array* dimension = nullptr; + CFX_ArrayTemplate<int32_t>* dimension = nullptr; for (int32_t cols = m_minCols; cols <= m_maxCols; cols++) { int32_t rows = calculateNumberOfRows(sourceCodeWords, errorCorrectionCodeWords, cols); @@ -555,7 +555,7 @@ } ratio = newRatio; delete dimension; - dimension = new CFX_Int32Array; + dimension = new CFX_ArrayTemplate<int32_t>; dimension->Add(cols); dimension->Add(rows); } @@ -563,11 +563,11 @@ int32_t rows = calculateNumberOfRows(sourceCodeWords, errorCorrectionCodeWords, m_minCols); if (rows < m_minRows) { - dimension = new CFX_Int32Array; + dimension = new CFX_ArrayTemplate<int32_t>; dimension->Add(m_minCols); dimension->Add(m_minRows); } else if (rows >= 3 && rows <= 90) { - dimension = new CFX_Int32Array; + dimension = new CFX_ArrayTemplate<int32_t>; dimension->Add(m_minCols); dimension->Add(rows); }
diff --git a/xfa/fxbarcode/pdf417/BC_PDF417.h b/xfa/fxbarcode/pdf417/BC_PDF417.h index 5f7c2d4..3ba5aa2 100644 --- a/xfa/fxbarcode/pdf417/BC_PDF417.h +++ b/xfa/fxbarcode/pdf417/BC_PDF417.h
@@ -51,9 +51,10 @@ int32_t r, int32_t errorCorrectionLevel, CBC_BarcodeMatrix* logic); - CFX_Int32Array* determineDimensions(int32_t sourceCodeWords, - int32_t errorCorrectionCodeWords, - int32_t& e); + CFX_ArrayTemplate<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 f348d2c..c1f4da1 100644 --- a/xfa/fxbarcode/pdf417/BC_PDF417BarcodeMatrix.cpp +++ b/xfa/fxbarcode/pdf417/BC_PDF417BarcodeMatrix.cpp
@@ -59,16 +59,16 @@ int32_t CBC_BarcodeMatrix::getHeight() { return m_outHeight; } -CFX_ByteArray& CBC_BarcodeMatrix::getMatrix() { +CFX_ArrayTemplate<uint8_t>& CBC_BarcodeMatrix::getMatrix() { return getScaledMatrix(1, 1); } -CFX_ByteArray& CBC_BarcodeMatrix::getScaledMatrix(int32_t scale) { +CFX_ArrayTemplate<uint8_t>& CBC_BarcodeMatrix::getScaledMatrix(int32_t scale) { return getScaledMatrix(scale, scale); } -CFX_ByteArray& CBC_BarcodeMatrix::getScaledMatrix(int32_t xScale, - int32_t yScale) { +CFX_ArrayTemplate<uint8_t>& CBC_BarcodeMatrix::getScaledMatrix(int32_t xScale, + int32_t yScale) { int32_t yMax = m_height * yScale; - CFX_ByteArray bytearray; + CFX_ArrayTemplate<uint8_t> bytearray; bytearray.Copy(m_matrix[0]->getScaledRow(xScale)); int32_t xMax = bytearray.GetSize(); m_matrixOut.SetSize(xMax * yMax);
diff --git a/xfa/fxbarcode/pdf417/BC_PDF417BarcodeMatrix.h b/xfa/fxbarcode/pdf417/BC_PDF417BarcodeMatrix.h index 0f69222..95ab547 100644 --- a/xfa/fxbarcode/pdf417/BC_PDF417BarcodeMatrix.h +++ b/xfa/fxbarcode/pdf417/BC_PDF417BarcodeMatrix.h
@@ -21,15 +21,15 @@ void setMatrix(int32_t x, int32_t y, bool black); void startRow(); CBC_BarcodeRow* getCurrentRow(); - CFX_ByteArray& getMatrix(); - CFX_ByteArray& getScaledMatrix(int32_t scale); - CFX_ByteArray& getScaledMatrix(int32_t xScale, int32_t yScale); + CFX_ArrayTemplate<uint8_t>& getMatrix(); + CFX_ArrayTemplate<uint8_t>& getScaledMatrix(int32_t scale); + CFX_ArrayTemplate<uint8_t>& getScaledMatrix(int32_t xScale, int32_t yScale); int32_t getWidth(); int32_t getHeight(); private: CFX_ArrayTemplate<CBC_BarcodeRow*> m_matrix; - CFX_ByteArray m_matrixOut; + CFX_ArrayTemplate<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 b721ffc..243af70 100644 --- a/xfa/fxbarcode/pdf417/BC_PDF417BarcodeRow.cpp +++ b/xfa/fxbarcode/pdf417/BC_PDF417BarcodeRow.cpp
@@ -41,10 +41,10 @@ set(m_currentLocation++, black); } } -CFX_ByteArray& CBC_BarcodeRow::getRow() { +CFX_ArrayTemplate<uint8_t>& CBC_BarcodeRow::getRow() { return m_row; } -CFX_ByteArray& CBC_BarcodeRow::getScaledRow(int32_t scale) { +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]);
diff --git a/xfa/fxbarcode/pdf417/BC_PDF417BarcodeRow.h b/xfa/fxbarcode/pdf417/BC_PDF417BarcodeRow.h index 90e76ac..7d9d19c 100644 --- a/xfa/fxbarcode/pdf417/BC_PDF417BarcodeRow.h +++ b/xfa/fxbarcode/pdf417/BC_PDF417BarcodeRow.h
@@ -17,12 +17,12 @@ void set(int32_t x, uint8_t value); void set(int32_t x, bool black); void addBar(bool black, int32_t width); - CFX_ByteArray& getRow(); - CFX_ByteArray& getScaledRow(int32_t scale); + CFX_ArrayTemplate<uint8_t>& getRow(); + CFX_ArrayTemplate<uint8_t>& getScaledRow(int32_t scale); private: - CFX_ByteArray m_row; - CFX_ByteArray m_output; + CFX_ArrayTemplate<uint8_t> m_row; + CFX_ArrayTemplate<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 fa0e9bc..183566f 100644 --- a/xfa/fxbarcode/pdf417/BC_PDF417HighLevelEncoder.cpp +++ b/xfa/fxbarcode/pdf417/BC_PDF417HighLevelEncoder.cpp
@@ -71,7 +71,7 @@ } msg += ch; } - CFX_ByteArray byteArr; + CFX_ArrayTemplate<uint8_t> byteArr; for (int32_t k = 0; k < bytes.GetLength(); k++) { byteArr.Add(bytes.GetAt(k)); } @@ -260,7 +260,7 @@ } return submode; } -void CBC_PDF417HighLevelEncoder::encodeBinary(CFX_ByteArray* bytes, +void CBC_PDF417HighLevelEncoder::encodeBinary(CFX_ArrayTemplate<uint8_t>* bytes, int32_t startpos, int32_t count, int32_t startmode, @@ -387,7 +387,7 @@ } int32_t CBC_PDF417HighLevelEncoder::determineConsecutiveBinaryCount( CFX_WideString msg, - CFX_ByteArray* bytes, + CFX_ArrayTemplate<uint8_t>* bytes, int32_t startpos, int32_t& e) { int32_t len = msg.GetLength();
diff --git a/xfa/fxbarcode/pdf417/BC_PDF417HighLevelEncoder.h b/xfa/fxbarcode/pdf417/BC_PDF417HighLevelEncoder.h index 39abe0f..38382c8 100644 --- a/xfa/fxbarcode/pdf417/BC_PDF417HighLevelEncoder.h +++ b/xfa/fxbarcode/pdf417/BC_PDF417HighLevelEncoder.h
@@ -39,7 +39,7 @@ int32_t count, CFX_WideString& sb, int32_t initialSubmode); - static void encodeBinary(CFX_ByteArray* bytes, + static void encodeBinary(CFX_ArrayTemplate<uint8_t>* bytes, int32_t startpos, int32_t count, int32_t startmode, @@ -58,10 +58,11 @@ int32_t startpos); static int32_t determineConsecutiveTextCount(CFX_WideString msg, int32_t startpos); - static int32_t determineConsecutiveBinaryCount(CFX_WideString msg, - CFX_ByteArray* bytes, - int32_t startpos, - int32_t& e); + static int32_t determineConsecutiveBinaryCount( + CFX_WideString msg, + CFX_ArrayTemplate<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 a1b753e..2cd60fe 100644 --- a/xfa/fxbarcode/pdf417/BC_PDF417HighLevelEncoder_unittest.cpp +++ b/xfa/fxbarcode/pdf417/BC_PDF417HighLevelEncoder_unittest.cpp
@@ -43,7 +43,7 @@ CBC_PDF417HighLevelEncoder::Initialize(); for (size_t i = 0; i < FX_ArraySize(encode_binary_cases); ++i) { EncodeBinaryCase* ptr = &encode_binary_cases[i]; - CFX_ByteArray input_array; + CFX_ArrayTemplate<uint8_t> input_array; size_t input_length = strlen(ptr->input); input_array.SetSize(input_length); for (size_t j = 0; j < input_length; ++j) {
diff --git a/xfa/fxbarcode/pdf417/BC_PDF417Writer.cpp b/xfa/fxbarcode/pdf417/BC_PDF417Writer.cpp index 4c9b5cb..72d1a05 100644 --- a/xfa/fxbarcode/pdf417/BC_PDF417Writer.cpp +++ b/xfa/fxbarcode/pdf417/BC_PDF417Writer.cpp
@@ -63,7 +63,7 @@ int32_t lineThickness = 2; int32_t aspectRatio = 4; CBC_BarcodeMatrix* barcodeMatrix = encoder.getBarcodeMatrix(); - CFX_ByteArray originalScale; + CFX_ArrayTemplate<uint8_t> originalScale; originalScale.Copy(barcodeMatrix->getScaledMatrix( lineThickness, aspectRatio * lineThickness)); int32_t width = outWidth; @@ -101,10 +101,10 @@ FXSYS_memcpy(result, originalScale.GetData(), outHeight * outWidth); return result; } -void CBC_PDF417Writer::rotateArray(CFX_ByteArray& bitarray, +void CBC_PDF417Writer::rotateArray(CFX_ArrayTemplate<uint8_t>& bitarray, int32_t height, int32_t width) { - CFX_ByteArray temp; + CFX_ArrayTemplate<uint8_t> temp; temp.Copy(bitarray); for (int32_t ii = 0; ii < height; ii++) { int32_t inverseii = height - ii - 1;
diff --git a/xfa/fxbarcode/pdf417/BC_PDF417Writer.h b/xfa/fxbarcode/pdf417/BC_PDF417Writer.h index 178d251..420c441 100644 --- a/xfa/fxbarcode/pdf417/BC_PDF417Writer.h +++ b/xfa/fxbarcode/pdf417/BC_PDF417Writer.h
@@ -27,7 +27,9 @@ void SetTruncated(bool truncated); private: - void rotateArray(CFX_ByteArray& bitarray, int32_t width, int32_t height); + void rotateArray(CFX_ArrayTemplate<uint8_t>& bitarray, + int32_t width, + int32_t height); bool m_bTruncated; };
diff --git a/xfa/fxbarcode/qrcode/BC_QRCoderEncoder.cpp b/xfa/fxbarcode/qrcode/BC_QRCoderEncoder.cpp index 332f1de..ab17d24 100644 --- a/xfa/fxbarcode/qrcode/BC_QRCoderEncoder.cpp +++ b/xfa/fxbarcode/qrcode/BC_QRCoderEncoder.cpp
@@ -95,7 +95,7 @@ e); BC_EXCEPTION_CHECK_ReturnVoid(e); } else if (tempMode == CBC_QRCoderMode::sBYTE) { - CFX_ByteArray bytes; + CFX_ArrayTemplate<uint8_t> bytes; CBC_UtilCodingConvert::LocaleToUtf8(splitResult.second, bytes); AppendModeInfo(tempMode, &headerAndDataBits, e); BC_EXCEPTION_CHECK_ReturnVoid(e); @@ -722,7 +722,7 @@ } } -void CBC_QRCoderEncoder::Append8BitBytes(CFX_ByteArray& bytes, +void CBC_QRCoderEncoder::Append8BitBytes(CFX_ArrayTemplate<uint8_t>& bytes, CBC_QRCoderBitVector* bits, int32_t& e) { for (int32_t i = 0; i < bytes.GetSize(); i++) { @@ -734,7 +734,7 @@ void CBC_QRCoderEncoder::AppendKanjiBytes(const CFX_ByteString& content, CBC_QRCoderBitVector* bits, int32_t& e) { - CFX_ByteArray bytes; + CFX_ArrayTemplate<uint8_t> bytes; uint32_t value = 0; for (int32_t i = 0; i < bytes.GetSize(); i += 2) { value = (uint32_t)((uint8_t)(content[i] << 8) | (uint8_t)content[i + 1]); @@ -907,7 +907,7 @@ int32_t numEcBytesInBlock, int32_t& e) { int32_t numDataBytes = dataBytes->Size(); - CFX_Int32Array toEncode; + CFX_ArrayTemplate<int32_t> toEncode; toEncode.SetSize(numDataBytes + numEcBytesInBlock); for (int32_t i = 0; i < numDataBytes; i++) { toEncode[i] = (dataBytes->At(i));
diff --git a/xfa/fxbarcode/qrcode/BC_QRCoderEncoder.h b/xfa/fxbarcode/qrcode/BC_QRCoderEncoder.h index 649938a..a1b078f 100644 --- a/xfa/fxbarcode/qrcode/BC_QRCoderEncoder.h +++ b/xfa/fxbarcode/qrcode/BC_QRCoderEncoder.h
@@ -62,7 +62,7 @@ CBC_QRCoderBitVector* bits, CFX_ByteString encoding, int32_t& e); - static void Append8BitBytes(CFX_ByteArray& bytes, + static void Append8BitBytes(CFX_ArrayTemplate<uint8_t>& bytes, CBC_QRCoderBitVector* bits, int32_t& e); static void AppendKanjiBytes(const CFX_ByteString& content,
diff --git a/xfa/fxbarcode/qrcode/BC_QRCoderVersion.cpp b/xfa/fxbarcode/qrcode/BC_QRCoderVersion.cpp index b0b445b..b4effb9 100644 --- a/xfa/fxbarcode/qrcode/BC_QRCoderVersion.cpp +++ b/xfa/fxbarcode/qrcode/BC_QRCoderVersion.cpp
@@ -354,7 +354,7 @@ int32_t CBC_QRCoderVersion::GetVersionNumber() { return m_versionNumber; } -CFX_Int32Array* CBC_QRCoderVersion::GetAlignmentPatternCenters() { +CFX_ArrayTemplate<int32_t>* CBC_QRCoderVersion::GetAlignmentPatternCenters() { return &m_alignmentPatternCenters; } int32_t CBC_QRCoderVersion::GetTotalCodeWords() {
diff --git a/xfa/fxbarcode/qrcode/BC_QRCoderVersion.h b/xfa/fxbarcode/qrcode/BC_QRCoderVersion.h index 43b4b60..030dd51 100644 --- a/xfa/fxbarcode/qrcode/BC_QRCoderVersion.h +++ b/xfa/fxbarcode/qrcode/BC_QRCoderVersion.h
@@ -23,7 +23,7 @@ int32_t GetTotalCodeWords(); int32_t GetDimensionForVersion(); CBC_CommonBitMatrix* BuildFunctionPattern(int32_t& e); - CFX_Int32Array* GetAlignmentPatternCenters(); + CFX_ArrayTemplate<int32_t>* GetAlignmentPatternCenters(); CBC_QRCoderECBlocks* GetECBlocksForLevel( CBC_QRCoderErrorCorrectionLevel* ecLevel); static CBC_QRCoderVersion* GetVersionForNumber(int32_t versionNumber, @@ -48,7 +48,7 @@ int32_t m_versionNumber; int32_t m_totalCodeWords; - CFX_Int32Array m_alignmentPatternCenters; + CFX_ArrayTemplate<int32_t> m_alignmentPatternCenters; CFX_ArrayTemplate<CBC_QRCoderECBlocks*> m_ecBlocksArray; };
diff --git a/xfa/fxbarcode/utils.h b/xfa/fxbarcode/utils.h index 7473d41..cb6eed7 100644 --- a/xfa/fxbarcode/utils.h +++ b/xfa/fxbarcode/utils.h
@@ -15,7 +15,8 @@ int32_t count, FX_CHAR c); void BC_FX_ByteString_Append(CFX_ByteString& dst, int32_t count, FX_CHAR c); -void BC_FX_ByteString_Append(CFX_ByteString& dst, const CFX_ByteArray& ba); +void BC_FX_ByteString_Append(CFX_ByteString& dst, + const CFX_ArrayTemplate<uint8_t>& ba); #if (_FX_OS_ == _FX_WIN32_DESKTOP_ || _FX_OS_ == _FX_WIN64_) #include <limits>
diff --git a/xfa/fxfa/app/cxfa_textlayout.h b/xfa/fxfa/app/cxfa_textlayout.h index 4de53d1..cb0ad13 100644 --- a/xfa/fxfa/app/cxfa_textlayout.h +++ b/xfa/fxfa/app/cxfa_textlayout.h
@@ -60,7 +60,7 @@ } bool m_bHasBlock; - CFX_Int32Array m_Blocks; + CFX_ArrayTemplate<int32_t> m_Blocks; private: void GetTextDataNode();
diff --git a/xfa/fxfa/app/xfa_ffchoicelist.cpp b/xfa/fxfa/app/xfa_ffchoicelist.cpp index 2764d72..e0e0469 100644 --- a/xfa/fxfa/app/xfa_ffchoicelist.cpp +++ b/xfa/fxfa/app/xfa_ffchoicelist.cpp
@@ -65,7 +65,7 @@ } dwExtendedStyle |= GetAlignment(); m_pNormalWidget->ModifyStylesEx(dwExtendedStyle, 0xFFFFFFFF); - CFX_Int32Array iSelArray; + CFX_ArrayTemplate<int32_t> iSelArray; m_pDataAcc->GetSelectedItems(iSelArray); int32_t iSelCount = iSelArray.GetSize(); for (int32_t j = 0; j < iSelCount; j++) { @@ -86,7 +86,7 @@ bool CXFA_FFListBox::CommitData() { CFWL_ListBox* pListBox = static_cast<CFWL_ListBox*>(m_pNormalWidget); int32_t iSels = pListBox->CountSelItems(); - CFX_Int32Array iSelArray; + CFX_ArrayTemplate<int32_t> iSelArray; for (int32_t i = 0; i < iSels; ++i) iSelArray.Add(pListBox->GetSelIndex(i)); m_pDataAcc->SetSelectedItems(iSelArray, true, false, true); @@ -94,7 +94,7 @@ } bool CXFA_FFListBox::IsDataChanged() { - CFX_Int32Array iSelArray; + CFX_ArrayTemplate<int32_t> iSelArray; m_pDataAcc->GetSelectedItems(iSelArray); int32_t iOldSels = iSelArray.GetSize(); CFWL_ListBox* pListBox = (CFWL_ListBox*)m_pNormalWidget; @@ -140,7 +140,7 @@ } CFWL_ListBox* pListBox = ((CFWL_ListBox*)m_pNormalWidget); CFX_ArrayTemplate<CFWL_ListItem*> selItemArray; - CFX_Int32Array iSelArray; + CFX_ArrayTemplate<int32_t> iSelArray; m_pDataAcc->GetSelectedItems(iSelArray); int32_t iSelCount = iSelArray.GetSize(); for (int32_t j = 0; j < iSelCount; j++) { @@ -154,8 +154,9 @@ m_pNormalWidget->Update(); return true; } -void CXFA_FFListBox::OnSelectChanged(CFWL_Widget* pWidget, - const CFX_Int32Array& arrSels) { +void CXFA_FFListBox::OnSelectChanged( + CFWL_Widget* pWidget, + const CFX_ArrayTemplate<int32_t>& arrSels) { CXFA_EventParam eParam; eParam.m_eType = XFA_EVENT_Change; eParam.m_pTarget = m_pDataAcc; @@ -201,7 +202,7 @@ CXFA_FFField::OnProcessEvent(pEvent); switch (pEvent->GetType()) { case CFWL_Event::Type::SelectChanged: { - CFX_Int32Array arrSels; + CFX_ArrayTemplate<int32_t> arrSels; OnSelectChanged(m_pNormalWidget, arrSels); break; } @@ -256,7 +257,7 @@ for (int32_t i = 0; i < iItems; i++) { pComboBox->AddString(wsLabelArray[i].AsStringC()); } - CFX_Int32Array iSelArray; + CFX_ArrayTemplate<int32_t> iSelArray; m_pDataAcc->GetSelectedItems(iSelArray); int32_t iSelCount = iSelArray.GetSize(); if (iSelCount > 0) { @@ -383,7 +384,7 @@ if (!m_pNormalWidget) { return false; } - CFX_Int32Array iSelArray; + CFX_ArrayTemplate<int32_t> iSelArray; m_pDataAcc->GetSelectedItems(iSelArray); int32_t iSelCount = iSelArray.GetSize(); if (iSelCount > 0) {
diff --git a/xfa/fxfa/app/xfa_ffchoicelist.h b/xfa/fxfa/app/xfa_ffchoicelist.h index e9bee6f..75057b0 100644 --- a/xfa/fxfa/app/xfa_ffchoicelist.h +++ b/xfa/fxfa/app/xfa_ffchoicelist.h
@@ -23,7 +23,8 @@ void OnDrawWidget(CFX_Graphics* pGraphics, const CFX_Matrix* pMatrix = nullptr) override; - void OnSelectChanged(CFWL_Widget* pWidget, const CFX_Int32Array& arrSels); + void OnSelectChanged(CFWL_Widget* pWidget, + const CFX_ArrayTemplate<int32_t>& arrSels); void SetItemState(int32_t nIndex, bool bSelected); void InsertItem(const CFX_WideStringC& wsLabel, int32_t nIndex = -1); void DeleteItem(int32_t nIndex);
diff --git a/xfa/fxfa/parser/cxfa_resolveprocessor.cpp b/xfa/fxfa/parser/cxfa_resolveprocessor.cpp index 271e14b..9bd3472 100644 --- a/xfa/fxfa/parser/cxfa_resolveprocessor.cpp +++ b/xfa/fxfa/parser/cxfa_resolveprocessor.cpp
@@ -497,7 +497,8 @@ nodes.Append((CXFA_ObjArray&)array); return nodes.GetSize(); } -int32_t CXFA_ResolveProcessor::ResolvePopStack(CFX_Int32Array& stack) { +int32_t CXFA_ResolveProcessor::ResolvePopStack( + CFX_ArrayTemplate<int32_t>& stack) { int32_t nType = -1; int32_t iSize = stack.GetSize() - 1; if (iSize > -1) { @@ -520,7 +521,7 @@ FX_WCHAR* pConditionBuf = wsCondition.GetBuffer(iLength - nStart); int32_t nNameCount = 0; int32_t nConditionCount = 0; - CFX_Int32Array stack; + CFX_ArrayTemplate<int32_t> stack; int32_t nType = -1; const FX_WCHAR* pSrc = wsExpression.c_str(); FX_WCHAR wPrev = 0, wCur;
diff --git a/xfa/fxfa/parser/cxfa_resolveprocessor.h b/xfa/fxfa/parser/cxfa_resolveprocessor.h index 2590021..d806d57 100644 --- a/xfa/fxfa/parser/cxfa_resolveprocessor.h +++ b/xfa/fxfa/parser/cxfa_resolveprocessor.h
@@ -60,7 +60,7 @@ int32_t ResolveNumberSign(CXFA_ResolveNodesData& rnd); int32_t ResolveAsterisk(CXFA_ResolveNodesData& rnd); int32_t ResolveNormal(CXFA_ResolveNodesData& rnd); - int32_t ResolvePopStack(CFX_Int32Array& stack); + int32_t ResolvePopStack(CFX_ArrayTemplate<int32_t>& stack); void SetStylesForChild(uint32_t dwParentStyles, CXFA_ResolveNodesData& rnd); void ConditionArray(int32_t iCurIndex,
diff --git a/xfa/fxfa/parser/cxfa_widgetdata.cpp b/xfa/fxfa/parser/cxfa_widgetdata.cpp index 80c50b7..31c5cf4 100644 --- a/xfa/fxfa/parser/cxfa_widgetdata.cpp +++ b/xfa/fxfa/parser/cxfa_widgetdata.cpp
@@ -874,7 +874,7 @@ return -1; } -void CXFA_WidgetData::GetSelectedItems(CFX_Int32Array& iSelArray) { +void CXFA_WidgetData::GetSelectedItems(CFX_ArrayTemplate<int32_t>& iSelArray) { std::vector<CFX_WideString> wsValueArray; GetSelectedItemsValue(wsValueArray); int32_t iValues = pdfium::CollectionSize<int32_t>(wsValueArray); @@ -973,7 +973,7 @@ bSyncData); } } else if (iSel >= 0) { - CFX_Int32Array iSelArray; + CFX_ArrayTemplate<int32_t> iSelArray; GetSelectedItems(iSelArray); for (int32_t i = 0; i < iSelArray.GetSize(); i++) { if (iSelArray[i] == nIndex) { @@ -999,7 +999,7 @@ } } -void CXFA_WidgetData::SetSelectedItems(CFX_Int32Array& iSelArray, +void CXFA_WidgetData::SetSelectedItems(CFX_ArrayTemplate<int32_t>& iSelArray, bool bNotify, bool bScriptModify, bool bSyncData) {
diff --git a/xfa/fxfa/parser/cxfa_widgetdata.h b/xfa/fxfa/parser/cxfa_widgetdata.h index 7986fa9..4f5db3b 100644 --- a/xfa/fxfa/parser/cxfa_widgetdata.h +++ b/xfa/fxfa/parser/cxfa_widgetdata.h
@@ -102,7 +102,7 @@ bool bSaveValue = false); int32_t CountSelectedItems(); int32_t GetSelectedItem(int32_t nIndex = 0); - void GetSelectedItems(CFX_Int32Array& iSelArray); + void GetSelectedItems(CFX_ArrayTemplate<int32_t>& iSelArray); void GetSelectedItemsValue(std::vector<CFX_WideString>& wsSelTextArray); bool GetItemState(int32_t nIndex); void SetItemState(int32_t nIndex, @@ -110,7 +110,7 @@ bool bNotify, bool bScriptModify, bool bSyncData); - void SetSelectedItems(CFX_Int32Array& iSelArray, + void SetSelectedItems(CFX_ArrayTemplate<int32_t>& iSelArray, bool bNotify, bool bScriptModify, bool bSyncData);