Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(229)

Unified Diff: xfa/fxfa/app/xfa_textlayout.cpp

Issue 1944093002: Cleanup XFA-Specific memory allocators. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Dan's comments, remove more unused methods. Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « xfa/fxfa/app/xfa_textlayout.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: xfa/fxfa/app/xfa_textlayout.cpp
diff --git a/xfa/fxfa/app/xfa_textlayout.cpp b/xfa/fxfa/app/xfa_textlayout.cpp
index 9ed84e16040da3ba9d1f382ba134a673f06b4bc6..bd06421870b3396ddc4f1000e9f90ce537e3cb73 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;
« no previous file with comments | « xfa/fxfa/app/xfa_textlayout.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698