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

Unified Diff: core/fpdfdoc/cpdf_variabletext.cpp

Issue 2136683002: Use smart pointers for class owned member variables (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 4 years, 5 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 | « core/fpdfapi/fpdf_render/render_int.h ('k') | core/fpdfdoc/cpvt_sectioninfo.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/fpdfdoc/cpdf_variabletext.cpp
diff --git a/core/fpdfdoc/cpdf_variabletext.cpp b/core/fpdfdoc/cpdf_variabletext.cpp
index 010d426cf2478570ba2f7663cd40f5302aaf5eb9..1ac36ade86064f612544bad30e42eced7592598d 100644
--- a/core/fpdfdoc/cpdf_variabletext.cpp
+++ b/core/fpdfdoc/cpdf_variabletext.cpp
@@ -264,9 +264,9 @@ void CPDF_VariableText::Initialize() {
if (!m_bInitial) {
CPVT_SectionInfo secinfo;
if (m_bRichText) {
- secinfo.pSecProps = new CPVT_SecProps(0.0f, 0.0f, 0);
- secinfo.pWordProps = new CPVT_WordProps(
- GetDefaultFontIndex(), kDefaultFontSize, 0, ScriptType::Normal, 0);
+ secinfo.pSecProps.reset(new CPVT_SecProps(0.0f, 0.0f, 0));
+ secinfo.pWordProps.reset(new CPVT_WordProps(
+ GetDefaultFontIndex(), kDefaultFontSize, 0, ScriptType::Normal, 0));
}
CPVT_WordPlace place;
place.nSecIndex = 0;
@@ -333,9 +333,9 @@ CPVT_WordPlace CPDF_VariableText::InsertSection(
CPVT_SectionInfo secinfo;
if (m_bRichText) {
if (pSecProps)
- secinfo.pSecProps = new CPVT_SecProps(*pSecProps);
+ secinfo.pSecProps.reset(new CPVT_SecProps(*pSecProps));
if (pWordProps)
- secinfo.pWordProps = new CPVT_WordProps(*pWordProps);
+ secinfo.pWordProps.reset(new CPVT_WordProps(*pWordProps));
}
AddSection(NewPlace, secinfo);
newplace = NewPlace;
@@ -426,9 +426,9 @@ void CPDF_VariableText::SetText(const FX_WCHAR* text,
CPVT_SectionInfo secinfo;
if (m_bRichText) {
if (pSecProps)
- secinfo.pSecProps = new CPVT_SecProps(*pSecProps);
+ secinfo.pSecProps.reset(new CPVT_SecProps(*pSecProps));
if (pWordProps)
- secinfo.pWordProps = new CPVT_WordProps(*pWordProps);
+ secinfo.pWordProps.reset(new CPVT_WordProps(*pWordProps));
}
if (CSection* pSection = m_SectionArray.GetAt(0))
pSection->m_SecInfo = secinfo;
« no previous file with comments | « core/fpdfapi/fpdf_render/render_int.h ('k') | core/fpdfdoc/cpvt_sectioninfo.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698