diff options
author | weili <weili@chromium.org> | 2016-08-09 10:33:10 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-08-09 10:33:10 -0700 |
commit | 16fccc51456dbab7e392c3952cc367723f9694f6 (patch) | |
tree | 0bd44bec6b81213db9d1dc487237164cdcaa43a4 /xfa/fxfa/fm2js/xfa_program.h | |
parent | af7ab33c73f58f18d0db0c90d93fa0aab0bc83f3 (diff) | |
download | pdfium-16fccc51456dbab7e392c3952cc367723f9694f6.tar.xz |
Use smart pointers for class owned pointers
For classes under xfa/fxfa/fm2js, and xfa/fxgraphics, use smart
pointers instead of raw pointer to make memory management easier.
Also fix some styling issues along the changes.
BUG=pdfium:518
Review-Url: https://codereview.chromium.org/2222203002
Diffstat (limited to 'xfa/fxfa/fm2js/xfa_program.h')
-rw-r--r-- | xfa/fxfa/fm2js/xfa_program.h | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/xfa/fxfa/fm2js/xfa_program.h b/xfa/fxfa/fm2js/xfa_program.h index 2f6de5e3a8..aa29bba87b 100644 --- a/xfa/fxfa/fm2js/xfa_program.h +++ b/xfa/fxfa/fm2js/xfa_program.h @@ -7,6 +7,8 @@ #ifndef XFA_FXFA_FM2JS_XFA_PROGRAM_H_ #define XFA_FXFA_FM2JS_XFA_PROGRAM_H_ +#include <memory> + #include "xfa/fxfa/fm2js/xfa_error.h" #include "xfa/fxfa/fm2js/xfa_fmparse.h" @@ -14,15 +16,17 @@ class CXFA_FMProgram { public: CXFA_FMProgram(); ~CXFA_FMProgram(); + int32_t Init(const CFX_WideStringC& wsFormcalc); int32_t ParseProgram(); int32_t TranslateProgram(CFX_WideTextBuf& wsJavaScript); - CXFA_FMErrorInfo& GetError() { return m_pErrorInfo; } + + const CXFA_FMErrorInfo& GetError() const { return m_pErrorInfo; } private: CXFA_FMErrorInfo m_pErrorInfo; CXFA_FMParse m_parse; - CXFA_FMFunctionDefinition* m_globalFunction; + std::unique_ptr<CXFA_FMFunctionDefinition> m_globalFunction; }; #endif // XFA_FXFA_FM2JS_XFA_PROGRAM_H_ |