From 96a302c19be8e872df035f5c9e6f83ac76414dbb Mon Sep 17 00:00:00 2001 From: Dan Sinclair Date: Tue, 20 Feb 2018 22:06:59 +0000 Subject: [formcalc] Remove unused expression type The expression type is no longer used, removed. Change-Id: I4c8b17ed1644560afd7fc87a7fb6c7d893b9de5c Reviewed-on: https://pdfium-review.googlesource.com/27450 Reviewed-by: Lei Zhang Reviewed-by: Ryan Harrison Commit-Queue: dsinclair --- xfa/fxfa/fm2js/cxfa_fmexpression.cpp | 24 ++++++++---------------- xfa/fxfa/fm2js/cxfa_fmexpression.h | 17 ----------------- 2 files changed, 8 insertions(+), 33 deletions(-) (limited to 'xfa/fxfa/fm2js') diff --git a/xfa/fxfa/fm2js/cxfa_fmexpression.cpp b/xfa/fxfa/fm2js/cxfa_fmexpression.cpp index 481b76c868..30c0639758 100644 --- a/xfa/fxfa/fm2js/cxfa_fmexpression.cpp +++ b/xfa/fxfa/fm2js/cxfa_fmexpression.cpp @@ -21,16 +21,14 @@ const wchar_t kMinusEqual[] = L" -= "; } // namespace -CXFA_FMExpression::CXFA_FMExpression() : m_type(XFA_FM_EXPTYPE_UNKNOWN) {} - -CXFA_FMExpression::CXFA_FMExpression(XFA_FM_EXPTYPE type) : m_type(type) {} +CXFA_FMExpression::CXFA_FMExpression() = default; CXFA_FMFunctionDefinition::CXFA_FMFunctionDefinition( bool isGlobal, const WideStringView& wsName, std::vector&& arguments, std::vector>&& expressions) - : CXFA_FMExpression(XFA_FM_EXPTYPE_FUNC), + : CXFA_FMExpression(), m_wsName(wsName), m_pArguments(std::move(arguments)), m_pExpressions(std::move(expressions)), @@ -103,9 +101,7 @@ bool CXFA_FMFunctionDefinition::ToJavaScript(CFX_WideTextBuf& js, CXFA_FMVarExpression::CXFA_FMVarExpression( const WideStringView& wsName, std::unique_ptr pInit) - : CXFA_FMExpression(XFA_FM_EXPTYPE_VAR), - m_wsName(wsName), - m_pInit(std::move(pInit)) {} + : CXFA_FMExpression(), m_wsName(wsName), m_pInit(std::move(pInit)) {} CXFA_FMVarExpression::~CXFA_FMVarExpression() {} @@ -136,8 +132,7 @@ bool CXFA_FMVarExpression::ToJavaScript(CFX_WideTextBuf& js, ReturnType type) { CXFA_FMExpExpression::CXFA_FMExpExpression( std::unique_ptr pExpression) - : CXFA_FMExpression(XFA_FM_EXPTYPE_EXP), - m_pExpression(std::move(pExpression)) {} + : CXFA_FMExpression(), m_pExpression(std::move(pExpression)) {} CXFA_FMExpExpression::~CXFA_FMExpExpression() {} @@ -180,8 +175,7 @@ bool CXFA_FMExpExpression::ToJavaScript(CFX_WideTextBuf& js, ReturnType type) { CXFA_FMBlockExpression::CXFA_FMBlockExpression( std::vector>&& pExpressionList) - : CXFA_FMExpression(XFA_FM_EXPTYPE_BLOCK), - m_ExpressionList(std::move(pExpressionList)) {} + : CXFA_FMExpression(), m_ExpressionList(std::move(pExpressionList)) {} CXFA_FMBlockExpression::~CXFA_FMBlockExpression() {} @@ -227,7 +221,7 @@ CXFA_FMIfExpression::CXFA_FMIfExpression( std::unique_ptr pExpression, std::unique_ptr pIfExpression, std::unique_ptr pElseExpression) - : CXFA_FMExpression(XFA_FM_EXPTYPE_IF), + : CXFA_FMExpression(), m_pExpression(std::move(pExpression)), m_pIfExpression(std::move(pIfExpression)), m_pElseExpression(std::move(pElseExpression)) {} @@ -303,8 +297,7 @@ bool CXFA_FMWhileExpression::ToJavaScript(CFX_WideTextBuf& js, return !CXFA_IsTooBig(js); } -CXFA_FMBreakExpression::CXFA_FMBreakExpression() - : CXFA_FMExpression(XFA_FM_EXPTYPE_BREAK) {} +CXFA_FMBreakExpression::CXFA_FMBreakExpression() : CXFA_FMExpression() {} CXFA_FMBreakExpression::~CXFA_FMBreakExpression() {} @@ -318,8 +311,7 @@ bool CXFA_FMBreakExpression::ToJavaScript(CFX_WideTextBuf& js, return !CXFA_IsTooBig(js); } -CXFA_FMContinueExpression::CXFA_FMContinueExpression() - : CXFA_FMExpression(XFA_FM_EXPTYPE_CONTINUE) {} +CXFA_FMContinueExpression::CXFA_FMContinueExpression() : CXFA_FMExpression() {} CXFA_FMContinueExpression::~CXFA_FMContinueExpression() {} diff --git a/xfa/fxfa/fm2js/cxfa_fmexpression.h b/xfa/fxfa/fm2js/cxfa_fmexpression.h index 3b2fb4731d..88f2d6e4ed 100644 --- a/xfa/fxfa/fm2js/cxfa_fmexpression.h +++ b/xfa/fxfa/fm2js/cxfa_fmexpression.h @@ -12,17 +12,6 @@ #include "xfa/fxfa/fm2js/cxfa_fmsimpleexpression.h" -enum XFA_FM_EXPTYPE { - XFA_FM_EXPTYPE_UNKNOWN, - XFA_FM_EXPTYPE_FUNC, - XFA_FM_EXPTYPE_VAR, - XFA_FM_EXPTYPE_EXP, - XFA_FM_EXPTYPE_BLOCK, - XFA_FM_EXPTYPE_IF, - XFA_FM_EXPTYPE_BREAK, - XFA_FM_EXPTYPE_CONTINUE, -}; - class CFX_WideTextBuf; class CXFA_FMExpression { @@ -30,14 +19,8 @@ class CXFA_FMExpression { virtual ~CXFA_FMExpression() {} virtual bool ToJavaScript(CFX_WideTextBuf& javascript, ReturnType type) = 0; - XFA_FM_EXPTYPE GetExpType() const { return m_type; } - protected: CXFA_FMExpression(); - explicit CXFA_FMExpression(XFA_FM_EXPTYPE type); - - private: - XFA_FM_EXPTYPE m_type; }; class CXFA_FMFunctionDefinition : public CXFA_FMExpression { -- cgit v1.2.3