summaryrefslogtreecommitdiff
path: root/core/fpdfdoc/cpdf_variabletext.cpp
diff options
context:
space:
mode:
authorweili <weili@chromium.org>2016-07-11 14:43:40 -0700
committerCommit bot <commit-bot@chromium.org>2016-07-11 14:43:41 -0700
commit5a6c1398d0e559fb6a048cb0dca46ba9f9309a77 (patch)
tree40193eaf374d0f9bf2ec2f257871279b0f36efb8 /core/fpdfdoc/cpdf_variabletext.cpp
parentac14258c429141653f73ca5c1b64ad259ac15804 (diff)
downloadpdfium-5a6c1398d0e559fb6a048cb0dca46ba9f9309a77.tar.xz
Use smart pointers for class owned member variables
Replace raw member variables to smart pointer type to better maintain the ownership and to ease the management. BUG=pdfium:518 Review-Url: https://codereview.chromium.org/2136683002
Diffstat (limited to 'core/fpdfdoc/cpdf_variabletext.cpp')
-rw-r--r--core/fpdfdoc/cpdf_variabletext.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/core/fpdfdoc/cpdf_variabletext.cpp b/core/fpdfdoc/cpdf_variabletext.cpp
index 010d426cf2..1ac36ade86 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;