| 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 "xfa/fxfa/parser/xfa_document_datamerger_imp.h" | 7 #include "xfa/fxfa/parser/xfa_document_datamerger_imp.h" |
| 8 | 8 |
| 9 #include "core/fxcrt/include/fx_ext.h" | 9 #include "core/fxcrt/include/fx_ext.h" |
| 10 #include "xfa/fde/xml/fde_xml_imp.h" | 10 #include "xfa/fde/xml/fde_xml_imp.h" |
| (...skipping 545 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 556 } | 556 } |
| 557 return pNewNode; | 557 return pNewNode; |
| 558 } | 558 } |
| 559 static CXFA_Node* XFA_NodeMerge_CloneOrMergeInstanceManager( | 559 static CXFA_Node* XFA_NodeMerge_CloneOrMergeInstanceManager( |
| 560 CXFA_Document* pDocument, | 560 CXFA_Document* pDocument, |
| 561 CXFA_Node* pFormParent, | 561 CXFA_Node* pFormParent, |
| 562 CXFA_Node* pTemplateNode, | 562 CXFA_Node* pTemplateNode, |
| 563 CXFA_NodeArray& subforms) { | 563 CXFA_NodeArray& subforms) { |
| 564 CFX_WideStringC wsSubformName = pTemplateNode->GetCData(XFA_ATTRIBUTE_Name); | 564 CFX_WideStringC wsSubformName = pTemplateNode->GetCData(XFA_ATTRIBUTE_Name); |
| 565 CFX_WideString wsInstMgrNodeName = FX_WSTRC(L"_") + wsSubformName; | 565 CFX_WideString wsInstMgrNodeName = FX_WSTRC(L"_") + wsSubformName; |
| 566 uint32_t dwInstNameHash = | 566 uint32_t dwInstNameHash = FX_HashCode_String_GetW( |
| 567 FX_HashCode_String_GetW(wsInstMgrNodeName, wsInstMgrNodeName.GetLength()); | 567 wsInstMgrNodeName.c_str(), wsInstMgrNodeName.GetLength()); |
| 568 CXFA_Node* pExistingNode = XFA_DataMerge_FindFormDOMInstance( | 568 CXFA_Node* pExistingNode = XFA_DataMerge_FindFormDOMInstance( |
| 569 pDocument, XFA_ELEMENT_InstanceManager, dwInstNameHash, pFormParent); | 569 pDocument, XFA_ELEMENT_InstanceManager, dwInstNameHash, pFormParent); |
| 570 if (pExistingNode) { | 570 if (pExistingNode) { |
| 571 uint32_t dwNameHash = pTemplateNode->GetNameHash(); | 571 uint32_t dwNameHash = pTemplateNode->GetNameHash(); |
| 572 for (CXFA_Node* pNode = | 572 for (CXFA_Node* pNode = |
| 573 pExistingNode->GetNodeItem(XFA_NODEITEM_NextSibling); | 573 pExistingNode->GetNodeItem(XFA_NODEITEM_NextSibling); |
| 574 pNode;) { | 574 pNode;) { |
| 575 XFA_ELEMENT eCurType = pNode->GetClassID(); | 575 XFA_ELEMENT eCurType = pNode->GetClassID(); |
| 576 if (eCurType == XFA_ELEMENT_InstanceManager) { | 576 if (eCurType == XFA_ELEMENT_InstanceManager) { |
| 577 break; | 577 break; |
| (...skipping 847 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1425 } | 1425 } |
| 1426 pFormRoot->SetObject(XFA_ATTRIBUTE_BindingNode, NULL); | 1426 pFormRoot->SetObject(XFA_ATTRIBUTE_BindingNode, NULL); |
| 1427 } | 1427 } |
| 1428 XFA_DataMerge_ClearGlobalBinding(this); | 1428 XFA_DataMerge_ClearGlobalBinding(this); |
| 1429 if (bDoDataMerge) { | 1429 if (bDoDataMerge) { |
| 1430 DoDataMerge(); | 1430 DoDataMerge(); |
| 1431 } | 1431 } |
| 1432 CXFA_LayoutProcessor* pLayoutProcessor = GetLayoutProcessor(); | 1432 CXFA_LayoutProcessor* pLayoutProcessor = GetLayoutProcessor(); |
| 1433 pLayoutProcessor->SetForceReLayout(TRUE); | 1433 pLayoutProcessor->SetForceReLayout(TRUE); |
| 1434 } | 1434 } |
| OLD | NEW |