summaryrefslogtreecommitdiff
path: root/xfa/fxfa/app/cxfa_textuserdata.cpp
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2017-01-23 16:24:26 -0500
committerChromium commit bot <commit-bot@chromium.org>2017-01-24 15:05:29 +0000
commit7e5fdd0b1a2ce17e89723fee3e58ae472e32461f (patch)
treee8e14a43410d3d159cef27a0140c4fa8a633f8db /xfa/fxfa/app/cxfa_textuserdata.cpp
parentaee2d80f628ba02d0561c921b7bb1939b3480fca (diff)
downloadpdfium-7e5fdd0b1a2ce17e89723fee3e58ae472e32461f.tar.xz
Track CFDE_CSSComputedStyle with retained ptrs
Remove the bare new and use CFX_RetainPtr to keep track of the computed styles. Change-Id: Icf235623529797176707482c78676814b7a81b9e Reviewed-on: https://pdfium-review.googlesource.com/2292 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'xfa/fxfa/app/cxfa_textuserdata.cpp')
-rw-r--r--xfa/fxfa/app/cxfa_textuserdata.cpp20
1 files changed, 7 insertions, 13 deletions
diff --git a/xfa/fxfa/app/cxfa_textuserdata.cpp b/xfa/fxfa/app/cxfa_textuserdata.cpp
index 4fdabd6bb3..e436ab2ae9 100644
--- a/xfa/fxfa/app/cxfa_textuserdata.cpp
+++ b/xfa/fxfa/app/cxfa_textuserdata.cpp
@@ -11,22 +11,16 @@
#include "xfa/fde/css/fde_css.h"
#include "xfa/fxfa/app/cxfa_linkuserdata.h"
-CXFA_TextUserData::CXFA_TextUserData(CFDE_CSSComputedStyle* pStyle)
- : m_pStyle(pStyle), m_pLinkData(nullptr), m_dwRefCount(0) {
- if (m_pStyle)
- m_pStyle->Retain();
-}
+CXFA_TextUserData::CXFA_TextUserData(
+ const CFX_RetainPtr<CFDE_CSSComputedStyle>& pStyle)
+ : m_pStyle(pStyle), m_pLinkData(nullptr), m_dwRefCount(0) {}
-CXFA_TextUserData::CXFA_TextUserData(CFDE_CSSComputedStyle* pStyle,
- CXFA_LinkUserData* pLinkData)
- : m_pStyle(pStyle), m_pLinkData(pLinkData), m_dwRefCount(0) {
- if (m_pStyle)
- m_pStyle->Retain();
-}
+CXFA_TextUserData::CXFA_TextUserData(
+ const CFX_RetainPtr<CFDE_CSSComputedStyle>& pStyle,
+ CXFA_LinkUserData* pLinkData)
+ : m_pStyle(pStyle), m_pLinkData(pLinkData), m_dwRefCount(0) {}
CXFA_TextUserData::~CXFA_TextUserData() {
- if (m_pStyle)
- m_pStyle->Release();
if (m_pLinkData)
m_pLinkData->Release();
}