OLD | NEW |
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/fm2js/xfa_fm2jsapi.h" | 9 #include "xfa/fxfa/fm2js/xfa_fm2jsapi.h" |
10 #include "xfa/fxfa/parser/xfa_basic_imp.h" | 10 #include "xfa/fxfa/parser/xfa_basic_imp.h" |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 m_pScriptSignature = nullptr; | 70 m_pScriptSignature = nullptr; |
71 } | 71 } |
72 | 72 |
73 void CXFA_Document::SetRoot(CXFA_Node* pNewRoot) { | 73 void CXFA_Document::SetRoot(CXFA_Node* pNewRoot) { |
74 if (m_pRootNode) { | 74 if (m_pRootNode) { |
75 AddPurgeNode(m_pRootNode); | 75 AddPurgeNode(m_pRootNode); |
76 } | 76 } |
77 m_pRootNode = pNewRoot; | 77 m_pRootNode = pNewRoot; |
78 RemovePurgeNode(pNewRoot); | 78 RemovePurgeNode(pNewRoot); |
79 } | 79 } |
80 | |
81 void CXFA_Document::DestroyParser() { | |
82 delete m_pParser; | |
83 m_pParser = nullptr; | |
84 } | |
85 | |
86 CXFA_FFNotify* CXFA_Document::GetNotify() const { | 80 CXFA_FFNotify* CXFA_Document::GetNotify() const { |
87 return m_pParser->GetNotify(); | 81 return m_pParser->GetNotify(); |
88 } | 82 } |
89 CXFA_Object* CXFA_Document::GetXFAObject(const CFX_WideStringC& wsNodeName) { | 83 CXFA_Object* CXFA_Document::GetXFAObject(const CFX_WideStringC& wsNodeName) { |
90 return GetXFAObject(FX_HashCode_GetW(wsNodeName, false)); | 84 return GetXFAObject(FX_HashCode_GetW(wsNodeName, false)); |
91 } | 85 } |
92 CXFA_Object* CXFA_Document::GetXFAObject(uint32_t dwNodeNameHash) { | 86 CXFA_Object* CXFA_Document::GetXFAObject(uint32_t dwNodeNameHash) { |
93 switch (dwNodeNameHash) { | 87 switch (dwNodeNameHash) { |
94 case XFA_HASHCODE_Data: { | 88 case XFA_HASHCODE_Data: { |
95 CXFA_Node* pDatasetsNode = ToNode(GetXFAObject(XFA_HASHCODE_Datasets)); | 89 CXFA_Node* pDatasetsNode = ToNode(GetXFAObject(XFA_HASHCODE_Datasets)); |
(...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
418 if (!mIDMap.Lookup(FX_HashCode_GetW(wsID, false), pProtoNode)) { | 412 if (!mIDMap.Lookup(FX_HashCode_GetW(wsID, false), pProtoNode)) { |
419 continue; | 413 continue; |
420 } | 414 } |
421 } | 415 } |
422 if (!pProtoNode) { | 416 if (!pProtoNode) { |
423 continue; | 417 continue; |
424 } | 418 } |
425 XFA_ProtoMerge_MergeNode(this, pUseHrefNode, pProtoNode); | 419 XFA_ProtoMerge_MergeNode(this, pUseHrefNode, pProtoNode); |
426 } | 420 } |
427 } | 421 } |
OLD | NEW |