diff options
author | dan sinclair <dsinclair@chromium.org> | 2018-02-19 18:18:38 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-02-19 18:18:38 +0000 |
commit | 00961a731b4811f84b5610d0b752f2f2b610f8ff (patch) | |
tree | 3eeba992b11a7ecbfb89fc7009acba4da2d42f14 /xfa/fxfa/fm2js/cxfa_fmexpression.h | |
parent | d276a52cd5061e0d4ee4aa79b8e89bbeb0a89da3 (diff) | |
download | pdfium-00961a731b4811f84b5610d0b752f2f2b610f8ff.tar.xz |
Remove base class ToJavaScript methods in FormCalc
This CL removes the Loop base class as it adds no functionality. Other
base classes have had their ToJavaScript methods set as pure virtual and
their constructors made protected.
Change-Id: I5c77b8734d23c576dd52db7f72396ecdf2f7bd22
Reviewed-on: https://pdfium-review.googlesource.com/27270
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'xfa/fxfa/fm2js/cxfa_fmexpression.h')
-rw-r--r-- | xfa/fxfa/fm2js/cxfa_fmexpression.h | 22 |
1 files changed, 8 insertions, 14 deletions
diff --git a/xfa/fxfa/fm2js/cxfa_fmexpression.h b/xfa/fxfa/fm2js/cxfa_fmexpression.h index 104b8976a5..5140ed39ab 100644 --- a/xfa/fxfa/fm2js/cxfa_fmexpression.h +++ b/xfa/fxfa/fm2js/cxfa_fmexpression.h @@ -27,14 +27,16 @@ class CFX_WideTextBuf; class CXFA_FMExpression { public: - explicit CXFA_FMExpression(uint32_t line); - CXFA_FMExpression(uint32_t line, XFA_FM_EXPTYPE type); virtual ~CXFA_FMExpression() {} + virtual bool ToJavaScript(CFX_WideTextBuf& javascript, ReturnType type) = 0; - virtual bool ToJavaScript(CFX_WideTextBuf& javascript, ReturnType type); uint32_t GetLine() { return m_line; } XFA_FM_EXPTYPE GetExpType() const { return m_type; } + protected: + explicit CXFA_FMExpression(uint32_t line); + CXFA_FMExpression(uint32_t line, XFA_FM_EXPTYPE type); + private: XFA_FM_EXPTYPE m_type; uint32_t m_line; @@ -126,15 +128,7 @@ class CXFA_FMIfExpression : public CXFA_FMExpression { std::unique_ptr<CXFA_FMExpression> m_pElseExpression; }; -class CXFA_FMLoopExpression : public CXFA_FMExpression { - public: - explicit CXFA_FMLoopExpression(uint32_t line) : CXFA_FMExpression(line) {} - ~CXFA_FMLoopExpression() override; - - bool ToJavaScript(CFX_WideTextBuf& javascript, ReturnType type) override; -}; - -class CXFA_FMWhileExpression : public CXFA_FMLoopExpression { +class CXFA_FMWhileExpression : public CXFA_FMExpression { public: CXFA_FMWhileExpression(uint32_t line, std::unique_ptr<CXFA_FMSimpleExpression> pCodition, @@ -164,7 +158,7 @@ class CXFA_FMContinueExpression : public CXFA_FMExpression { bool ToJavaScript(CFX_WideTextBuf& javascript, ReturnType type) override; }; -class CXFA_FMForExpression : public CXFA_FMLoopExpression { +class CXFA_FMForExpression : public CXFA_FMExpression { public: CXFA_FMForExpression(uint32_t line, const WideStringView& wsVariant, @@ -186,7 +180,7 @@ class CXFA_FMForExpression : public CXFA_FMLoopExpression { std::unique_ptr<CXFA_FMExpression> m_pList; }; -class CXFA_FMForeachExpression : public CXFA_FMLoopExpression { +class CXFA_FMForeachExpression : public CXFA_FMExpression { public: // Takes ownership of |pAccessors|. CXFA_FMForeachExpression( |