From 1871821653de9f4b1706d726f4d318cf739e55af Mon Sep 17 00:00:00 2001 From: Tom Sepez Date: Thu, 17 Dec 2015 10:37:41 -0800 Subject: Remove FDE_Alloc in favor of FX_Alloc. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1521163002 . --- xfa/src/fee/src/fee/fde_txtedtengine.cpp | 5 ++--- xfa/src/fee/src/fee/fde_txtedtpage.cpp | 9 ++++----- 2 files changed, 6 insertions(+), 8 deletions(-) (limited to 'xfa/src/fee') diff --git a/xfa/src/fee/src/fee/fde_txtedtengine.cpp b/xfa/src/fee/src/fee/fde_txtedtengine.cpp index 2eb3f1ae4f..6cf8f0e872 100644 --- a/xfa/src/fee/src/fee/fde_txtedtengine.cpp +++ b/xfa/src/fee/src/fee/fde_txtedtengine.cpp @@ -124,8 +124,7 @@ void CFDE_TxtEdtEngine::SetTextByStream(IFX_Stream* pStream) { int32_t nPos = pStream->GetBOM(bom); pStream->Seek(FX_STREAMSEEK_Begin, nPos); int32_t nPlateSize = FX_MIN(nStreamLength, m_pTxtBuf->GetChunkSize()); - FX_WCHAR* lpwstr = (FX_WCHAR*)FDE_Alloc(nPlateSize * sizeof(FX_WCHAR)); - FXSYS_assert(lpwstr); + FX_WCHAR* lpwstr = FX_Alloc(FX_WCHAR, nPlateSize); FX_BOOL bEos = false; while (!bEos) { int32_t nRead = pStream->ReadString(lpwstr, nPlateSize, bEos); @@ -133,7 +132,7 @@ void CFDE_TxtEdtEngine::SetTextByStream(IFX_Stream* pStream) { m_pTxtBuf->Insert(nIndex, lpwstr, nRead); nIndex += nRead; } - FDE_Free(lpwstr); + FX_Free(lpwstr); } } m_pTxtBuf->Insert(nIndex, &m_wLineEnd, 1); diff --git a/xfa/src/fee/src/fee/fde_txtedtpage.cpp b/xfa/src/fee/src/fee/fde_txtedtpage.cpp index 8c9b7439f1..ec715b9070 100644 --- a/xfa/src/fee/src/fee/fde_txtedtpage.cpp +++ b/xfa/src/fee/src/fee/fde_txtedtpage.cpp @@ -287,7 +287,7 @@ int32_t CFDE_TxtEdtPage::GetCharCount() const { int32_t CFDE_TxtEdtPage::GetDisplayPos(const CFX_RectF& rtClip, FXTEXT_CHARPOS*& pCharPos, FX_LPRECTF pBBox) const { - pCharPos = (FXTEXT_CHARPOS*)FDE_Alloc(sizeof(FXTEXT_CHARPOS) * m_nCharCount); + pCharPos = FX_Alloc(FXTEXT_CHARPOS, m_nCharCount); int32_t nCharPosCount = 0; FDE_HVISUALOBJ hVisualObj = NULL; int32_t nVisualObjCount = m_PieceMassArr.GetSize(); @@ -304,10 +304,9 @@ int32_t CFDE_TxtEdtPage::GetDisplayPos(const CFX_RectF& rtClip, pos += nCount; } if ((nCharPosCount * 5) < (m_nCharCount << 2)) { - int32_t nLength = sizeof(FXTEXT_CHARPOS) * nCharPosCount; - FXTEXT_CHARPOS* pTemp = (FXTEXT_CHARPOS*)FDE_Alloc(nLength); - FXSYS_memcpy(pTemp, pCharPos, nLength); - FDE_Free(pCharPos); + FXTEXT_CHARPOS* pTemp = FX_Alloc(FXTEXT_CHARPOS, nCharPosCount); + FXSYS_memcpy(pTemp, pCharPos, sizeof(FXTEXT_CHARPOS) * nCharPosCount); + FX_Free(pCharPos); pCharPos = pTemp; } return nCharPosCount; -- cgit v1.2.3