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" |
11 #include "xfa/fxfa/parser/cxfa_occur.h" | 11 #include "xfa/fxfa/parser/cxfa_occur.h" |
12 #include "xfa/fxfa/parser/xfa_basic_imp.h" | 12 #include "xfa/fxfa/parser/xfa_basic_imp.h" |
13 #include "xfa/fxfa/parser/xfa_doclayout.h" | 13 #include "xfa/fxfa/parser/xfa_doclayout.h" |
14 #include "xfa/fxfa/parser/xfa_document.h" | 14 #include "xfa/fxfa/parser/xfa_document.h" |
15 #include "xfa/fxfa/parser/xfa_document_datadescription_imp.h" | 15 #include "xfa/fxfa/parser/xfa_document_datadescription_imp.h" |
16 #include "xfa/fxfa/parser/xfa_document_layout_imp.h" | 16 #include "xfa/fxfa/parser/xfa_document_layout_imp.h" |
17 #include "xfa/fxfa/parser/xfa_localemgr.h" | 17 #include "xfa/fxfa/parser/xfa_localemgr.h" |
18 #include "xfa/fxfa/parser/xfa_object.h" | 18 #include "xfa/fxfa/parser/xfa_object.h" |
19 #include "xfa/fxfa/parser/xfa_parser.h" | |
20 #include "xfa/fxfa/parser/xfa_parser_imp.h" | 19 #include "xfa/fxfa/parser/xfa_parser_imp.h" |
21 #include "xfa/fxfa/parser/xfa_script.h" | 20 #include "xfa/fxfa/parser/xfa_script.h" |
22 #include "xfa/fxfa/parser/xfa_script_imp.h" | 21 #include "xfa/fxfa/parser/xfa_script_imp.h" |
23 #include "xfa/fxfa/parser/xfa_utils.h" | 22 #include "xfa/fxfa/parser/xfa_utils.h" |
24 | 23 |
25 static FX_BOOL XFA_GetOccurInfo(CXFA_Node* pOccurNode, | 24 static FX_BOOL XFA_GetOccurInfo(CXFA_Node* pOccurNode, |
26 int32_t& iMin, | 25 int32_t& iMin, |
27 int32_t& iMax, | 26 int32_t& iMax, |
28 int32_t& iInit) { | 27 int32_t& iInit) { |
29 if (!pOccurNode) { | 28 if (!pOccurNode) { |
(...skipping 547 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
577 pFormParent->RemoveChild(pNode); | 576 pFormParent->RemoveChild(pNode); |
578 subforms.Add(pNode); | 577 subforms.Add(pNode); |
579 pNode = pNextNode; | 578 pNode = pNextNode; |
580 } | 579 } |
581 pFormParent->RemoveChild(pExistingNode); | 580 pFormParent->RemoveChild(pExistingNode); |
582 pFormParent->InsertChild(pExistingNode); | 581 pFormParent->InsertChild(pExistingNode); |
583 pExistingNode->ClearFlag(XFA_NodeFlag_UnusedNode); | 582 pExistingNode->ClearFlag(XFA_NodeFlag_UnusedNode); |
584 pExistingNode->SetTemplateNode(pTemplateNode); | 583 pExistingNode->SetTemplateNode(pTemplateNode); |
585 return pExistingNode; | 584 return pExistingNode; |
586 } | 585 } |
587 CXFA_Node* pNewNode = pDocument->GetParser()->GetFactory()->CreateNode( | 586 CXFA_Node* pNewNode = |
588 XFA_XDPPACKET_Form, XFA_Element::InstanceManager); | 587 pDocument->CreateNode(XFA_XDPPACKET_Form, XFA_Element::InstanceManager); |
589 ASSERT(pNewNode); | 588 ASSERT(pNewNode); |
590 wsInstMgrNodeName = | 589 wsInstMgrNodeName = |
591 FX_WSTRC(L"_") + pTemplateNode->GetCData(XFA_ATTRIBUTE_Name); | 590 FX_WSTRC(L"_") + pTemplateNode->GetCData(XFA_ATTRIBUTE_Name); |
592 pNewNode->SetCData(XFA_ATTRIBUTE_Name, wsInstMgrNodeName); | 591 pNewNode->SetCData(XFA_ATTRIBUTE_Name, wsInstMgrNodeName); |
593 pFormParent->InsertChild(pNewNode, nullptr); | 592 pFormParent->InsertChild(pNewNode, nullptr); |
594 pNewNode->SetTemplateNode(pTemplateNode); | 593 pNewNode->SetTemplateNode(pTemplateNode); |
595 return pNewNode; | 594 return pNewNode; |
596 } | 595 } |
597 static CXFA_Node* XFA_DataMerge_FindMatchingDataNode( | 596 static CXFA_Node* XFA_DataMerge_FindMatchingDataNode( |
598 CXFA_Document* pDocument, | 597 CXFA_Document* pDocument, |
(...skipping 804 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1403 } | 1402 } |
1404 pFormRoot->SetObject(XFA_ATTRIBUTE_BindingNode, nullptr); | 1403 pFormRoot->SetObject(XFA_ATTRIBUTE_BindingNode, nullptr); |
1405 } | 1404 } |
1406 XFA_DataMerge_ClearGlobalBinding(this); | 1405 XFA_DataMerge_ClearGlobalBinding(this); |
1407 if (bDoDataMerge) { | 1406 if (bDoDataMerge) { |
1408 DoDataMerge(); | 1407 DoDataMerge(); |
1409 } | 1408 } |
1410 CXFA_LayoutProcessor* pLayoutProcessor = GetLayoutProcessor(); | 1409 CXFA_LayoutProcessor* pLayoutProcessor = GetLayoutProcessor(); |
1411 pLayoutProcessor->SetForceReLayout(TRUE); | 1410 pLayoutProcessor->SetForceReLayout(TRUE); |
1412 } | 1411 } |
OLD | NEW |