summaryrefslogtreecommitdiff
path: root/core/fpdfapi/page/cpdf_textobject.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'core/fpdfapi/page/cpdf_textobject.cpp')
-rw-r--r--core/fpdfapi/page/cpdf_textobject.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/core/fpdfapi/page/cpdf_textobject.cpp b/core/fpdfapi/page/cpdf_textobject.cpp
index d5a2ea6d29..0979fcfb33 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;