summaryrefslogtreecommitdiff
path: root/xfa/fxfa/app/xfa_textlayout.h
diff options
context:
space:
mode:
authortsepez <tsepez@chromium.org>2016-05-11 10:26:05 -0700
committerCommit bot <commit-bot@chromium.org>2016-05-11 10:26:05 -0700
commitf74ad998d2e8d2636fb25e94823946a3b151e34e (patch)
tree0b18e0a29fdc4bf1cce66ea437d8a4841b3daf4a /xfa/fxfa/app/xfa_textlayout.h
parent2c3a16a7698ba15476173e849f82c97ea3da9939 (diff)
downloadpdfium-f74ad998d2e8d2636fb25e94823946a3b151e34e.tar.xz
Replace some calls to Release() with direct delete, part 1.
Searching for the anti-pattern: void Release() { delete this; } We must be explicit on the ownership model. Add unique_ptrs as a result. Review-Url: https://codereview.chromium.org/1960673003
Diffstat (limited to 'xfa/fxfa/app/xfa_textlayout.h')
-rw-r--r--xfa/fxfa/app/xfa_textlayout.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/xfa/fxfa/app/xfa_textlayout.h b/xfa/fxfa/app/xfa_textlayout.h
index 17450ddeab..4d03aee302 100644
--- a/xfa/fxfa/app/xfa_textlayout.h
+++ b/xfa/fxfa/app/xfa_textlayout.h
@@ -8,6 +8,7 @@
#define XFA_FXFA_APP_XFA_TEXTLAYOUT_H_
#include <map>
+#include <memory>
#include "xfa/fde/css/fde_css.h"
#include "xfa/fde/fde_gedevice.h"
@@ -79,7 +80,7 @@ class CXFA_TextParseContext : public CFX_Target {
class CXFA_TextParser {
public:
- CXFA_TextParser() : m_pAllocator(NULL), m_pSelector(NULL), m_pUASheet(NULL) {}
+ CXFA_TextParser();
virtual ~CXFA_TextParser();
void Reset();
void DoParse(CFDE_XMLNode* pXMLContainer, CXFA_TextProvider* pTextProvider);
@@ -131,7 +132,7 @@ class CXFA_TextParser {
IFDE_CSSStyleSheet* LoadDefaultSheetStyle();
IFDE_CSSComputedStyle* CreateStyle(IFDE_CSSComputedStyle* pParentStyle);
IFX_MemoryAllocator* m_pAllocator;
- CFDE_CSSStyleSelector* m_pSelector;
+ std::unique_ptr<CFDE_CSSStyleSelector> m_pSelector;
IFDE_CSSStyleSheet* m_pUASheet;
CFX_MapPtrTemplate<CFDE_XMLNode*, CXFA_TextParseContext*>
m_mapXMLNodeToParseContext;