diff options
author | Tom Sepez <tsepez@chromium.org> | 2015-04-17 15:15:08 -0700 |
---|---|---|
committer | Tom Sepez <tsepez@chromium.org> | 2015-04-17 15:15:08 -0700 |
commit | 4cb07c9c9cd5761ce3179d3d7254c1cf0efeafa5 (patch) | |
tree | 2549011fbc3d9d6b8415394a5dc6372a2b346b1e /core/src/reflow/reflowedtextpage.cpp | |
parent | 48606843d54c5f870d69627afedd574b58d65b3e (diff) | |
download | pdfium-4cb07c9c9cd5761ce3179d3d7254c1cf0efeafa5.tar.xz |
Fix all remaining instances of FX_NEW.
R=thestig@chromium.org
Review URL: https://codereview.chromium.org/1084613006
Diffstat (limited to 'core/src/reflow/reflowedtextpage.cpp')
-rw-r--r-- | core/src/reflow/reflowedtextpage.cpp | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/core/src/reflow/reflowedtextpage.cpp b/core/src/reflow/reflowedtextpage.cpp index a5ad0be948..0844f780b6 100644 --- a/core/src/reflow/reflowedtextpage.cpp +++ b/core/src/reflow/reflowedtextpage.cpp @@ -4,10 +4,13 @@ // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com +#include <algorithm> + #include "reflowedtextpage.h" + IPDF_TextPage* IPDF_TextPage::CreateReflowTextPage(IPDF_ReflowedPage* pRefPage) { - return FX_NEW CRF_TextPage(pRefPage); + return new CRF_TextPage(pRefPage); } CRF_TextPage::CRF_TextPage(IPDF_ReflowedPage* pRefPage) { @@ -32,24 +35,14 @@ FX_BOOL CRF_TextPage::ParseTextPage() return FALSE; } int count = m_pRefPage->m_pReflowed->GetSize(); - if(count < 500) { - m_pDataList = FX_NEW CRF_CharDataPtrArray(count); - } else { - m_pDataList = FX_NEW CRF_CharDataPtrArray(500); - } - if (NULL == m_pDataList) { - return FALSE; - } + m_pDataList = new CRF_CharDataPtrArray(std::min(count, 500)); for(int i = 0; i < count; i++) { CRF_Data* pData = (*(m_pRefPage->m_pReflowed))[i]; if(pData->GetType() == CRF_Data::Text) { m_pDataList->Add((CRF_CharData*)pData); } } - m_CountBSArray = FX_NEW CFX_CountBSINT32Array(20); - if(NULL == m_CountBSArray) { - return FALSE; - } + m_CountBSArray = new CFX_CountBSINT32Array(20); return TRUE; } FX_BOOL CRF_TextPage::IsParsered() const |