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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 } | 61 } |
62 CXFA_FFDoc* hDoc = pNotify->GetHDOC(); | 62 CXFA_FFDoc* hDoc = pNotify->GetHDOC(); |
63 CXFA_NodeList* pNodeList = NULL; | 63 CXFA_NodeList* pNodeList = NULL; |
64 CFX_WideString wsExpression; | 64 CFX_WideString wsExpression; |
65 CFX_WideString wsXMLIdent; | 65 CFX_WideString wsXMLIdent; |
66 if (iLength >= 1) { | 66 if (iLength >= 1) { |
67 pNodeList = (CXFA_NodeList*)pArguments->GetObject(0); | 67 pNodeList = (CXFA_NodeList*)pArguments->GetObject(0); |
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 = CFX_WideString::FromUTF8(bsExpression.AsByteStringC()); |
72 CFX_WideString::FromUTF8(bsExpression, bsExpression.GetLength()); | |
73 } | 72 } |
74 if (iLength >= 3) { | 73 if (iLength >= 3) { |
75 CFX_ByteString bsXMLIdent = pArguments->GetUTF8String(2); | 74 CFX_ByteString bsXMLIdent = pArguments->GetUTF8String(2); |
76 wsXMLIdent = CFX_WideString::FromUTF8(bsXMLIdent, bsXMLIdent.GetLength()); | 75 wsXMLIdent = CFX_WideString::FromUTF8(bsXMLIdent.AsByteStringC()); |
77 } | 76 } |
78 FX_BOOL bSign = pNotify->GetDocProvider()->Sign(hDoc, pNodeList, | 77 FX_BOOL bSign = pNotify->GetDocProvider()->Sign(hDoc, pNodeList, |
79 wsExpression.AsWideStringC(), | 78 wsExpression.AsWideStringC(), |
80 wsXMLIdent.AsWideStringC()); | 79 wsXMLIdent.AsWideStringC()); |
81 FXJSE_HVALUE hValue = pArguments->GetReturnValue(); | 80 FXJSE_HVALUE hValue = pArguments->GetReturnValue(); |
82 if (hValue) { | 81 if (hValue) { |
83 FXJSE_Value_SetBoolean(hValue, bSign); | 82 FXJSE_Value_SetBoolean(hValue, bSign); |
84 } | 83 } |
85 } | 84 } |
86 void CScript_SignaturePseudoModel::Script_SignaturePseudoModel_Enumerate( | 85 void CScript_SignaturePseudoModel::Script_SignaturePseudoModel_Enumerate( |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 } | 119 } |
121 if (iLength >= 2) { | 120 if (iLength >= 2) { |
122 bClear = pArguments->GetInt32(1) == 0 ? FALSE : TRUE; | 121 bClear = pArguments->GetInt32(1) == 0 ? FALSE : TRUE; |
123 } | 122 } |
124 FX_BOOL bFlag = pNotify->GetDocProvider()->Clear(hDoc, pNode, bClear); | 123 FX_BOOL bFlag = pNotify->GetDocProvider()->Clear(hDoc, pNode, bClear); |
125 FXJSE_HVALUE hValue = pArguments->GetReturnValue(); | 124 FXJSE_HVALUE hValue = pArguments->GetReturnValue(); |
126 if (hValue) { | 125 if (hValue) { |
127 FXJSE_Value_SetBoolean(hValue, bFlag); | 126 FXJSE_Value_SetBoolean(hValue, bFlag); |
128 } | 127 } |
129 } | 128 } |
OLD | NEW |