From 1770c021cf998ff1b33855b1397f6ea8ff9f7cd7 Mon Sep 17 00:00:00 2001 From: Dan Sinclair Date: Mon, 14 Mar 2016 14:14:16 -0400 Subject: Move xfa/src up to xfa/. This CL moves the xfa/src files up to the xfa/ directory and fixes the includes, include guards, and build files. R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1803723002 . --- xfa/fxfa/fm2js/xfa_program.cpp | 45 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 xfa/fxfa/fm2js/xfa_program.cpp (limited to 'xfa/fxfa/fm2js/xfa_program.cpp') diff --git a/xfa/fxfa/fm2js/xfa_program.cpp b/xfa/fxfa/fm2js/xfa_program.cpp new file mode 100644 index 0000000000..ef5efb214c --- /dev/null +++ b/xfa/fxfa/fm2js/xfa_program.cpp @@ -0,0 +1,45 @@ +// Copyright 2014 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#include "xfa/fxfa/fm2js/xfa_program.h" + +CXFA_FMProgram::CXFA_FMProgram() : m_globalFunction(0) {} +CXFA_FMProgram::~CXFA_FMProgram() { + if (m_globalFunction != 0) { + delete m_globalFunction; + m_globalFunction = 0; + } +} +int32_t CXFA_FMProgram::Init(const CFX_WideStringC& wsFormcalc) { + return m_parse.Init(wsFormcalc, &m_pErrorInfo); +} +int32_t CXFA_FMProgram::ParseProgram() { + CFX_PtrArray* expressions = 0; + m_parse.NextToken(); + if (!m_pErrorInfo.message.IsEmpty()) { + return -1; + } + expressions = m_parse.ParseTopExpression(); + if (!m_pErrorInfo.message.IsEmpty()) { + CXFA_FMExpression* e = 0; + for (int32_t u = 0; u < expressions->GetSize(); ++u) { + e = (CXFA_FMExpression*)expressions->GetAt(u); + if (e) { + delete e; + } + } + delete expressions; + return -1; + } + m_globalFunction = + new CXFA_FMFunctionDefinition(1, 1, FX_WSTRC(L""), 0, expressions); + return 0; +} +int32_t CXFA_FMProgram::TranslateProgram(CFX_WideTextBuf& wsJavaScript) { + m_globalFunction->ToJavaScript(wsJavaScript); + wsJavaScript.AppendChar(0); + return 0; +} -- cgit v1.2.3