summaryrefslogtreecommitdiff
path: root/xfa/fde/xml/cfx_saxreader.cpp
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2017-03-21 16:15:55 -0700
committerChromium commit bot <commit-bot@chromium.org>2017-03-22 00:49:58 +0000
commit38f6d9d1134a23d9319a4efc3ac6e3f824d2ac40 (patch)
treea2b6af70f5a54fcc20cb90bcda0aa8998f09438f /xfa/fde/xml/cfx_saxreader.cpp
parent55d1d0191ea8316df32858d8cc62fb7c620e8613 (diff)
downloadpdfium-38f6d9d1134a23d9319a4efc3ac6e3f824d2ac40.tar.xz
Use unique_ptr in cfx_saxreader.h
Change-Id: Ia024aff32e7e6fb2d5f6454b9856518a76365de2 Reviewed-on: https://pdfium-review.googlesource.com/3142 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'xfa/fde/xml/cfx_saxreader.cpp')
-rw-r--r--xfa/fde/xml/cfx_saxreader.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/xfa/fde/xml/cfx_saxreader.cpp b/xfa/fde/xml/cfx_saxreader.cpp
index 552ec5f5fe..dfef595f8d 100644
--- a/xfa/fde/xml/cfx_saxreader.cpp
+++ b/xfa/fde/xml/cfx_saxreader.cpp
@@ -156,8 +156,7 @@ void CFX_SAXReader::Reset() {
m_iEntityStart = -1;
m_iNameLength = 0;
m_iDataPos = 0;
- delete m_pCommentContext;
- m_pCommentContext = nullptr;
+ m_pCommentContext.reset();
}
void CFX_SAXReader::Push() {
@@ -395,7 +394,7 @@ void CFX_SAXReader::ParseDeclOrComment() {
m_eMode = CFX_SaxMode::Comment;
GetCurrentItem()->m_eNode = CFX_SAXItem::Type::Comment;
if (!m_pCommentContext)
- m_pCommentContext = new CFX_SAXCommentContext;
+ m_pCommentContext = pdfium::MakeUnique<CFX_SAXCommentContext>();
m_pCommentContext->m_iHeaderCount = 1;
m_pCommentContext->m_iTailCount = 0;
return;
@@ -412,6 +411,7 @@ void CFX_SAXReader::ParseComment() {
m_dwNodePos = m_File.m_dwCur + m_File.m_dwBufIndex;
m_eMode = CFX_SaxMode::CommentContent;
}
+
void CFX_SAXReader::ParseCommentContent() {
if (m_CurByte == '-') {
m_pCommentContext->m_iTailCount++;