diff options
author | tsepez <tsepez@chromium.org> | 2017-01-20 12:59:50 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2017-01-20 12:59:50 -0800 |
commit | 82aa396188ec26f22fe730f4e35b5a54ebffb5dc (patch) | |
tree | 3950a96204c68fed27d1812cdd9d30de1a6226c0 | |
parent | 6db6fbcdee9f1887ac02c647210bd5013358f12d (diff) | |
download | pdfium-82aa396188ec26f22fe730f4e35b5a54ebffb5dc.tar.xz |
Replace CFX_ByteArray with CFX_ArrayTemplate<uint8_t>chromium/2990chromium/2989chromium/2988
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
46 files changed, 151 insertions, 140 deletions
diff --git a/core/fxcrt/fx_arabic.cpp b/core/fxcrt/fx_arabic.cpp index d6b3c6522d..a649e49759 100644 --- a/core/fxcrt/fx_arabic.cpp +++ b/core/fxcrt/fx_arabic.cpp @@ -374,7 +374,7 @@ int32_t FX_BidiGetResolvedNeutrals(int32_t iAction) { 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 @@ int32_t FX_BidiReorderLevel(int32_t iBaseLevel, } 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 1f4d38b888..e7ba079f43 100644 --- a/core/fxcrt/fx_arabic.h +++ b/core/fxcrt/fx_arabic.h @@ -30,17 +30,17 @@ FX_WCHAR GetFormChar(const CFX_Char* cur, 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 @@ enum FX_BIDIWEAKACTION { #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 @@ enum FX_BIDINEUTRALACTION { 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 5adcf701c5..31850f5403 100644 --- a/core/fxcrt/fx_basic.h +++ b/core/fxcrt/fx_basic.h @@ -313,11 +313,6 @@ class CFX_ArrayTemplate : public CFX_BasicArray { } }; -#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 94b72f806d..084af42acf 100644 --- a/xfa/fde/tto/fde_textout.h +++ b/xfa/fde/tto/fde_textout.h @@ -179,7 +179,7 @@ class CFDE_TextOut { 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 8e06d9bb48..129399d88d 100644 --- a/xfa/fde/xml/cfx_saxreader.h +++ b/xfa/fde/xml/cfx_saxreader.h @@ -128,7 +128,7 @@ class CFX_SAXReader { 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 6edd860354..91862dceeb 100644 --- a/xfa/fgas/layout/fgas_rtfbreak.h +++ b/xfa/fgas/layout/fgas_rtfbreak.h @@ -298,7 +298,7 @@ class CFX_RTFBreak { 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 73475751f6..c06cffc218 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, } 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::LocaleToUtf8(const CFX_ByteString& src, } } -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 698cd857d7..859eeea1e9 100644 --- a/xfa/fxbarcode/BC_UtilCodingConvert.h +++ b/xfa/fxbarcode/BC_UtilCodingConvert.h @@ -17,8 +17,10 @@ class CBC_UtilCodingConvert { 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 807b04861d..5d881c7be1 100644 --- a/xfa/fxbarcode/BC_Utils.cpp +++ b/xfa/fxbarcode/BC_Utils.cpp @@ -26,7 +26,8 @@ void BC_FX_ByteString_Append(CFX_ByteString& dst, int32_t count, FX_CHAR c) { 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 722bbc501d..0371837fde 100644 --- a/xfa/fxbarcode/common/BC_CommonBitArray.cpp +++ b/xfa/fxbarcode/common/BC_CommonBitArray.cpp @@ -41,7 +41,7 @@ CBC_CommonBitArray::~CBC_CommonBitArray() { 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 80a56d1b53..6ad8ab321d 100644 --- a/xfa/fxbarcode/common/BC_CommonBitArray.h +++ b/xfa/fxbarcode/common/BC_CommonBitArray.h @@ -17,7 +17,7 @@ class CBC_CommonBitArray { 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 @@ class CBC_CommonBitArray { 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 71fa85f0c4..050ecb0bf8 100644 --- a/xfa/fxbarcode/common/BC_CommonByteArray.cpp +++ b/xfa/fxbarcode/common/BC_CommonByteArray.cpp @@ -85,7 +85,7 @@ void CBC_CommonByteArray::Set(uint8_t* source, int32_t offset, int32_t count) { 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 dd6ee581ef..009f625a86 100644 --- a/xfa/fxbarcode/common/BC_CommonByteArray.h +++ b/xfa/fxbarcode/common/BC_CommonByteArray.h @@ -25,7 +25,7 @@ class CBC_CommonByteArray { 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 352dc3dab1..eac1a1065a 100644 --- a/xfa/fxbarcode/common/reedsolomon/BC_ReedSolomon.cpp +++ b/xfa/fxbarcode/common/reedsolomon/BC_ReedSolomon.cpp @@ -39,7 +39,7 @@ CBC_ReedSolomonGF256Poly* CBC_ReedSolomonEncoder::BuildGenerator(int32_t degree, 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 @@ CBC_ReedSolomonGF256Poly* CBC_ReedSolomonEncoder::BuildGenerator(int32_t degree, } 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 @@ void CBC_ReedSolomonEncoder::Encode(CFX_Int32Array* toEncode, } 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 @@ void CBC_ReedSolomonEncoder::Encode(CFX_Int32Array* toEncode, 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 b71cfb4c06..95828f1a0e 100644 --- a/xfa/fxbarcode/common/reedsolomon/BC_ReedSolomon.h +++ b/xfa/fxbarcode/common/reedsolomon/BC_ReedSolomon.h @@ -17,7 +17,9 @@ class CBC_ReedSolomonEncoder { 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 33b828cc1e..030048a632 100644 --- a/xfa/fxbarcode/common/reedsolomon/BC_ReedSolomonGF256.cpp +++ b/xfa/fxbarcode/common/reedsolomon/BC_ReedSolomonGF256.cpp @@ -85,7 +85,7 @@ CBC_ReedSolomonGF256Poly* CBC_ReedSolomonGF256::BuildMonomial( 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 60f1f1bbed..748646bcad 100644 --- a/xfa/fxbarcode/common/reedsolomon/BC_ReedSolomonGF256Poly.cpp +++ b/xfa/fxbarcode/common/reedsolomon/BC_ReedSolomonGF256Poly.cpp @@ -38,7 +38,7 @@ CBC_ReedSolomonGF256Poly::CBC_ReedSolomonGF256Poly() { 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 @@ void CBC_ReedSolomonGF256Poly::Init(CBC_ReedSolomonGF256* field, 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 @@ CBC_ReedSolomonGF256Poly* CBC_ReedSolomonGF256Poly::AddOrSubtract( 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 @@ CBC_ReedSolomonGF256Poly* CBC_ReedSolomonGF256Poly::Multiply( 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 @@ CBC_ReedSolomonGF256Poly* CBC_ReedSolomonGF256Poly::Multiply(int32_t scalar, 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 @@ CBC_ReedSolomonGF256Poly* CBC_ReedSolomonGF256Poly::MultiplyByMonomial( 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 3eff31b622..ff93264e00 100644 --- a/xfa/fxbarcode/common/reedsolomon/BC_ReedSolomonGF256Poly.h +++ b/xfa/fxbarcode/common/reedsolomon/BC_ReedSolomonGF256Poly.h @@ -17,11 +17,11 @@ class CBC_ReedSolomonGF256Poly final { 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 @@ class CBC_ReedSolomonGF256Poly final { 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 bc0aa72b42..e7eef07b47 100644 --- a/xfa/fxbarcode/datamatrix/BC_DefaultPlacement.cpp +++ b/xfa/fxbarcode/datamatrix/BC_DefaultPlacement.cpp @@ -43,7 +43,7 @@ int32_t CBC_DefaultPlacement::getNumrows() { 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 64d02886f7..36a7ab2615 100644 --- a/xfa/fxbarcode/datamatrix/BC_DefaultPlacement.h +++ b/xfa/fxbarcode/datamatrix/BC_DefaultPlacement.h @@ -18,7 +18,7 @@ class CBC_DefaultPlacement { 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 @@ class CBC_DefaultPlacement { 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 f52f0ff0c4..7782830940 100644 --- a/xfa/fxbarcode/datamatrix/BC_ErrorCorrection.cpp +++ b/xfa/fxbarcode/datamatrix/BC_ErrorCorrection.cpp @@ -132,11 +132,11 @@ CFX_WideString CBC_ErrorCorrection::encodeECC200(CFX_WideString codewords, 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 fcd668af6d..4b4b246038 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]; diff --git a/xfa/fxbarcode/datamatrix/BC_HighLevelEncoder.h b/xfa/fxbarcode/datamatrix/BC_HighLevelEncoder.h index 3b88f888fd..5d72f1074e 100644 --- a/xfa/fxbarcode/datamatrix/BC_HighLevelEncoder.h +++ b/xfa/fxbarcode/datamatrix/BC_HighLevelEncoder.h @@ -23,7 +23,7 @@ class CBC_HighLevelEncoder : public CBC_SymbolShapeHint { 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 @@ class CBC_HighLevelEncoder : public CBC_SymbolShapeHint { 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 9b8d0c149c..16ed6fdf12 100644 --- a/xfa/fxbarcode/pdf417/BC_PDF417.cpp +++ b/xfa/fxbarcode/pdf417/BC_PDF417.cpp @@ -410,7 +410,7 @@ void CBC_PDF417::generateBarcodeLogic(CFX_WideString msg, 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 @@ void CBC_PDF417::encodeLowLevel(CFX_WideString fullCodewords, } } -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 @@ CFX_Int32Array* CBC_PDF417::determineDimensions( } ratio = newRatio; delete dimension; - dimension = new CFX_Int32Array; + dimension = new CFX_ArrayTemplate<int32_t>; dimension->Add(cols); dimension->Add(rows); } @@ -563,11 +563,11 @@ CFX_Int32Array* CBC_PDF417::determineDimensions( 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 5f7c2d49b9..3ba5aa2f0c 100644 --- a/xfa/fxbarcode/pdf417/BC_PDF417.h +++ b/xfa/fxbarcode/pdf417/BC_PDF417.h @@ -51,9 +51,10 @@ class CBC_PDF417 { 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 f348d2c934..c1f4da1e3b 100644 --- a/xfa/fxbarcode/pdf417/BC_PDF417BarcodeMatrix.cpp +++ b/xfa/fxbarcode/pdf417/BC_PDF417BarcodeMatrix.cpp @@ -59,16 +59,16 @@ int32_t CBC_BarcodeMatrix::getWidth() { 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 0f6922233d..95ab547c90 100644 --- a/xfa/fxbarcode/pdf417/BC_PDF417BarcodeMatrix.h +++ b/xfa/fxbarcode/pdf417/BC_PDF417BarcodeMatrix.h @@ -21,15 +21,15 @@ class CBC_BarcodeMatrix { 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 b721ffc3ef..243af70d94 100644 --- a/xfa/fxbarcode/pdf417/BC_PDF417BarcodeRow.cpp +++ b/xfa/fxbarcode/pdf417/BC_PDF417BarcodeRow.cpp @@ -41,10 +41,10 @@ void CBC_BarcodeRow::addBar(bool black, int32_t width) { 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 90e76ac50a..7d9d19cb56 100644 --- a/xfa/fxbarcode/pdf417/BC_PDF417BarcodeRow.h +++ b/xfa/fxbarcode/pdf417/BC_PDF417BarcodeRow.h @@ -17,12 +17,12 @@ class CBC_BarcodeRow { 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 fa0e9bc67d..183566f9e3 100644 --- a/xfa/fxbarcode/pdf417/BC_PDF417HighLevelEncoder.cpp +++ b/xfa/fxbarcode/pdf417/BC_PDF417HighLevelEncoder.cpp @@ -71,7 +71,7 @@ CFX_WideString CBC_PDF417HighLevelEncoder::encodeHighLevel( } 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 @@ int32_t CBC_PDF417HighLevelEncoder::encodeText(CFX_WideString msg, } 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::determineConsecutiveTextCount( } 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 39abe0f1df..38382c891c 100644 --- a/xfa/fxbarcode/pdf417/BC_PDF417HighLevelEncoder.h +++ b/xfa/fxbarcode/pdf417/BC_PDF417HighLevelEncoder.h @@ -39,7 +39,7 @@ class CBC_PDF417HighLevelEncoder { 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 @@ class CBC_PDF417HighLevelEncoder { 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 a1b753e3ee..2cd60fef41 100644 --- a/xfa/fxbarcode/pdf417/BC_PDF417HighLevelEncoder_unittest.cpp +++ b/xfa/fxbarcode/pdf417/BC_PDF417HighLevelEncoder_unittest.cpp @@ -43,7 +43,7 @@ TEST(PDF417HighLevelEncoder, EncodeBinary) { 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 4c9b5cb15c..72d1a05dfd 100644 --- a/xfa/fxbarcode/pdf417/BC_PDF417Writer.cpp +++ b/xfa/fxbarcode/pdf417/BC_PDF417Writer.cpp @@ -63,7 +63,7 @@ uint8_t* CBC_PDF417Writer::Encode(const CFX_WideString& contents, 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 @@ uint8_t* CBC_PDF417Writer::Encode(const CFX_WideString& contents, 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 178d251bfe..420c441bc9 100644 --- a/xfa/fxbarcode/pdf417/BC_PDF417Writer.h +++ b/xfa/fxbarcode/pdf417/BC_PDF417Writer.h @@ -27,7 +27,9 @@ class CBC_PDF417Writer : public CBC_TwoDimWriter { 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 332f1de9c2..ab17d244fa 100644 --- a/xfa/fxbarcode/qrcode/BC_QRCoderEncoder.cpp +++ b/xfa/fxbarcode/qrcode/BC_QRCoderEncoder.cpp @@ -95,7 +95,7 @@ void CBC_QRCoderEncoder::AppendDataModeLenghInfo( 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(const CFX_ByteString& content, } } -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::Append8BitBytes(CFX_ByteArray& bytes, 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 @@ CBC_CommonByteArray* CBC_QRCoderEncoder::GenerateECBytes( 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 649938a060..a1b078f24c 100644 --- a/xfa/fxbarcode/qrcode/BC_QRCoderEncoder.h +++ b/xfa/fxbarcode/qrcode/BC_QRCoderEncoder.h @@ -62,7 +62,7 @@ class CBC_QRCoderEncoder { 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 b0b445bede..b4effb91a5 100644 --- a/xfa/fxbarcode/qrcode/BC_QRCoderVersion.cpp +++ b/xfa/fxbarcode/qrcode/BC_QRCoderVersion.cpp @@ -354,7 +354,7 @@ CBC_QRCoderVersion::~CBC_QRCoderVersion() { 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 43b4b6062e..030dd512a0 100644 --- a/xfa/fxbarcode/qrcode/BC_QRCoderVersion.h +++ b/xfa/fxbarcode/qrcode/BC_QRCoderVersion.h @@ -23,7 +23,7 @@ class CBC_QRCoderVersion { 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 @@ class CBC_QRCoderVersion { 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 7473d4196b..cb6eed7fe1 100644 --- a/xfa/fxbarcode/utils.h +++ b/xfa/fxbarcode/utils.h @@ -15,7 +15,8 @@ bool BC_FX_ByteString_Replace(CFX_ByteString& dst, 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 4de53d1eb0..cb0ad136a0 100644 --- a/xfa/fxfa/app/cxfa_textlayout.h +++ b/xfa/fxfa/app/cxfa_textlayout.h @@ -60,7 +60,7 @@ class CXFA_TextLayout { } 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 2764d725af..e0e04699d4 100644 --- a/xfa/fxfa/app/xfa_ffchoicelist.cpp +++ b/xfa/fxfa/app/xfa_ffchoicelist.cpp @@ -65,7 +65,7 @@ bool CXFA_FFListBox::LoadWidget() { } 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::OnKillFocus(CXFA_FFWidget* pNewFocus) { 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::CommitData() { } 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 @@ bool CXFA_FFListBox::UpdateFWLData() { } 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 @@ bool CXFA_FFListBox::UpdateFWLData() { 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 @@ void CXFA_FFListBox::OnProcessEvent(CFWL_Event* pEvent) { 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 @@ bool CXFA_FFComboBox::LoadWidget() { 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 @@ bool CXFA_FFComboBox::UpdateFWLData() { 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 e9bee6f715..75057b041b 100644 --- a/xfa/fxfa/app/xfa_ffchoicelist.h +++ b/xfa/fxfa/app/xfa_ffchoicelist.h @@ -23,7 +23,8 @@ class CXFA_FFListBox : public CXFA_FFField { 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 271e14be6c..9bd34726c5 100644 --- a/xfa/fxfa/parser/cxfa_resolveprocessor.cpp +++ b/xfa/fxfa/parser/cxfa_resolveprocessor.cpp @@ -497,7 +497,8 @@ int32_t CXFA_ResolveProcessor::ResolveAsterisk(CXFA_ResolveNodesData& rnd) { 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 @@ int32_t CXFA_ResolveProcessor::GetFilter(const CFX_WideStringC& wsExpression, 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 2590021cdb..d806d57b93 100644 --- a/xfa/fxfa/parser/cxfa_resolveprocessor.h +++ b/xfa/fxfa/parser/cxfa_resolveprocessor.h @@ -60,7 +60,7 @@ class CXFA_ResolveProcessor { 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 80c50b781e..31c5cf48e6 100644 --- a/xfa/fxfa/parser/cxfa_widgetdata.cpp +++ b/xfa/fxfa/parser/cxfa_widgetdata.cpp @@ -874,7 +874,7 @@ int32_t CXFA_WidgetData::GetSelectedItem(int32_t nIndex) { 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 @@ void CXFA_WidgetData::SetItemState(int32_t nIndex, 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::SetItemState(int32_t nIndex, } } -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 7986fa9d82..4f5db3bad6 100644 --- a/xfa/fxfa/parser/cxfa_widgetdata.h +++ b/xfa/fxfa/parser/cxfa_widgetdata.h @@ -102,7 +102,7 @@ class CXFA_WidgetData : public CXFA_Data { 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 @@ class CXFA_WidgetData : public CXFA_Data { bool bNotify, bool bScriptModify, bool bSyncData); - void SetSelectedItems(CFX_Int32Array& iSelArray, + void SetSelectedItems(CFX_ArrayTemplate<int32_t>& iSelArray, bool bNotify, bool bScriptModify, bool bSyncData); |