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

Side by Side Diff: xfa/fxfa/parser/xfa_document_imp.cpp

Issue 2123133004: Remove IXFA_Parser, cleanup XFA parser code. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Rebase to master Created 4 years, 5 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
OLDNEW
1 // Copyright 2014 PDFium Authors. All rights reserved. 1 // Copyright 2014 PDFium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6 6
7 #include "core/fxcrt/include/fx_ext.h" 7 #include "core/fxcrt/include/fx_ext.h"
8 #include "xfa/fxfa/app/xfa_ffnotify.h" 8 #include "xfa/fxfa/app/xfa_ffnotify.h"
9 #include "xfa/fxfa/parser/xfa_basic_imp.h" 9 #include "xfa/fxfa/parser/xfa_basic_imp.h"
10 #include "xfa/fxfa/parser/xfa_doclayout.h" 10 #include "xfa/fxfa/parser/xfa_doclayout.h"
11 #include "xfa/fxfa/parser/xfa_document.h" 11 #include "xfa/fxfa/parser/xfa_document.h"
12 #include "xfa/fxfa/parser/xfa_document_layout_imp.h" 12 #include "xfa/fxfa/parser/xfa_document_layout_imp.h"
13 #include "xfa/fxfa/parser/xfa_localemgr.h" 13 #include "xfa/fxfa/parser/xfa_localemgr.h"
14 #include "xfa/fxfa/parser/xfa_object.h" 14 #include "xfa/fxfa/parser/xfa_object.h"
15 #include "xfa/fxfa/parser/xfa_parser.h"
16 #include "xfa/fxfa/parser/xfa_parser_imp.h" 15 #include "xfa/fxfa/parser/xfa_parser_imp.h"
17 #include "xfa/fxfa/parser/xfa_script.h" 16 #include "xfa/fxfa/parser/xfa_script.h"
18 #include "xfa/fxfa/parser/xfa_script_datawindow.h" 17 #include "xfa/fxfa/parser/xfa_script_datawindow.h"
19 #include "xfa/fxfa/parser/xfa_script_eventpseudomodel.h" 18 #include "xfa/fxfa/parser/xfa_script_eventpseudomodel.h"
20 #include "xfa/fxfa/parser/xfa_script_hostpseudomodel.h" 19 #include "xfa/fxfa/parser/xfa_script_hostpseudomodel.h"
21 #include "xfa/fxfa/parser/xfa_script_imp.h" 20 #include "xfa/fxfa/parser/xfa_script_imp.h"
22 #include "xfa/fxfa/parser/xfa_script_layoutpseudomodel.h" 21 #include "xfa/fxfa/parser/xfa_script_layoutpseudomodel.h"
23 #include "xfa/fxfa/parser/xfa_script_logpseudomodel.h" 22 #include "xfa/fxfa/parser/xfa_script_logpseudomodel.h"
24 #include "xfa/fxfa/parser/xfa_script_signaturepseudomodel.h" 23 #include "xfa/fxfa/parser/xfa_script_signaturepseudomodel.h"
25 #include "xfa/fxfa/parser/xfa_utils.h" 24 #include "xfa/fxfa/parser/xfa_utils.h"
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 } 66 }
68 67
69 void CXFA_Document::SetRoot(CXFA_Node* pNewRoot) { 68 void CXFA_Document::SetRoot(CXFA_Node* pNewRoot) {
70 if (m_pRootNode) { 69 if (m_pRootNode) {
71 AddPurgeNode(m_pRootNode); 70 AddPurgeNode(m_pRootNode);
72 } 71 }
73 m_pRootNode = pNewRoot; 72 m_pRootNode = pNewRoot;
74 RemovePurgeNode(pNewRoot); 73 RemovePurgeNode(pNewRoot);
75 } 74 }
76 75
76 CFDE_XMLDoc* CXFA_Document::GetXMLDoc() const {
77 return m_pParser->GetXMLDoc();
78 }
79
77 CXFA_FFNotify* CXFA_Document::GetNotify() const { 80 CXFA_FFNotify* CXFA_Document::GetNotify() const {
78 return m_pParser->GetNotify(); 81 return m_pParser->GetNotify();
79 } 82 }
80 83
81 CXFA_Object* CXFA_Document::GetXFAObject(XFA_HashCode dwNodeNameHash) { 84 CXFA_Object* CXFA_Document::GetXFAObject(XFA_HashCode dwNodeNameHash) {
82 switch (dwNodeNameHash) { 85 switch (dwNodeNameHash) {
83 case XFA_HASHCODE_Data: { 86 case XFA_HASHCODE_Data: {
84 CXFA_Node* pDatasetsNode = ToNode(GetXFAObject(XFA_HASHCODE_Datasets)); 87 CXFA_Node* pDatasetsNode = ToNode(GetXFAObject(XFA_HASHCODE_Datasets));
85 if (!pDatasetsNode) { 88 if (!pDatasetsNode) {
86 return nullptr; 89 return nullptr;
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
212 wsInteractive == FX_WSTRC(L"1")) { 215 wsInteractive == FX_WSTRC(L"1")) {
213 m_dwDocFlags |= XFA_DOCFLAG_Interactive; 216 m_dwDocFlags |= XFA_DOCFLAG_Interactive;
214 return TRUE; 217 return TRUE;
215 } 218 }
216 } 219 }
217 return FALSE; 220 return FALSE;
218 } 221 }
219 CXFA_LocaleMgr* CXFA_Document::GetLocalMgr() { 222 CXFA_LocaleMgr* CXFA_Document::GetLocalMgr() {
220 if (!m_pLocalMgr) { 223 if (!m_pLocalMgr) {
221 CFX_WideString wsLanguage; 224 CFX_WideString wsLanguage;
222 GetParser()->GetNotify()->GetAppProvider()->GetLanguage(wsLanguage); 225 GetNotify()->GetAppProvider()->GetLanguage(wsLanguage);
223 m_pLocalMgr = new CXFA_LocaleMgr( 226 m_pLocalMgr = new CXFA_LocaleMgr(
224 ToNode(GetXFAObject(XFA_HASHCODE_LocaleSet)), wsLanguage); 227 ToNode(GetXFAObject(XFA_HASHCODE_LocaleSet)), wsLanguage);
225 } 228 }
226 return m_pLocalMgr; 229 return m_pLocalMgr;
227 } 230 }
228 CXFA_ScriptContext* CXFA_Document::InitScriptContext(v8::Isolate* pIsolate) { 231 CXFA_ScriptContext* CXFA_Document::InitScriptContext(v8::Isolate* pIsolate) {
229 if (!m_pScriptContext) 232 if (!m_pScriptContext)
230 m_pScriptContext = new CXFA_ScriptContext(this); 233 m_pScriptContext = new CXFA_ScriptContext(this);
231 m_pScriptContext->Initialize(pIsolate); 234 m_pScriptContext->Initialize(pIsolate);
232 return m_pScriptContext; 235 return m_pScriptContext;
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after
403 if (!mIDMap.Lookup(FX_HashCode_GetW(wsID, false), pProtoNode)) { 406 if (!mIDMap.Lookup(FX_HashCode_GetW(wsID, false), pProtoNode)) {
404 continue; 407 continue;
405 } 408 }
406 } 409 }
407 if (!pProtoNode) { 410 if (!pProtoNode) {
408 continue; 411 continue;
409 } 412 }
410 XFA_ProtoMerge_MergeNode(this, pUseHrefNode, pProtoNode); 413 XFA_ProtoMerge_MergeNode(this, pUseHrefNode, pProtoNode);
411 } 414 }
412 } 415 }
OLDNEW
« no previous file with comments | « xfa/fxfa/parser/xfa_document_datamerger_imp.cpp ('k') | xfa/fxfa/parser/xfa_document_layout_imp.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698