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

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

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_localemgr.cpp ('k') | xfa/fxfa/parser/xfa_parser_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 #include "xfa/fxfa/parser/xfa_object.h" 7 #include "xfa/fxfa/parser/xfa_object.h"
8 8
9 #include <memory> 9 #include <memory>
10 10
(...skipping 4486 matching lines...) Expand 10 before | Expand all | Expand 10 after
4497 for (; pNode; pNode = pNode->GetNodeItem(XFA_NODEITEM_NextSibling)) { 4497 for (; pNode; pNode = pNode->GetNodeItem(XFA_NODEITEM_NextSibling)) {
4498 const XFA_PROPERTY* pExistProperty = 4498 const XFA_PROPERTY* pExistProperty =
4499 XFA_GetPropertyOfElement(eElement, pNode->GetClassID(), dwPacket); 4499 XFA_GetPropertyOfElement(eElement, pNode->GetClassID(), dwPacket);
4500 if (pExistProperty && (pExistProperty->uFlags & XFA_PROPERTYFLAG_OneOf)) { 4500 if (pExistProperty && (pExistProperty->uFlags & XFA_PROPERTYFLAG_OneOf)) {
4501 return NULL; 4501 return NULL;
4502 } 4502 }
4503 } 4503 }
4504 } 4504 }
4505 CXFA_Document* pFactory = m_pDocument->GetParser()->GetFactory(); 4505 CXFA_Document* pFactory = m_pDocument->GetParser()->GetFactory();
4506 const XFA_PACKETINFO* pPacket = XFA_GetPacketByID(dwPacket); 4506 const XFA_PACKETINFO* pPacket = XFA_GetPacketByID(dwPacket);
4507 CXFA_Node* pNewNode; 4507 CXFA_Node* pNewNode = nullptr;
4508 for (; iCount <= index; iCount++) { 4508 for (; iCount <= index; iCount++) {
4509 pNewNode = pFactory->CreateNode(pPacket, eProperty); 4509 pNewNode = pFactory->CreateNode(pPacket, eProperty);
4510 if (!pNewNode) { 4510 if (!pNewNode) {
4511 return NULL; 4511 return NULL;
4512 } 4512 }
4513 InsertChild(pNewNode, nullptr); 4513 InsertChild(pNewNode, nullptr);
4514 pNewNode->SetFlag(XFA_NODEFLAG_Initialized, true); 4514 pNewNode->SetFlag(XFA_NODEFLAG_Initialized, true);
4515 } 4515 }
4516 return pNewNode; 4516 return pNewNode;
4517 } 4517 }
(...skipping 847 matching lines...) Expand 10 before | Expand all | Expand 10 after
5365 return m_pAttachNode->InsertChild(pNewNode, pBeforeNode); 5365 return m_pAttachNode->InsertChild(pNewNode, pBeforeNode);
5366 } 5366 }
5367 FX_BOOL CXFA_AttachNodeList::Remove(CXFA_Node* pNode) { 5367 FX_BOOL CXFA_AttachNodeList::Remove(CXFA_Node* pNode) {
5368 return m_pAttachNode->RemoveChild(pNode); 5368 return m_pAttachNode->RemoveChild(pNode);
5369 } 5369 }
5370 CXFA_Node* CXFA_AttachNodeList::Item(int32_t iIndex) { 5370 CXFA_Node* CXFA_AttachNodeList::Item(int32_t iIndex) {
5371 return m_pAttachNode->GetChild( 5371 return m_pAttachNode->GetChild(
5372 iIndex, XFA_ELEMENT_UNKNOWN, 5372 iIndex, XFA_ELEMENT_UNKNOWN,
5373 m_pAttachNode->GetClassID() == XFA_ELEMENT_Subform); 5373 m_pAttachNode->GetClassID() == XFA_ELEMENT_Subform);
5374 } 5374 }
OLDNEW
« no previous file with comments | « xfa/fxfa/parser/xfa_localemgr.cpp ('k') | xfa/fxfa/parser/xfa_parser_imp.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698