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

Side by Side Diff: xfa/src/fxfa/src/parser/xfa_script_signaturepseudomodel.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 17 matching lines...) Expand all
28 ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"verify"); 28 ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"verify");
29 return; 29 return;
30 } 30 }
31 IXFA_Notify* pNotify = m_pDocument->GetParser()->GetNotify(); 31 IXFA_Notify* pNotify = m_pDocument->GetParser()->GetNotify();
32 if (!pNotify) { 32 if (!pNotify) {
33 return; 33 return;
34 } 34 }
35 IXFA_Doc* hDoc = pNotify->GetHDOC(); 35 IXFA_Doc* hDoc = pNotify->GetHDOC();
36 CXFA_Node* pNode = NULL; 36 CXFA_Node* pNode = NULL;
37 if (iLength >= 1) { 37 if (iLength >= 1) {
38 pNode = (CXFA_Node*)pArguments->GetObject(0); 38 pNode = static_cast<CXFA_Node*>(pArguments->GetObject(0));
39 } 39 }
40 int32_t bVerify = pNotify->GetDocProvider()->Verify(hDoc, pNode); 40 int32_t bVerify = pNotify->GetDocProvider()->Verify(hDoc, pNode);
41 FXJSE_HVALUE hValue = pArguments->GetReturnValue(); 41 FXJSE_HVALUE hValue = pArguments->GetReturnValue();
42 if (hValue) { 42 if (hValue) {
43 FXJSE_Value_SetInteger(hValue, bVerify); 43 FXJSE_Value_SetInteger(hValue, bVerify);
44 } 44 }
45 } 45 }
46 void CScript_SignaturePseudoModel::Script_SignaturePseudoModel_Sign( 46 void CScript_SignaturePseudoModel::Script_SignaturePseudoModel_Sign(
47 CFXJSE_Arguments* pArguments) { 47 CFXJSE_Arguments* pArguments) {
48 int32_t iLength = pArguments->GetLength(); 48 int32_t iLength = pArguments->GetLength();
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 return; 101 return;
102 } 102 }
103 IXFA_Notify* pNotify = m_pDocument->GetParser()->GetNotify(); 103 IXFA_Notify* pNotify = m_pDocument->GetParser()->GetNotify();
104 if (!pNotify) { 104 if (!pNotify) {
105 return; 105 return;
106 } 106 }
107 IXFA_Doc* hDoc = pNotify->GetHDOC(); 107 IXFA_Doc* hDoc = pNotify->GetHDOC();
108 CXFA_Node* pNode = NULL; 108 CXFA_Node* pNode = NULL;
109 FX_BOOL bClear = TRUE; 109 FX_BOOL bClear = TRUE;
110 if (iLength >= 1) { 110 if (iLength >= 1) {
111 pNode = (CXFA_Node*)pArguments->GetObject(0); 111 pNode = static_cast<CXFA_Node*>(pArguments->GetObject(0));
112 } 112 }
113 if (iLength >= 2) { 113 if (iLength >= 2) {
114 bClear = pArguments->GetInt32(1) == 0 ? FALSE : TRUE; 114 bClear = pArguments->GetInt32(1) == 0 ? FALSE : TRUE;
115 } 115 }
116 FX_BOOL bFlag = pNotify->GetDocProvider()->Clear(hDoc, pNode, bClear); 116 FX_BOOL bFlag = pNotify->GetDocProvider()->Clear(hDoc, pNode, bClear);
117 FXJSE_HVALUE hValue = pArguments->GetReturnValue(); 117 FXJSE_HVALUE hValue = pArguments->GetReturnValue();
118 if (hValue) { 118 if (hValue) {
119 FXJSE_Value_SetBoolean(hValue, bFlag); 119 FXJSE_Value_SetBoolean(hValue, bFlag);
120 } 120 }
121 } 121 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698