diff options
author | dan sinclair <dsinclair@chromium.org> | 2018-02-19 18:10:34 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-02-19 18:10:34 +0000 |
commit | 6a5b1c96e23bd684d9fec2c59e0d4bc5d883650c (patch) | |
tree | b6ba4042b3e6ad51d240b69e3cec78891e3b583c /xfa/fxfa/fm2js/cxfa_fmexpression.h | |
parent | c8785f736df57d7d20649d803818a30eb55b2ee8 (diff) | |
download | pdfium-6a5b1c96e23bd684d9fec2c59e0d4bc5d883650c.tar.xz |
Merge FormCalc to JavaScript methods
This CL merges the ToJavaScript and the ToImpliedJS methods in the
FormCalc expressions. The type of return is passed as a paramter to
ToJavaScript.
Change-Id: Idff83677bc70b964d95aa6ff6b0e2c1bf8c603ea
Reviewed-on: https://pdfium-review.googlesource.com/27210
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 | 42 |
1 files changed, 16 insertions, 26 deletions
diff --git a/xfa/fxfa/fm2js/cxfa_fmexpression.h b/xfa/fxfa/fm2js/cxfa_fmexpression.h index cfbba3af22..104b8976a5 100644 --- a/xfa/fxfa/fm2js/cxfa_fmexpression.h +++ b/xfa/fxfa/fm2js/cxfa_fmexpression.h @@ -31,8 +31,7 @@ class CXFA_FMExpression { CXFA_FMExpression(uint32_t line, XFA_FM_EXPTYPE type); virtual ~CXFA_FMExpression() {} - virtual bool ToJavaScript(CFX_WideTextBuf& javascript); - virtual bool ToImpliedReturnJS(CFX_WideTextBuf&); + virtual bool ToJavaScript(CFX_WideTextBuf& javascript, ReturnType type); uint32_t GetLine() { return m_line; } XFA_FM_EXPTYPE GetExpType() const { return m_type; } @@ -52,8 +51,7 @@ class CXFA_FMFunctionDefinition : public CXFA_FMExpression { std::vector<std::unique_ptr<CXFA_FMExpression>>&& expressions); ~CXFA_FMFunctionDefinition() override; - bool ToJavaScript(CFX_WideTextBuf& javascript) override; - bool ToImpliedReturnJS(CFX_WideTextBuf&) override; + bool ToJavaScript(CFX_WideTextBuf& javascript, ReturnType type) override; private: WideStringView m_wsName; @@ -69,8 +67,7 @@ class CXFA_FMVarExpression : public CXFA_FMExpression { std::unique_ptr<CXFA_FMExpression> pInit); ~CXFA_FMVarExpression() override; - bool ToJavaScript(CFX_WideTextBuf& javascript) override; - bool ToImpliedReturnJS(CFX_WideTextBuf&) override; + bool ToJavaScript(CFX_WideTextBuf& javascript, ReturnType type) override; private: WideStringView m_wsName; @@ -83,8 +80,7 @@ class CXFA_FMExpExpression : public CXFA_FMExpression { std::unique_ptr<CXFA_FMSimpleExpression> pExpression); ~CXFA_FMExpExpression() override; - bool ToJavaScript(CFX_WideTextBuf& javascript) override; - bool ToImpliedReturnJS(CFX_WideTextBuf&) override; + bool ToJavaScript(CFX_WideTextBuf& javascript, ReturnType type) override; private: std::unique_ptr<CXFA_FMSimpleExpression> m_pExpression; @@ -97,8 +93,7 @@ class CXFA_FMBlockExpression : public CXFA_FMExpression { std::vector<std::unique_ptr<CXFA_FMExpression>>&& pExpressionList); ~CXFA_FMBlockExpression() override; - bool ToJavaScript(CFX_WideTextBuf& javascript) override; - bool ToImpliedReturnJS(CFX_WideTextBuf&) override; + bool ToJavaScript(CFX_WideTextBuf& javascript, ReturnType type) override; private: std::vector<std::unique_ptr<CXFA_FMExpression>> m_ExpressionList; @@ -109,8 +104,7 @@ class CXFA_FMDoExpression : public CXFA_FMExpression { CXFA_FMDoExpression(uint32_t line, std::unique_ptr<CXFA_FMExpression> pList); ~CXFA_FMDoExpression() override; - bool ToJavaScript(CFX_WideTextBuf& javascript) override; - bool ToImpliedReturnJS(CFX_WideTextBuf&) override; + bool ToJavaScript(CFX_WideTextBuf& javascript, ReturnType type) override; private: std::unique_ptr<CXFA_FMExpression> m_pList; @@ -124,8 +118,7 @@ class CXFA_FMIfExpression : public CXFA_FMExpression { std::unique_ptr<CXFA_FMExpression> pElseExpression); ~CXFA_FMIfExpression() override; - bool ToJavaScript(CFX_WideTextBuf& javascript) override; - bool ToImpliedReturnJS(CFX_WideTextBuf&) override; + bool ToJavaScript(CFX_WideTextBuf& javascript, ReturnType type) override; private: std::unique_ptr<CXFA_FMSimpleExpression> m_pExpression; @@ -137,8 +130,8 @@ class CXFA_FMLoopExpression : public CXFA_FMExpression { public: explicit CXFA_FMLoopExpression(uint32_t line) : CXFA_FMExpression(line) {} ~CXFA_FMLoopExpression() override; - bool ToJavaScript(CFX_WideTextBuf& javascript) override; - bool ToImpliedReturnJS(CFX_WideTextBuf&) override; + + bool ToJavaScript(CFX_WideTextBuf& javascript, ReturnType type) override; }; class CXFA_FMWhileExpression : public CXFA_FMLoopExpression { @@ -148,8 +141,7 @@ class CXFA_FMWhileExpression : public CXFA_FMLoopExpression { std::unique_ptr<CXFA_FMExpression> pExpression); ~CXFA_FMWhileExpression() override; - bool ToJavaScript(CFX_WideTextBuf& javascript) override; - bool ToImpliedReturnJS(CFX_WideTextBuf&) override; + bool ToJavaScript(CFX_WideTextBuf& javascript, ReturnType type) override; private: std::unique_ptr<CXFA_FMSimpleExpression> m_pCondition; @@ -160,16 +152,16 @@ class CXFA_FMBreakExpression : public CXFA_FMExpression { public: explicit CXFA_FMBreakExpression(uint32_t line); ~CXFA_FMBreakExpression() override; - bool ToJavaScript(CFX_WideTextBuf& javascript) override; - bool ToImpliedReturnJS(CFX_WideTextBuf&) override; + + bool ToJavaScript(CFX_WideTextBuf& javascript, ReturnType type) override; }; class CXFA_FMContinueExpression : public CXFA_FMExpression { public: explicit CXFA_FMContinueExpression(uint32_t line); ~CXFA_FMContinueExpression() override; - bool ToJavaScript(CFX_WideTextBuf& javascript) override; - bool ToImpliedReturnJS(CFX_WideTextBuf&) override; + + bool ToJavaScript(CFX_WideTextBuf& javascript, ReturnType type) override; }; class CXFA_FMForExpression : public CXFA_FMLoopExpression { @@ -183,8 +175,7 @@ class CXFA_FMForExpression : public CXFA_FMLoopExpression { std::unique_ptr<CXFA_FMExpression> pList); ~CXFA_FMForExpression() override; - bool ToJavaScript(CFX_WideTextBuf& javascript) override; - bool ToImpliedReturnJS(CFX_WideTextBuf&) override; + bool ToJavaScript(CFX_WideTextBuf& javascript, ReturnType type) override; private: WideStringView m_wsVariant; @@ -205,8 +196,7 @@ class CXFA_FMForeachExpression : public CXFA_FMLoopExpression { std::unique_ptr<CXFA_FMExpression> pList); ~CXFA_FMForeachExpression() override; - bool ToJavaScript(CFX_WideTextBuf& javascript) override; - bool ToImpliedReturnJS(CFX_WideTextBuf&) override; + bool ToJavaScript(CFX_WideTextBuf& javascript, ReturnType type) override; private: WideStringView m_wsIdentifier; |