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 |
80 CXFA_FFNotify* CXFA_Document::GetNotify() const { | 86 CXFA_FFNotify* CXFA_Document::GetNotify() const { |
81 return m_pParser->GetNotify(); | 87 return m_pParser->GetNotify(); |
82 } | 88 } |
83 CXFA_Object* CXFA_Document::GetXFAObject(const CFX_WideStringC& wsNodeName) { | 89 CXFA_Object* CXFA_Document::GetXFAObject(const CFX_WideStringC& wsNodeName) { |
84 return GetXFAObject(FX_HashCode_GetW(wsNodeName, false)); | 90 return GetXFAObject(FX_HashCode_GetW(wsNodeName, false)); |
85 } | 91 } |
86 CXFA_Object* CXFA_Document::GetXFAObject(uint32_t dwNodeNameHash) { | 92 CXFA_Object* CXFA_Document::GetXFAObject(uint32_t dwNodeNameHash) { |
87 switch (dwNodeNameHash) { | 93 switch (dwNodeNameHash) { |
88 case XFA_HASHCODE_Data: { | 94 case XFA_HASHCODE_Data: { |
89 CXFA_Node* pDatasetsNode = ToNode(GetXFAObject(XFA_HASHCODE_Datasets)); | 95 CXFA_Node* pDatasetsNode = ToNode(GetXFAObject(XFA_HASHCODE_Datasets)); |
(...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
412 if (!mIDMap.Lookup(FX_HashCode_GetW(wsID, false), pProtoNode)) { | 418 if (!mIDMap.Lookup(FX_HashCode_GetW(wsID, false), pProtoNode)) { |
413 continue; | 419 continue; |
414 } | 420 } |
415 } | 421 } |
416 if (!pProtoNode) { | 422 if (!pProtoNode) { |
417 continue; | 423 continue; |
418 } | 424 } |
419 XFA_ProtoMerge_MergeNode(this, pUseHrefNode, pProtoNode); | 425 XFA_ProtoMerge_MergeNode(this, pUseHrefNode, pProtoNode); |
420 } | 426 } |
421 } | 427 } |
OLD | NEW |