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

Side by Side Diff: xfa/fxfa/parser/xfa_utils.h

Issue 1998873002: Clean up XFA code which causes warnings (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: address comments Created 4 years, 7 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/xfa_parser_imp.cpp ('k') | xfa/fxfa/parser/xfa_utils_imp.cpp » ('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 #ifndef XFA_FXFA_PARSER_XFA_UTILS_H_ 7 #ifndef XFA_FXFA_PARSER_XFA_UTILS_H_
8 #define XFA_FXFA_PARSER_XFA_UTILS_H_ 8 #define XFA_FXFA_PARSER_XFA_UTILS_H_
9 9
10 #include "xfa/fde/xml/fde_xml.h" 10 #include "xfa/fde/xml/fde_xml.h"
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 m_NodeStack.Push(pChildItem); 113 m_NodeStack.Push(pChildItem);
114 } 114 }
115 return *m_NodeStack.GetTopElement(); 115 return *m_NodeStack.GetTopElement();
116 } 116 }
117 return NULL; 117 return NULL;
118 } 118 }
119 NodeType* MoveToNext() { 119 NodeType* MoveToNext() {
120 NodeType** ppNode = NULL; 120 NodeType** ppNode = NULL;
121 NodeType* pCurrent = GetCurrent(); 121 NodeType* pCurrent = GetCurrent();
122 while (m_NodeStack.GetSize() > 0) { 122 while (m_NodeStack.GetSize() > 0) {
123 while ((ppNode = m_NodeStack.GetTopElement())) { 123 while ((ppNode = m_NodeStack.GetTopElement()) != nullptr) {
124 if (pCurrent != *ppNode) { 124 if (pCurrent != *ppNode) {
125 return *ppNode; 125 return *ppNode;
126 } 126 }
127 NodeType* pChild = TraverseStrategy::GetFirstChild(*ppNode); 127 NodeType* pChild = TraverseStrategy::GetFirstChild(*ppNode);
128 if (pChild == NULL) { 128 if (pChild == NULL) {
129 break; 129 break;
130 } 130 }
131 m_NodeStack.Push(pChild); 131 m_NodeStack.Push(pChild);
132 } 132 }
133 while ((ppNode = m_NodeStack.GetTopElement())) { 133 while ((ppNode = m_NodeStack.GetTopElement()) != nullptr) {
134 NodeType* pNext = TraverseStrategy::GetNextSibling(*ppNode); 134 NodeType* pNext = TraverseStrategy::GetNextSibling(*ppNode);
135 m_NodeStack.Pop(); 135 m_NodeStack.Pop();
136 if (m_NodeStack.GetSize() == 0) { 136 if (m_NodeStack.GetSize() == 0) {
137 break; 137 break;
138 } 138 }
139 if (pNext) { 139 if (pNext) {
140 m_NodeStack.Push(pNext); 140 m_NodeStack.Push(pNext);
141 break; 141 break;
142 } 142 }
143 } 143 }
144 } 144 }
145 return NULL; 145 return NULL;
146 } 146 }
147 NodeType* SkipChildrenAndMoveToNext() { 147 NodeType* SkipChildrenAndMoveToNext() {
148 NodeType** ppNode = NULL; 148 NodeType** ppNode = nullptr;
149 while ((ppNode = m_NodeStack.GetTopElement())) { 149 while ((ppNode = m_NodeStack.GetTopElement()) != nullptr) {
150 NodeType* pNext = TraverseStrategy::GetNextSibling(*ppNode); 150 NodeType* pNext = TraverseStrategy::GetNextSibling(*ppNode);
151 m_NodeStack.Pop(); 151 m_NodeStack.Pop();
152 if (m_NodeStack.GetSize() == 0) { 152 if (m_NodeStack.GetSize() == 0) {
153 break; 153 break;
154 } 154 }
155 if (pNext) { 155 if (pNext) {
156 m_NodeStack.Push(pNext); 156 m_NodeStack.Push(pNext);
157 break; 157 break;
158 } 158 }
159 } 159 }
(...skipping 19 matching lines...) Expand all
179 FX_BOOL XFA_IsLayoutElement(XFA_ELEMENT eElement, 179 FX_BOOL XFA_IsLayoutElement(XFA_ELEMENT eElement,
180 FX_BOOL bLayoutContainer = FALSE); 180 FX_BOOL bLayoutContainer = FALSE);
181 181
182 void XFA_DataExporter_DealWithDataGroupNode(CXFA_Node* pDataNode); 182 void XFA_DataExporter_DealWithDataGroupNode(CXFA_Node* pDataNode);
183 void XFA_DataExporter_RegenerateFormFile(CXFA_Node* pNode, 183 void XFA_DataExporter_RegenerateFormFile(CXFA_Node* pNode,
184 IFX_Stream* pStream, 184 IFX_Stream* pStream,
185 const FX_CHAR* pChecksum = NULL, 185 const FX_CHAR* pChecksum = NULL,
186 FX_BOOL bSaveXML = FALSE); 186 FX_BOOL bSaveXML = FALSE);
187 187
188 #endif // XFA_FXFA_PARSER_XFA_UTILS_H_ 188 #endif // XFA_FXFA_PARSER_XFA_UTILS_H_
OLDNEW
« no previous file with comments | « xfa/fxfa/parser/xfa_parser_imp.cpp ('k') | xfa/fxfa/parser/xfa_utils_imp.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698