summaryrefslogtreecommitdiff
path: root/xfa/fxfa/app/xfa_textlayout.cpp
diff options
context:
space:
mode:
authortsepez <tsepez@chromium.org>2016-05-03 14:13:29 -0700
committerCommit bot <commit-bot@chromium.org>2016-05-03 14:13:29 -0700
commit4d06f83da7fbc65e83ecc3c36b339c04ac1ab668 (patch)
tree183592694f9c93951838111130d78d204e1e9a68 /xfa/fxfa/app/xfa_textlayout.cpp
parent89fcde88f0c03da77d7fd83dece7726d66fd190e (diff)
downloadpdfium-4d06f83da7fbc65e83ecc3c36b339c04ac1ab668.tar.xz
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
Diffstat (limited to 'xfa/fxfa/app/xfa_textlayout.cpp')
-rw-r--r--xfa/fxfa/app/xfa_textlayout.cpp10
1 files changed, 5 insertions, 5 deletions
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;