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

Unified Diff: core/fpdfdoc/cpdf_formfield.cpp

Issue 2484033002: Return unique_ptr from CPDF_Object::Clone(). (Closed)
Patch Set: std::move() it Created 4 years, 1 month 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/parser/cpdf_string.cpp ('k') | core/fpdfdoc/cpdf_interform.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/fpdfdoc/cpdf_formfield.cpp
diff --git a/core/fpdfdoc/cpdf_formfield.cpp b/core/fpdfdoc/cpdf_formfield.cpp
index 8170b7fcbf7cceb58752984722c460d2696b0895..4999f2d6b861fb5b4d08508e229f7e9efdf2795d 100644
--- a/core/fpdfdoc/cpdf_formfield.cpp
+++ b/core/fpdfdoc/cpdf_formfield.cpp
@@ -219,14 +219,14 @@ bool CPDF_FormField::ResetField(bool bNotify) {
return false;
if (pDV) {
- CPDF_Object* pClone = pDV->Clone();
+ std::unique_ptr<CPDF_Object> pClone = pDV->Clone();
if (!pClone)
return false;
- m_pDict->SetFor("V", pClone);
+ m_pDict->SetFor("V", pClone.release());
if (pRV) {
- CPDF_Object* pCloneR = pDV->Clone();
- m_pDict->SetFor("RV", pCloneR);
+ std::unique_ptr<CPDF_Object> pCloneR = pDV->Clone();
+ m_pDict->SetFor("RV", pCloneR.release());
}
} else {
m_pDict->RemoveFor("V");
« no previous file with comments | « core/fpdfapi/parser/cpdf_string.cpp ('k') | core/fpdfdoc/cpdf_interform.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698