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

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

Issue 2208423002: Use smart pointers for class owned pointers under xfa/fde (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: one more change Created 4 years, 4 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/fgas/crt/fgas_memory.cpp ('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 88645b7cdd4f89e0ba014c315d15c9bbba72d63b..6ac5c057c0a3badc5426db0d89116366843f0a4d 100644
--- a/xfa/fxfa/app/xfa_textlayout.cpp
+++ b/xfa/fxfa/app/xfa_textlayout.cpp
@@ -96,8 +96,7 @@ void CXFA_TextParser::InitCSSData(CXFA_TextProvider* pTextProvider) {
CXFA_FFDoc* pDoc = pTextProvider->GetDocNode();
IFGAS_FontMgr* pFontMgr = pDoc->GetApp()->GetFDEFontMgr();
ASSERT(pFontMgr);
- m_pSelector.reset(new CFDE_CSSStyleSelector);
- m_pSelector->SetFontMgr(pFontMgr);
+ m_pSelector.reset(new CFDE_CSSStyleSelector(pFontMgr));
FX_FLOAT fFontSize = 10;
CXFA_Font font = pTextProvider->GetFontNode();
if (font) {
@@ -252,8 +251,8 @@ void CXFA_TextParser::DoParse(CFDE_XMLNode* pXMLContainer,
if (!pXMLContainer || !pTextProvider || m_pAllocator) {
return;
}
- m_pAllocator.reset(IFX_MemoryAllocator::Create(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);
@@ -1294,8 +1293,7 @@ FX_BOOL CXFA_TextLayout::Loader(const CFX_SizeF& szText,
FX_FLOAT& fLinePos,
FX_BOOL bSavePieces) {
if (!m_pAllocator) {
- m_pAllocator.reset(
- IFX_MemoryAllocator::Create(FX_ALLOCTYPE_Static, 256, 0));
+ m_pAllocator = IFX_MemoryAllocator::Create(FX_ALLOCTYPE_Static, 256, 0);
}
GetTextDataNode();
if (!m_pTextDataNode)
« no previous file with comments | « xfa/fgas/crt/fgas_memory.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698