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_hostpseudomodel.h" | 7 #include "xfa/fxfa/parser/xfa_script_hostpseudomodel.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 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 } | 156 } |
157 CXFA_FFNotify* pNotify = m_pDocument->GetParser()->GetNotify(); | 157 CXFA_FFNotify* pNotify = m_pDocument->GetParser()->GetNotify(); |
158 if (!pNotify) { | 158 if (!pNotify) { |
159 return; | 159 return; |
160 } | 160 } |
161 CXFA_FFDoc* hDoc = pNotify->GetHDOC(); | 161 CXFA_FFDoc* hDoc = pNotify->GetHDOC(); |
162 if (bSetting) { | 162 if (bSetting) { |
163 CFX_ByteString bsValue; | 163 CFX_ByteString bsValue; |
164 FXJSE_Value_ToUTF8String(hValue, bsValue); | 164 FXJSE_Value_ToUTF8String(hValue, bsValue); |
165 pNotify->GetDocProvider()->SetTitle( | 165 pNotify->GetDocProvider()->SetTitle( |
166 hDoc, CFX_WideString::FromUTF8(bsValue.AsStringC()).AsStringC()); | 166 hDoc, CFX_WideString::FromUTF8(bsValue.AsStringC())); |
167 return; | 167 return; |
168 } | 168 } |
169 CFX_WideString wsTitle; | 169 CFX_WideString wsTitle; |
170 pNotify->GetDocProvider()->GetTitle(hDoc, wsTitle); | 170 pNotify->GetDocProvider()->GetTitle(hDoc, wsTitle); |
171 FXJSE_Value_SetUTF8String(hValue, FX_UTF8Encode(wsTitle).AsStringC()); | 171 FXJSE_Value_SetUTF8String(hValue, FX_UTF8Encode(wsTitle).AsStringC()); |
172 } | 172 } |
173 void CScript_HostPseudoModel::Script_HostPseudoModel_ValidationsEnabled( | 173 void CScript_HostPseudoModel::Script_HostPseudoModel_ValidationsEnabled( |
174 FXJSE_HVALUE hValue, | 174 FXJSE_HVALUE hValue, |
175 FX_BOOL bSetting, | 175 FX_BOOL bSetting, |
176 XFA_ATTRIBUTE eAttribute) { | 176 XFA_ATTRIBUTE eAttribute) { |
(...skipping 618 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
795 CXFA_FFNotify* pNotify = m_pDocument->GetParser()->GetNotify(); | 795 CXFA_FFNotify* pNotify = m_pDocument->GetParser()->GetNotify(); |
796 if (!pNotify) { | 796 if (!pNotify) { |
797 return; | 797 return; |
798 } | 798 } |
799 CFX_WideString wsDataTime = pNotify->GetCurrentDateTime(); | 799 CFX_WideString wsDataTime = pNotify->GetCurrentDateTime(); |
800 FXJSE_HVALUE hValue = pArguments->GetReturnValue(); | 800 FXJSE_HVALUE hValue = pArguments->GetReturnValue(); |
801 if (hValue) { | 801 if (hValue) { |
802 FXJSE_Value_SetUTF8String(hValue, FX_UTF8Encode(wsDataTime).AsStringC()); | 802 FXJSE_Value_SetUTF8String(hValue, FX_UTF8Encode(wsDataTime).AsStringC()); |
803 } | 803 } |
804 } | 804 } |
OLD | NEW |