From 4d06f83da7fbc65e83ecc3c36b339c04ac1ab668 Mon Sep 17 00:00:00 2001 From: tsepez Date: Tue, 3 May 2016 14:13:29 -0700 Subject: Cleanup XFA-Specific memory allocators. Remove unused "dynamic" allocator (the scary one). Use malloc/free wrapper allocator under #ifdef for CF/asan testing. Rename IFX_MEMAllocator to IFX_MemoryAllocator (MEM in all caps would imply that MEM was an acroynm, not an abbreviation). Review-Url: https://codereview.chromium.org/1944093002 --- xfa/fxfa/app/xfa_textlayout.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'xfa/fxfa/app/xfa_textlayout.cpp') diff --git a/xfa/fxfa/app/xfa_textlayout.cpp b/xfa/fxfa/app/xfa_textlayout.cpp index 9ed84e1604..bd06421870 100644 --- a/xfa/fxfa/app/xfa_textlayout.cpp +++ b/xfa/fxfa/app/xfa_textlayout.cpp @@ -212,8 +212,8 @@ void CXFA_TextParser::DoParse(CFDE_XMLNode* pXMLContainer, if (pXMLContainer == NULL || pTextProvider == NULL || m_pAllocator) { return; } - m_pAllocator = - FX_CreateAllocator(FX_ALLOCTYPE_Fixed, 32, sizeof(CXFA_CSSTagProvider)); + m_pAllocator = IFX_MemoryAllocator::Create(FX_ALLOCTYPE_Fixed, 32, + sizeof(CXFA_CSSTagProvider)); InitCSSData(pTextProvider); IFDE_CSSComputedStyle* pRootStyle = CreateRootStyle(pTextProvider); ParseRichText(pXMLContainer, pRootStyle); @@ -1272,9 +1272,9 @@ void CXFA_TextLayout::UpdateAlign(FX_FLOAT fHeight, FX_FLOAT fBottom) { FX_BOOL CXFA_TextLayout::Loader(const CFX_SizeF& szText, FX_FLOAT& fLinePos, FX_BOOL bSavePieces) { - if (m_pAllocator == NULL) { - m_pAllocator = FX_CreateAllocator(FX_ALLOCTYPE_Static, 256, 0); - } + if (!m_pAllocator) + m_pAllocator = IFX_MemoryAllocator::Create(FX_ALLOCTYPE_Static, 256, 0); + GetTextDataNode(); if (m_pTextDataNode == NULL) { return TRUE; -- cgit v1.2.3