Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(97)

Side by Side Diff: xfa/src/fxfa/fm2js/xfa_program.cpp

Issue 1803723002: Move xfa/src up to xfa/. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Rebase to master Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « xfa/src/fxfa/fm2js/xfa_program.h ('k') | xfa/src/fxfa/fm2js/xfa_simpleexpression.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2014 PDFium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6
7 #include "xfa/src/fxfa/fm2js/xfa_program.h"
8
9 CXFA_FMProgram::CXFA_FMProgram() : m_globalFunction(0) {}
10 CXFA_FMProgram::~CXFA_FMProgram() {
11 if (m_globalFunction != 0) {
12 delete m_globalFunction;
13 m_globalFunction = 0;
14 }
15 }
16 int32_t CXFA_FMProgram::Init(const CFX_WideStringC& wsFormcalc) {
17 return m_parse.Init(wsFormcalc, &m_pErrorInfo);
18 }
19 int32_t CXFA_FMProgram::ParseProgram() {
20 CFX_PtrArray* expressions = 0;
21 m_parse.NextToken();
22 if (!m_pErrorInfo.message.IsEmpty()) {
23 return -1;
24 }
25 expressions = m_parse.ParseTopExpression();
26 if (!m_pErrorInfo.message.IsEmpty()) {
27 CXFA_FMExpression* e = 0;
28 for (int32_t u = 0; u < expressions->GetSize(); ++u) {
29 e = (CXFA_FMExpression*)expressions->GetAt(u);
30 if (e) {
31 delete e;
32 }
33 }
34 delete expressions;
35 return -1;
36 }
37 m_globalFunction =
38 new CXFA_FMFunctionDefinition(1, 1, FX_WSTRC(L""), 0, expressions);
39 return 0;
40 }
41 int32_t CXFA_FMProgram::TranslateProgram(CFX_WideTextBuf& wsJavaScript) {
42 m_globalFunction->ToJavaScript(wsJavaScript);
43 wsJavaScript.AppendChar(0);
44 return 0;
45 }
OLDNEW
« no previous file with comments | « xfa/src/fxfa/fm2js/xfa_program.h ('k') | xfa/src/fxfa/fm2js/xfa_simpleexpression.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698