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

Side by Side Diff: xfa/src/fxfa/src/parser/xfa_document_layout_imp.cpp

Issue 1668003003: Call CXFA_Object::ToNode() rather than C-style casting. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: Created 4 years, 10 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
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/src/foxitlib.h" 7 #include "xfa/src/foxitlib.h"
8 #include "xfa/src/fxfa/src/common/xfa_utils.h" 8 #include "xfa/src/fxfa/src/common/xfa_utils.h"
9 #include "xfa/src/fxfa/src/common/xfa_object.h" 9 #include "xfa/src/fxfa/src/common/xfa_object.h"
10 #include "xfa/src/fxfa/src/common/xfa_document.h" 10 #include "xfa/src/fxfa/src/common/xfa_document.h"
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 int32_t CXFA_LayoutProcessor::StartLayout(FX_BOOL bForceRestart) { 45 int32_t CXFA_LayoutProcessor::StartLayout(FX_BOOL bForceRestart) {
46 if (!bForceRestart && !IsNeedLayout()) { 46 if (!bForceRestart && !IsNeedLayout()) {
47 return 100; 47 return 100;
48 } 48 }
49 if (m_pRootItemLayoutProcessor) { 49 if (m_pRootItemLayoutProcessor) {
50 delete m_pRootItemLayoutProcessor; 50 delete m_pRootItemLayoutProcessor;
51 m_pRootItemLayoutProcessor = NULL; 51 m_pRootItemLayoutProcessor = NULL;
52 } 52 }
53 m_nProgressCounter = 0; 53 m_nProgressCounter = 0;
54 CXFA_Node* pFormPacketNode = 54 CXFA_Node* pFormPacketNode =
55 (CXFA_Node*)m_pDocument->GetXFAObject(XFA_HASHCODE_Form); 55 ToNode(m_pDocument->GetXFAObject(XFA_HASHCODE_Form));
56 if (!pFormPacketNode) { 56 if (!pFormPacketNode) {
57 return -1; 57 return -1;
58 } 58 }
59 CXFA_Node* pFormRoot = 59 CXFA_Node* pFormRoot =
60 pFormPacketNode->GetFirstChildByClass(XFA_ELEMENT_Subform); 60 pFormPacketNode->GetFirstChildByClass(XFA_ELEMENT_Subform);
61 if (!pFormRoot) { 61 if (!pFormRoot) {
62 return -1; 62 return -1;
63 } 63 }
64 if (!m_pLayoutPageMgr) { 64 if (!m_pLayoutPageMgr) {
65 m_pLayoutPageMgr = new CXFA_LayoutPageMgr(this); 65 m_pLayoutPageMgr = new CXFA_LayoutPageMgr(this);
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
204 : CXFA_LayoutItem(pNode, TRUE), 204 : CXFA_LayoutItem(pNode, TRUE),
205 m_pPrev(NULL), 205 m_pPrev(NULL),
206 m_pNext(NULL), 206 m_pNext(NULL),
207 m_dwStatus(0) { 207 m_dwStatus(0) {
208 } 208 }
209 CXFA_ContentLayoutItem::~CXFA_ContentLayoutItem() { 209 CXFA_ContentLayoutItem::~CXFA_ContentLayoutItem() {
210 if (m_pFormNode->GetUserData(XFA_LAYOUTITEMKEY) == this) { 210 if (m_pFormNode->GetUserData(XFA_LAYOUTITEMKEY) == this) {
211 m_pFormNode->SetUserData(XFA_LAYOUTITEMKEY, NULL); 211 m_pFormNode->SetUserData(XFA_LAYOUTITEMKEY, NULL);
212 } 212 }
213 } 213 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698