diff options
author | thestig <thestig@chromium.org> | 2016-05-11 12:59:22 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-05-11 12:59:22 -0700 |
commit | 821d59e1d66b67af970c59b7681828b1b82858b6 (patch) | |
tree | 60e71c3c317f5843d0488e827c6932a956df7866 /core/fpdfdoc/cpdf_variabletext.cpp | |
parent | a244dfe2ba2cc82ee264475253cc16222e022524 (diff) | |
download | pdfium-821d59e1d66b67af970c59b7681828b1b82858b6.tar.xz |
CPDF_VariableText::GetIterator() never returns NULL.
Same goes for CFX_Edit::GetIterator().
Review-Url: https://codereview.chromium.org/1967963002
Diffstat (limited to 'core/fpdfdoc/cpdf_variabletext.cpp')
-rw-r--r-- | core/fpdfdoc/cpdf_variabletext.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/core/fpdfdoc/cpdf_variabletext.cpp b/core/fpdfdoc/cpdf_variabletext.cpp index 427cd5d306..3c71ed8786 100644 --- a/core/fpdfdoc/cpdf_variabletext.cpp +++ b/core/fpdfdoc/cpdf_variabletext.cpp @@ -256,11 +256,9 @@ CPDF_VariableText::CPDF_VariableText() m_fFontSize(0.0f), m_bInitial(FALSE), m_bRichText(FALSE), - m_pVTProvider(nullptr), - m_pVTIterator(nullptr) {} + m_pVTProvider(nullptr) {} CPDF_VariableText::~CPDF_VariableText() { - delete m_pVTIterator; ResetAll(); } @@ -1149,8 +1147,8 @@ FX_BOOL CPDF_VariableText::IsLatinWord(uint16_t word) { CPDF_VariableText::Iterator* CPDF_VariableText::GetIterator() { if (!m_pVTIterator) - m_pVTIterator = new CPDF_VariableText::Iterator(this); - return m_pVTIterator; + m_pVTIterator.reset(new CPDF_VariableText::Iterator(this)); + return m_pVTIterator.get(); } void CPDF_VariableText::SetProvider(CPDF_VariableText::Provider* pProvider) { |