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/parser/xfa_basic_imp.h" | 9 #include "xfa/fxfa/parser/xfa_basic_imp.h" |
10 #include "xfa/fxfa/parser/xfa_doclayout.h" | 10 #include "xfa/fxfa/parser/xfa_doclayout.h" |
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
283 return NULL; | 283 return NULL; |
284 } | 284 } |
285 static void XFA_ProtoMerge_MergeNodeRecurse(CXFA_Document* pDocument, | 285 static void XFA_ProtoMerge_MergeNodeRecurse(CXFA_Document* pDocument, |
286 CXFA_Node* pDestNodeParent, | 286 CXFA_Node* pDestNodeParent, |
287 CXFA_Node* pProtoNode) { | 287 CXFA_Node* pProtoNode) { |
288 CXFA_Node* pExistingNode = NULL; | 288 CXFA_Node* pExistingNode = NULL; |
289 for (CXFA_Node* pFormChild = | 289 for (CXFA_Node* pFormChild = |
290 pDestNodeParent->GetNodeItem(XFA_NODEITEM_FirstChild); | 290 pDestNodeParent->GetNodeItem(XFA_NODEITEM_FirstChild); |
291 pFormChild; | 291 pFormChild; |
292 pFormChild = pFormChild->GetNodeItem(XFA_NODEITEM_NextSibling)) { | 292 pFormChild = pFormChild->GetNodeItem(XFA_NODEITEM_NextSibling)) { |
293 if (pFormChild->GetClassID() == pProtoNode->GetClassID() && | 293 if (pFormChild->GetElementType() == pProtoNode->GetElementType() && |
294 pFormChild->GetNameHash() == pProtoNode->GetNameHash() && | 294 pFormChild->GetNameHash() == pProtoNode->GetNameHash() && |
295 pFormChild->IsUnusedNode()) { | 295 pFormChild->IsUnusedNode()) { |
296 pFormChild->ClearFlag(XFA_NodeFlag_UnusedNode); | 296 pFormChild->ClearFlag(XFA_NodeFlag_UnusedNode); |
297 pExistingNode = pFormChild; | 297 pExistingNode = pFormChild; |
298 break; | 298 break; |
299 } | 299 } |
300 } | 300 } |
301 if (pExistingNode) { | 301 if (pExistingNode) { |
302 pExistingNode->SetTemplateNode(pProtoNode); | 302 pExistingNode->SetTemplateNode(pProtoNode); |
303 for (CXFA_Node* pTemplateChild = | 303 for (CXFA_Node* pTemplateChild = |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
407 if (!mIDMap.Lookup(FX_HashCode_GetW(wsID, false), pProtoNode)) { | 407 if (!mIDMap.Lookup(FX_HashCode_GetW(wsID, false), pProtoNode)) { |
408 continue; | 408 continue; |
409 } | 409 } |
410 } | 410 } |
411 if (!pProtoNode) { | 411 if (!pProtoNode) { |
412 continue; | 412 continue; |
413 } | 413 } |
414 XFA_ProtoMerge_MergeNode(this, pUseHrefNode, pProtoNode); | 414 XFA_ProtoMerge_MergeNode(this, pUseHrefNode, pProtoNode); |
415 } | 415 } |
416 } | 416 } |
OLD | NEW |