| OLD | NEW |
| 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_script_signaturepseudomodel.h" | 7 #include "xfa/fxfa/parser/xfa_script_signaturepseudomodel.h" |
| 8 | 8 |
| 9 #include "xfa/fxfa/app/xfa_ffnotify.h" | 9 #include "xfa/fxfa/app/xfa_ffnotify.h" |
| 10 #include "xfa/fxfa/fm2js/xfa_fm2jsapi.h" | 10 #include "xfa/fxfa/fm2js/xfa_fm2jsapi.h" |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 } | 68 } |
| 69 if (iLength >= 2) { | 69 if (iLength >= 2) { |
| 70 CFX_ByteString bsExpression = pArguments->GetUTF8String(1); | 70 CFX_ByteString bsExpression = pArguments->GetUTF8String(1); |
| 71 wsExpression = | 71 wsExpression = |
| 72 CFX_WideString::FromUTF8(bsExpression, bsExpression.GetLength()); | 72 CFX_WideString::FromUTF8(bsExpression, bsExpression.GetLength()); |
| 73 } | 73 } |
| 74 if (iLength >= 3) { | 74 if (iLength >= 3) { |
| 75 CFX_ByteString bsXMLIdent = pArguments->GetUTF8String(2); | 75 CFX_ByteString bsXMLIdent = pArguments->GetUTF8String(2); |
| 76 wsXMLIdent = CFX_WideString::FromUTF8(bsXMLIdent, bsXMLIdent.GetLength()); | 76 wsXMLIdent = CFX_WideString::FromUTF8(bsXMLIdent, bsXMLIdent.GetLength()); |
| 77 } | 77 } |
| 78 FX_BOOL bSign = pNotify->GetDocProvider()->Sign(hDoc, pNodeList, wsExpression, | 78 FX_BOOL bSign = pNotify->GetDocProvider()->Sign(hDoc, pNodeList, |
| 79 wsXMLIdent); | 79 wsExpression.AsWideStringC(), |
| 80 wsXMLIdent.AsWideStringC()); |
| 80 FXJSE_HVALUE hValue = pArguments->GetReturnValue(); | 81 FXJSE_HVALUE hValue = pArguments->GetReturnValue(); |
| 81 if (hValue) { | 82 if (hValue) { |
| 82 FXJSE_Value_SetBoolean(hValue, bSign); | 83 FXJSE_Value_SetBoolean(hValue, bSign); |
| 83 } | 84 } |
| 84 } | 85 } |
| 85 void CScript_SignaturePseudoModel::Script_SignaturePseudoModel_Enumerate( | 86 void CScript_SignaturePseudoModel::Script_SignaturePseudoModel_Enumerate( |
| 86 CFXJSE_Arguments* pArguments) { | 87 CFXJSE_Arguments* pArguments) { |
| 87 int32_t iLength = pArguments->GetLength(); | 88 int32_t iLength = pArguments->GetLength(); |
| 88 if (iLength != 0) { | 89 if (iLength != 0) { |
| 89 ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"enumerate"); | 90 ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"enumerate"); |
| (...skipping 29 matching lines...) Expand all Loading... |
| 119 } | 120 } |
| 120 if (iLength >= 2) { | 121 if (iLength >= 2) { |
| 121 bClear = pArguments->GetInt32(1) == 0 ? FALSE : TRUE; | 122 bClear = pArguments->GetInt32(1) == 0 ? FALSE : TRUE; |
| 122 } | 123 } |
| 123 FX_BOOL bFlag = pNotify->GetDocProvider()->Clear(hDoc, pNode, bClear); | 124 FX_BOOL bFlag = pNotify->GetDocProvider()->Clear(hDoc, pNode, bClear); |
| 124 FXJSE_HVALUE hValue = pArguments->GetReturnValue(); | 125 FXJSE_HVALUE hValue = pArguments->GetReturnValue(); |
| 125 if (hValue) { | 126 if (hValue) { |
| 126 FXJSE_Value_SetBoolean(hValue, bFlag); | 127 FXJSE_Value_SetBoolean(hValue, bFlag); |
| 127 } | 128 } |
| 128 } | 129 } |
| OLD | NEW |