summaryrefslogtreecommitdiff
path: root/xfa/fde
diff options
context:
space:
mode:
Diffstat (limited to 'xfa/fde')
-rw-r--r--xfa/fde/cfde_txtedtbuf.cpp4
-rw-r--r--xfa/fde/cfde_txtedtbuf.h2
-rw-r--r--xfa/fde/cfde_txtedtpage.cpp2
3 files changed, 4 insertions, 4 deletions
diff --git a/xfa/fde/cfde_txtedtbuf.cpp b/xfa/fde/cfde_txtedtbuf.cpp
index dc88704a6c..1ec3c9721a 100644
--- a/xfa/fde/cfde_txtedtbuf.cpp
+++ b/xfa/fde/cfde_txtedtbuf.cpp
@@ -343,8 +343,8 @@ bool CFDE_TxtEdtBuf::Iterator::IsEOF(bool bTail) const {
return bTail ? m_nIndex == (m_pBuf->GetTextLength() - 2) : m_nIndex == 0;
}
-IFX_CharIter* CFDE_TxtEdtBuf::Iterator::Clone() {
- CFDE_TxtEdtBuf::Iterator* pIter = new CFDE_TxtEdtBuf::Iterator(m_pBuf);
+std::unique_ptr<IFX_CharIter> CFDE_TxtEdtBuf::Iterator::Clone() {
+ auto pIter = pdfium::MakeUnique<CFDE_TxtEdtBuf::Iterator>(m_pBuf);
pIter->m_nCurChunk = m_nCurChunk;
pIter->m_nCurIndex = m_nCurIndex;
pIter->m_nIndex = m_nIndex;
diff --git a/xfa/fde/cfde_txtedtbuf.h b/xfa/fde/cfde_txtedtbuf.h
index 650d375bf8..096ce6bf77 100644
--- a/xfa/fde/cfde_txtedtbuf.h
+++ b/xfa/fde/cfde_txtedtbuf.h
@@ -31,7 +31,7 @@ class CFDE_TxtEdtBuf {
int32_t GetAt() const override;
bool IsEOF(bool bTail = true) const override;
- IFX_CharIter* Clone() override;
+ std::unique_ptr<IFX_CharIter> Clone() override;
private:
CFDE_TxtEdtBuf* m_pBuf;
diff --git a/xfa/fde/cfde_txtedtpage.cpp b/xfa/fde/cfde_txtedtpage.cpp
index faf52316c8..f0b03af7ca 100644
--- a/xfa/fde/cfde_txtedtpage.cpp
+++ b/xfa/fde/cfde_txtedtpage.cpp
@@ -279,7 +279,7 @@ int32_t CFDE_TxtEdtPage::LoadPage(const CFX_RectF* pClipBox,
m_nCharCount = nPageEnd - nPageStart + 1;
bool bReload = false;
float fDefCharWidth = 0;
- std::unique_ptr<IFX_CharIter> pIter(m_pIter->Clone());
+ std::unique_ptr<IFX_CharIter> pIter = m_pIter->Clone();
pIter->SetAt(nPageStart);
m_pIter->SetAt(nPageStart);
bool bFirstPiece = true;