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

Unified Diff: core/fpdfapi/page/cpdf_textobject.cpp

Issue 2517163003: Use more unique_ptrs in CPDF_Image. (Closed)
Patch Set: rebase 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/page/cpdf_textobject.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/fpdfapi/page/cpdf_textobject.cpp
diff --git a/core/fpdfapi/page/cpdf_textobject.cpp b/core/fpdfapi/page/cpdf_textobject.cpp
index d5a2ea6d29e2a57f3e0598a731197e6d92a99646..0979fcfb332de53d23cb717b7e283c61a586006d 100644
--- a/core/fpdfapi/page/cpdf_textobject.cpp
+++ b/core/fpdfapi/page/cpdf_textobject.cpp
@@ -8,6 +8,7 @@
#include "core/fpdfapi/font/cpdf_cidfont.h"
#include "core/fpdfapi/font/cpdf_font.h"
+#include "third_party/base/ptr_util.h"
CPDF_TextObject::CPDF_TextObject()
: m_PosX(0),
@@ -109,8 +110,8 @@ void CPDF_TextObject::GetCharInfo(int index, CPDF_TextObjectItem* pInfo) const {
}
}
-CPDF_TextObject* CPDF_TextObject::Clone() const {
- CPDF_TextObject* obj = new CPDF_TextObject;
+std::unique_ptr<CPDF_TextObject> CPDF_TextObject::Clone() const {
+ auto obj = pdfium::MakeUnique<CPDF_TextObject>();
obj->CopyData(this);
obj->m_nChars = m_nChars;
« no previous file with comments | « core/fpdfapi/page/cpdf_textobject.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698