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

Side by Side Diff: xfa/src/fxfa/src/parser/xfa_script_nodehelper.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 335 matching lines...) Expand 10 before | Expand all | Expand 10 after
346 CFX_WideString wsCondition, 346 CFX_WideString wsCondition,
347 FX_BOOL bLastNode, 347 FX_BOOL bLastNode,
348 CXFA_ScriptContext* pScriptContext) { 348 CXFA_ScriptContext* pScriptContext) {
349 if (m_pCreateParent == NULL) { 349 if (m_pCreateParent == NULL) {
350 return FALSE; 350 return FALSE;
351 } 351 }
352 FX_BOOL bIsClassName = FALSE; 352 FX_BOOL bIsClassName = FALSE;
353 FX_BOOL bResult = FALSE; 353 FX_BOOL bResult = FALSE;
354 if (wsName.GetAt(0) == '!') { 354 if (wsName.GetAt(0) == '!') {
355 wsName = wsName.Right(wsName.GetLength() - 1); 355 wsName = wsName.Right(wsName.GetLength() - 1);
356 m_pCreateParent = (CXFA_Node*)pScriptContext->GetDocument()->GetXFAObject( 356 m_pCreateParent = ToNode(
357 XFA_HASHCODE_Datasets); 357 pScriptContext->GetDocument()->GetXFAObject(XFA_HASHCODE_Datasets));
358 } 358 }
359 if (wsName.GetAt(0) == '#') { 359 if (wsName.GetAt(0) == '#') {
360 bIsClassName = TRUE; 360 bIsClassName = TRUE;
361 wsName = wsName.Right(wsName.GetLength() - 1); 361 wsName = wsName.Right(wsName.GetLength() - 1);
362 } 362 }
363 if (m_iCreateCount == 0) { 363 if (m_iCreateCount == 0) {
364 XFA_CreateNode_ForCondition(wsCondition); 364 XFA_CreateNode_ForCondition(wsCondition);
365 } 365 }
366 if (bIsClassName) { 366 if (bIsClassName) {
367 XFA_LPCELEMENTINFO lpElement = XFA_GetElementByName(wsName); 367 XFA_LPCELEMENTINFO lpElement = XFA_GetElementByName(wsName);
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
422 XFA_ResolveNodes_GetParent(refNode, XFA_LOGIC_NoTransparent); 422 XFA_ResolveNodes_GetParent(refNode, XFA_LOGIC_NoTransparent);
423 if (parent != NULL && refNode != NULL) { 423 if (parent != NULL && refNode != NULL) {
424 XFA_LPCPROPERTY pPropert = XFA_GetPropertyOfElement( 424 XFA_LPCPROPERTY pPropert = XFA_GetPropertyOfElement(
425 parent->GetClassID(), refNode->GetClassID(), XFA_XDPPACKET_UNKNOWN); 425 parent->GetClassID(), refNode->GetClassID(), XFA_XDPPACKET_UNKNOWN);
426 if (pPropert) { 426 if (pPropert) {
427 bRes = TRUE; 427 bRes = TRUE;
428 } 428 }
429 } 429 }
430 return bRes; 430 return bRes;
431 } 431 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698