summaryrefslogtreecommitdiff
path: root/xfa/fxfa/app/cxfa_textparsecontext.h
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2017-01-26 09:45:57 -0500
committerChromium commit bot <commit-bot@chromium.org>2017-01-26 15:05:05 +0000
commit35ee5bb4a2e51fd42f07c23a4008bfb97e390b25 (patch)
treec15fd938e4ab87136dc97ef7bdd4e576d1378703 /xfa/fxfa/app/cxfa_textparsecontext.h
parentcff5618d4e847b9f13e1f051d56e09ee00cfb089 (diff)
downloadpdfium-35ee5bb4a2e51fd42f07c23a4008bfb97e390b25.tar.xz
Cleanup memory in CFDE_CSSStyleSelector
This CL fixes up the bare new calls in CFDE_CSSStyleSelector and replaces them with unique_ptrs. Code massaged to work correclty with new types. Change-Id: I90fce1ed7486da97fe7b5e597e9d423748c069c0 Reviewed-on: https://pdfium-review.googlesource.com/2353 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'xfa/fxfa/app/cxfa_textparsecontext.h')
-rw-r--r--xfa/fxfa/app/cxfa_textparsecontext.h16
1 files changed, 9 insertions, 7 deletions
diff --git a/xfa/fxfa/app/cxfa_textparsecontext.h b/xfa/fxfa/app/cxfa_textparsecontext.h
index d13f35b6df..5ea68e9473 100644
--- a/xfa/fxfa/app/cxfa_textparsecontext.h
+++ b/xfa/fxfa/app/cxfa_textparsecontext.h
@@ -7,9 +7,13 @@
#ifndef XFA_FXFA_APP_CXFA_TEXTPARSECONTEXT_H_
#define XFA_FXFA_APP_CXFA_TEXTPARSECONTEXT_H_
+#include <utility>
+#include <vector>
+
+#include "third_party/base/stl_util.h"
+#include "xfa/fde/css/cfde_cssdeclaration.h"
#include "xfa/fde/css/fde_css.h"
-class CFDE_CSSDeclaration;
class CFDE_CSSComputedStyle;
class CXFA_TextParseContext {
@@ -20,17 +24,15 @@ class CXFA_TextParseContext {
void SetDisplay(FDE_CSSDisplay eDisplay) { m_eDisplay = eDisplay; }
FDE_CSSDisplay GetDisplay() const { return m_eDisplay; }
- void SetDecls(const CFDE_CSSDeclaration** ppDeclArray, int32_t iDeclCount);
- const CFDE_CSSDeclaration** GetDecls() {
- return const_cast<const CFDE_CSSDeclaration**>(m_ppMatchedDecls);
+ void SetDecls(std::vector<const CFDE_CSSDeclaration*>&& decl) {
+ decls_ = std::move(decl);
}
- uint32_t CountDecls() const { return m_dwMatchedDecls; }
+ const std::vector<const CFDE_CSSDeclaration*>& GetDecls() { return decls_; }
CFX_RetainPtr<CFDE_CSSComputedStyle> m_pParentStyle;
protected:
- CFDE_CSSDeclaration** m_ppMatchedDecls;
- uint32_t m_dwMatchedDecls;
+ std::vector<const CFDE_CSSDeclaration*> decls_;
FDE_CSSDisplay m_eDisplay;
};