summaryrefslogtreecommitdiff
path: root/core/fxcrt/cfx_chariter.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'core/fxcrt/cfx_chariter.cpp')
-rw-r--r--core/fxcrt/cfx_chariter.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/core/fxcrt/cfx_chariter.cpp b/core/fxcrt/cfx_chariter.cpp
index c14db2f322..b726a7e484 100644
--- a/core/fxcrt/cfx_chariter.cpp
+++ b/core/fxcrt/cfx_chariter.cpp
@@ -6,6 +6,8 @@
#include "core/fxcrt/cfx_chariter.h"
+#include "third_party/base/ptr_util.h"
+
CFX_CharIter::CFX_CharIter(const CFX_WideString& wsText)
: m_wsText(wsText), m_nIndex(0) {
ASSERT(!wsText.IsEmpty());
@@ -44,8 +46,8 @@ bool CFX_CharIter::IsEOF(bool bTail) const {
return bTail ? (m_nIndex + 1 == m_wsText.GetLength()) : (m_nIndex == 0);
}
-IFX_CharIter* CFX_CharIter::Clone() {
- CFX_CharIter* pIter = new CFX_CharIter(m_wsText);
+std::unique_ptr<IFX_CharIter> CFX_CharIter::Clone() {
+ auto pIter = pdfium::MakeUnique<CFX_CharIter>(m_wsText);
pIter->m_nIndex = m_nIndex;
return pIter;
}