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/cscript_hostpseudomodel.h" | 7 #include "xfa/fxfa/parser/cscript_hostpseudomodel.h" |
8 | 8 |
9 #include "fxjs/include/cfxjse_arguments.h" | 9 #include "fxjs/include/cfxjse_arguments.h" |
10 #include "xfa/fxfa/app/xfa_ffnotify.h" | 10 #include "xfa/fxfa/app/xfa_ffnotify.h" |
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
231 CXFA_FFNotify* pNotify = m_pDocument->GetNotify(); | 231 CXFA_FFNotify* pNotify = m_pDocument->GetNotify(); |
232 if (!pNotify) { | 232 if (!pNotify) { |
233 return; | 233 return; |
234 } | 234 } |
235 CXFA_FFDoc* hDoc = pNotify->GetHDOC(); | 235 CXFA_FFDoc* hDoc = pNotify->GetHDOC(); |
236 CFX_WideString wsURL; | 236 CFX_WideString wsURL; |
237 if (iLength >= 1) { | 237 if (iLength >= 1) { |
238 CFX_ByteString bsURL = pArguments->GetUTF8String(0); | 238 CFX_ByteString bsURL = pArguments->GetUTF8String(0); |
239 wsURL = CFX_WideString::FromUTF8(bsURL.AsStringC()); | 239 wsURL = CFX_WideString::FromUTF8(bsURL.AsStringC()); |
240 } | 240 } |
241 pNotify->GetDocProvider()->GotoURL(hDoc, wsURL); | 241 pNotify->GetDocProvider()->GotoURL(hDoc, wsURL, TRUE); |
242 } | 242 } |
243 void CScript_HostPseudoModel::OpenList(CFXJSE_Arguments* pArguments) { | 243 void CScript_HostPseudoModel::OpenList(CFXJSE_Arguments* pArguments) { |
244 if (!m_pDocument->GetScriptContext()->IsRunAtClient()) { | 244 if (!m_pDocument->GetScriptContext()->IsRunAtClient()) { |
245 return; | 245 return; |
246 } | 246 } |
247 int32_t iLength = pArguments->GetLength(); | 247 int32_t iLength = pArguments->GetLength(); |
248 if (iLength != 1) { | 248 if (iLength != 1) { |
249 ThrowException(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"openList"); | 249 ThrowException(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"openList"); |
250 return; | 250 return; |
251 } | 251 } |
(...skipping 447 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
699 void CScript_HostPseudoModel::CurrentDateTime(CFXJSE_Arguments* pArguments) { | 699 void CScript_HostPseudoModel::CurrentDateTime(CFXJSE_Arguments* pArguments) { |
700 CXFA_FFNotify* pNotify = m_pDocument->GetNotify(); | 700 CXFA_FFNotify* pNotify = m_pDocument->GetNotify(); |
701 if (!pNotify) { | 701 if (!pNotify) { |
702 return; | 702 return; |
703 } | 703 } |
704 CFX_WideString wsDataTime = pNotify->GetCurrentDateTime(); | 704 CFX_WideString wsDataTime = pNotify->GetCurrentDateTime(); |
705 CFXJSE_Value* pValue = pArguments->GetReturnValue(); | 705 CFXJSE_Value* pValue = pArguments->GetReturnValue(); |
706 if (pValue) | 706 if (pValue) |
707 pValue->SetString(FX_UTF8Encode(wsDataTime).AsStringC()); | 707 pValue->SetString(FX_UTF8Encode(wsDataTime).AsStringC()); |
708 } | 708 } |
OLD | NEW |