Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(93)

Side by Side Diff: xfa/fxfa/parser/xfa_document_datadescription_imp.cpp

Issue 2093663002: Cleanup some variable namings. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: fix headers Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « xfa/fxfa/parser/cxfa_widgetdata.cpp ('k') | xfa/fxfa/parser/xfa_document_datamerger_imp.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_doclayout.h" 7 #include "xfa/fxfa/parser/xfa_doclayout.h"
8 #include "xfa/fxfa/parser/xfa_document.h" 8 #include "xfa/fxfa/parser/xfa_document.h"
9 #include "xfa/fxfa/parser/xfa_localemgr.h" 9 #include "xfa/fxfa/parser/xfa_localemgr.h"
10 #include "xfa/fxfa/parser/xfa_object.h" 10 #include "xfa/fxfa/parser/xfa_object.h"
(...skipping 13 matching lines...) Expand all
24 return pDDGroupNode->GetNodeItem(XFA_NODEITEM_Parent); 24 return pDDGroupNode->GetNodeItem(XFA_NODEITEM_Parent);
25 } 25 }
26 }; 26 };
27 void XFA_DataDescription_UpdateDataRelation(CXFA_Node* pDataNode, 27 void XFA_DataDescription_UpdateDataRelation(CXFA_Node* pDataNode,
28 CXFA_Node* pDataDescriptionNode) { 28 CXFA_Node* pDataDescriptionNode) {
29 ASSERT(pDataDescriptionNode); 29 ASSERT(pDataDescriptionNode);
30 for (CXFA_Node* pDataChild = pDataNode->GetNodeItem(XFA_NODEITEM_FirstChild); 30 for (CXFA_Node* pDataChild = pDataNode->GetNodeItem(XFA_NODEITEM_FirstChild);
31 pDataChild; 31 pDataChild;
32 pDataChild = pDataChild->GetNodeItem(XFA_NODEITEM_NextSibling)) { 32 pDataChild = pDataChild->GetNodeItem(XFA_NODEITEM_NextSibling)) {
33 uint32_t dwNameHash = pDataChild->GetNameHash(); 33 uint32_t dwNameHash = pDataChild->GetNameHash();
34 XFA_Element eType = pDataChild->GetElementType(); 34 if (!dwNameHash)
35 if (!dwNameHash) {
36 continue; 35 continue;
37 } 36
38 CXFA_NodeIteratorTemplate<CXFA_Node, CXFA_TraverseStrategy_DDGroup> 37 CXFA_NodeIteratorTemplate<CXFA_Node, CXFA_TraverseStrategy_DDGroup>
39 sIterator(pDataDescriptionNode); 38 sIterator(pDataDescriptionNode);
40 for (CXFA_Node* pDDGroupNode = sIterator.GetCurrent(); pDDGroupNode; 39 for (CXFA_Node* pDDGroupNode = sIterator.GetCurrent(); pDDGroupNode;
41 pDDGroupNode = sIterator.MoveToNext()) { 40 pDDGroupNode = sIterator.MoveToNext()) {
42 if (pDDGroupNode != pDataDescriptionNode) { 41 if (pDDGroupNode != pDataDescriptionNode) {
43 if (pDDGroupNode->GetElementType() != XFA_Element::DataGroup) { 42 if (pDDGroupNode->GetElementType() != XFA_Element::DataGroup)
44 continue; 43 continue;
45 } 44
46 CFX_WideString wsNamespace; 45 CFX_WideString wsNamespace;
47 if (!pDDGroupNode->TryNamespace(wsNamespace) || 46 if (!pDDGroupNode->TryNamespace(wsNamespace) ||
48 wsNamespace != FX_WSTRC(L"http://ns.adobe.com/data-description/")) { 47 wsNamespace != FX_WSTRC(L"http://ns.adobe.com/data-description/")) {
49 continue; 48 continue;
50 } 49 }
51 } 50 }
52 CXFA_Node* pDDNode = pDDGroupNode->GetFirstChildByName(dwNameHash); 51 CXFA_Node* pDDNode = pDDGroupNode->GetFirstChildByName(dwNameHash);
53 if (!pDDNode) { 52 if (!pDDNode)
54 continue; 53 continue;
55 } 54 if (pDDNode->GetElementType() != pDataChild->GetElementType())
56 if (pDDNode->GetElementType() != eType) {
57 break; 55 break;
58 } 56
59 pDataChild->SetDataDescriptionNode(pDDNode); 57 pDataChild->SetDataDescriptionNode(pDDNode);
60 XFA_DataDescription_UpdateDataRelation(pDataChild, pDDNode); 58 XFA_DataDescription_UpdateDataRelation(pDataChild, pDDNode);
61 break; 59 break;
62 } 60 }
63 } 61 }
64 } 62 }
65 CXFA_Node* XFA_DataDescription_MaybeCreateDataNode( 63 CXFA_Node* XFA_DataDescription_MaybeCreateDataNode(
66 CXFA_Document* pDocument, 64 CXFA_Document* pDocument,
67 CXFA_Node* pDataParent, 65 CXFA_Node* pDataParent,
68 XFA_Element eNodeType, 66 XFA_Element eNodeType,
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 pDataNode->SetEnum(XFA_ATTRIBUTE_Contains, XFA_ATTRIBUTEENUM_MetaData); 112 pDataNode->SetEnum(XFA_ATTRIBUTE_Contains, XFA_ATTRIBUTEENUM_MetaData);
115 } 113 }
116 pDataParent->InsertChild(pDataNode); 114 pDataParent->InsertChild(pDataNode);
117 pDataNode->SetDataDescriptionNode(pDDNode); 115 pDataNode->SetDataDescriptionNode(pDDNode);
118 pDataNode->SetFlag(XFA_NodeFlag_Initialized, false); 116 pDataNode->SetFlag(XFA_NodeFlag_Initialized, false);
119 return pDataNode; 117 return pDataNode;
120 } 118 }
121 return NULL; 119 return NULL;
122 } 120 }
123 } 121 }
OLDNEW
« no previous file with comments | « xfa/fxfa/parser/cxfa_widgetdata.cpp ('k') | xfa/fxfa/parser/xfa_document_datamerger_imp.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698