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_layout_imp.h" | 15 #include "xfa/fxfa/parser/xfa_document_layout_imp.h" |
16 #include "xfa/fxfa/parser/xfa_localemgr.h" | 16 #include "xfa/fxfa/parser/xfa_localemgr.h" |
17 #include "xfa/fxfa/parser/xfa_object.h" | 17 #include "xfa/fxfa/parser/xfa_object.h" |
18 #include "xfa/fxfa/parser/xfa_parser.h" | |
19 #include "xfa/fxfa/parser/xfa_parser_imp.h" | 18 #include "xfa/fxfa/parser/xfa_parser_imp.h" |
20 #include "xfa/fxfa/parser/xfa_script.h" | 19 #include "xfa/fxfa/parser/xfa_script.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_utils.h" | 21 #include "xfa/fxfa/parser/xfa_utils.h" |
23 | 22 |
24 namespace { | 23 namespace { |
25 | 24 |
26 class CXFA_TraverseStrategy_DDGroup { | 25 class CXFA_TraverseStrategy_DDGroup { |
27 public: | 26 public: |
28 static CXFA_Node* GetFirstChild(CXFA_Node* pDDGroupNode) { | 27 static CXFA_Node* GetFirstChild(CXFA_Node* pDDGroupNode) { |
(...skipping 495 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
524 subforms.Add(pNode); | 523 subforms.Add(pNode); |
525 pNode = pNextNode; | 524 pNode = pNextNode; |
526 } | 525 } |
527 pFormParent->RemoveChild(pExistingNode); | 526 pFormParent->RemoveChild(pExistingNode); |
528 pFormParent->InsertChild(pExistingNode); | 527 pFormParent->InsertChild(pExistingNode); |
529 pExistingNode->ClearFlag(XFA_NodeFlag_UnusedNode); | 528 pExistingNode->ClearFlag(XFA_NodeFlag_UnusedNode); |
530 pExistingNode->SetTemplateNode(pTemplateNode); | 529 pExistingNode->SetTemplateNode(pTemplateNode); |
531 return pExistingNode; | 530 return pExistingNode; |
532 } | 531 } |
533 | 532 |
534 CXFA_Node* pNewNode = pDocument->GetParser()->GetFactory()->CreateNode( | 533 CXFA_Node* pNewNode = |
535 XFA_XDPPACKET_Form, XFA_Element::InstanceManager); | 534 pDocument->CreateNode(XFA_XDPPACKET_Form, XFA_Element::InstanceManager); |
536 ASSERT(pNewNode); | |
537 wsInstMgrNodeName = | 535 wsInstMgrNodeName = |
538 FX_WSTRC(L"_") + pTemplateNode->GetCData(XFA_ATTRIBUTE_Name); | 536 FX_WSTRC(L"_") + pTemplateNode->GetCData(XFA_ATTRIBUTE_Name); |
539 pNewNode->SetCData(XFA_ATTRIBUTE_Name, wsInstMgrNodeName); | 537 pNewNode->SetCData(XFA_ATTRIBUTE_Name, wsInstMgrNodeName); |
540 pFormParent->InsertChild(pNewNode, nullptr); | 538 pFormParent->InsertChild(pNewNode, nullptr); |
541 pNewNode->SetTemplateNode(pTemplateNode); | 539 pNewNode->SetTemplateNode(pTemplateNode); |
542 return pNewNode; | 540 return pNewNode; |
543 } | 541 } |
544 | 542 |
545 CXFA_Node* FindMatchingDataNode( | 543 CXFA_Node* FindMatchingDataNode( |
546 CXFA_Document* pDocument, | 544 CXFA_Document* pDocument, |
(...skipping 975 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1522 pFormRoot->RemoveChild(pNode); | 1520 pFormRoot->RemoveChild(pNode); |
1523 pFormRoot->SetObject(XFA_ATTRIBUTE_BindingNode, nullptr); | 1521 pFormRoot->SetObject(XFA_ATTRIBUTE_BindingNode, nullptr); |
1524 } | 1522 } |
1525 m_rgGlobalBinding.RemoveAll(); | 1523 m_rgGlobalBinding.RemoveAll(); |
1526 if (bDoDataMerge) | 1524 if (bDoDataMerge) |
1527 DoDataMerge(); | 1525 DoDataMerge(); |
1528 | 1526 |
1529 CXFA_LayoutProcessor* pLayoutProcessor = GetLayoutProcessor(); | 1527 CXFA_LayoutProcessor* pLayoutProcessor = GetLayoutProcessor(); |
1530 pLayoutProcessor->SetForceReLayout(TRUE); | 1528 pLayoutProcessor->SetForceReLayout(TRUE); |
1531 } | 1529 } |
OLD | NEW |