| 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 14 matching lines...) Expand all Loading... |
| 25 : CXFA_OrdinaryObject(pDocument, XFA_ELEMENT_HostPseudoModel) { | 25 : CXFA_OrdinaryObject(pDocument, XFA_ELEMENT_HostPseudoModel) { |
| 26 m_uScriptHash = XFA_HASHCODE_Host; | 26 m_uScriptHash = XFA_HASHCODE_Host; |
| 27 } | 27 } |
| 28 CScript_HostPseudoModel::~CScript_HostPseudoModel() {} | 28 CScript_HostPseudoModel::~CScript_HostPseudoModel() {} |
| 29 void CScript_HostPseudoModel::Script_HostPseudoModel_LoadString( | 29 void CScript_HostPseudoModel::Script_HostPseudoModel_LoadString( |
| 30 FXJSE_HVALUE hValue, | 30 FXJSE_HVALUE hValue, |
| 31 CXFA_FFNotify* pNotify, | 31 CXFA_FFNotify* pNotify, |
| 32 uint32_t dwFlag) { | 32 uint32_t dwFlag) { |
| 33 CFX_WideString wsValue; | 33 CFX_WideString wsValue; |
| 34 pNotify->GetAppProvider()->LoadString(dwFlag, wsValue); | 34 pNotify->GetAppProvider()->LoadString(dwFlag, wsValue); |
| 35 FXJSE_Value_SetUTF8String(hValue, FX_UTF8Encode(wsValue)); | 35 FXJSE_Value_SetUTF8String(hValue, FX_UTF8Encode(wsValue).AsByteStringC()); |
| 36 } | 36 } |
| 37 void CScript_HostPseudoModel::Script_HostPseudoModel_AppType( | 37 void CScript_HostPseudoModel::Script_HostPseudoModel_AppType( |
| 38 FXJSE_HVALUE hValue, | 38 FXJSE_HVALUE hValue, |
| 39 FX_BOOL bSetting, | 39 FX_BOOL bSetting, |
| 40 XFA_ATTRIBUTE eAttribute) { | 40 XFA_ATTRIBUTE eAttribute) { |
| 41 CXFA_FFNotify* pNotify = m_pDocument->GetParser()->GetNotify(); | 41 CXFA_FFNotify* pNotify = m_pDocument->GetParser()->GetNotify(); |
| 42 if (!pNotify) { | 42 if (!pNotify) { |
| 43 return; | 43 return; |
| 44 } | 44 } |
| 45 if (bSetting) { | 45 if (bSetting) { |
| 46 ThrowScriptErrorMessage(XFA_IDS_INVAlID_PROP_SET); | 46 ThrowScriptErrorMessage(XFA_IDS_INVAlID_PROP_SET); |
| 47 return; | 47 return; |
| 48 } | 48 } |
| 49 CFX_WideString wsAppType; | 49 CFX_WideString wsAppType; |
| 50 pNotify->GetAppProvider()->GetAppType(wsAppType); | 50 pNotify->GetAppProvider()->GetAppType(wsAppType); |
| 51 FXJSE_Value_SetUTF8String(hValue, FX_UTF8Encode(wsAppType)); | 51 FXJSE_Value_SetUTF8String(hValue, FX_UTF8Encode(wsAppType).AsByteStringC()); |
| 52 } | 52 } |
| 53 void CScript_HostPseudoModel::Script_HostPseudoModel_FoxitAppType( | 53 void CScript_HostPseudoModel::Script_HostPseudoModel_FoxitAppType( |
| 54 FXJSE_HVALUE hValue, | 54 FXJSE_HVALUE hValue, |
| 55 FX_BOOL bSetting, | 55 FX_BOOL bSetting, |
| 56 XFA_ATTRIBUTE eAttribute) { | 56 XFA_ATTRIBUTE eAttribute) { |
| 57 CXFA_FFNotify* pNotify = m_pDocument->GetParser()->GetNotify(); | 57 CXFA_FFNotify* pNotify = m_pDocument->GetParser()->GetNotify(); |
| 58 if (!pNotify) { | 58 if (!pNotify) { |
| 59 return; | 59 return; |
| 60 } | 60 } |
| 61 if (bSetting) { | 61 if (bSetting) { |
| 62 ThrowScriptErrorMessage(XFA_IDS_INVAlID_PROP_SET); | 62 ThrowScriptErrorMessage(XFA_IDS_INVAlID_PROP_SET); |
| 63 return; | 63 return; |
| 64 } | 64 } |
| 65 CFX_WideString wsAppType; | 65 CFX_WideString wsAppType; |
| 66 pNotify->GetAppProvider()->GetFoxitAppType(wsAppType); | 66 pNotify->GetAppProvider()->GetFoxitAppType(wsAppType); |
| 67 FXJSE_Value_SetUTF8String(hValue, FX_UTF8Encode(wsAppType)); | 67 FXJSE_Value_SetUTF8String(hValue, FX_UTF8Encode(wsAppType).AsByteStringC()); |
| 68 } | 68 } |
| 69 void CScript_HostPseudoModel::Script_HostPseudoModel_CalculationsEnabled( | 69 void CScript_HostPseudoModel::Script_HostPseudoModel_CalculationsEnabled( |
| 70 FXJSE_HVALUE hValue, | 70 FXJSE_HVALUE hValue, |
| 71 FX_BOOL bSetting, | 71 FX_BOOL bSetting, |
| 72 XFA_ATTRIBUTE eAttribute) { | 72 XFA_ATTRIBUTE eAttribute) { |
| 73 CXFA_FFNotify* pNotify = m_pDocument->GetParser()->GetNotify(); | 73 CXFA_FFNotify* pNotify = m_pDocument->GetParser()->GetNotify(); |
| 74 if (!pNotify) { | 74 if (!pNotify) { |
| 75 return; | 75 return; |
| 76 } | 76 } |
| 77 CXFA_FFDoc* hDoc = pNotify->GetHDOC(); | 77 CXFA_FFDoc* hDoc = pNotify->GetHDOC(); |
| (...skipping 29 matching lines...) Expand all Loading... |
| 107 CXFA_FFNotify* pNotify = m_pDocument->GetParser()->GetNotify(); | 107 CXFA_FFNotify* pNotify = m_pDocument->GetParser()->GetNotify(); |
| 108 if (!pNotify) { | 108 if (!pNotify) { |
| 109 return; | 109 return; |
| 110 } | 110 } |
| 111 if (bSetting) { | 111 if (bSetting) { |
| 112 ThrowScriptErrorMessage(XFA_IDS_UNABLE_SET_LANGUAGE); | 112 ThrowScriptErrorMessage(XFA_IDS_UNABLE_SET_LANGUAGE); |
| 113 return; | 113 return; |
| 114 } | 114 } |
| 115 CFX_WideString wsLanguage; | 115 CFX_WideString wsLanguage; |
| 116 pNotify->GetAppProvider()->GetLanguage(wsLanguage); | 116 pNotify->GetAppProvider()->GetLanguage(wsLanguage); |
| 117 FXJSE_Value_SetUTF8String(hValue, FX_UTF8Encode(wsLanguage)); | 117 FXJSE_Value_SetUTF8String(hValue, FX_UTF8Encode(wsLanguage).AsByteStringC()); |
| 118 } | 118 } |
| 119 void CScript_HostPseudoModel::Script_HostPseudoModel_NumPages( | 119 void CScript_HostPseudoModel::Script_HostPseudoModel_NumPages( |
| 120 FXJSE_HVALUE hValue, | 120 FXJSE_HVALUE hValue, |
| 121 FX_BOOL bSetting, | 121 FX_BOOL bSetting, |
| 122 XFA_ATTRIBUTE eAttribute) { | 122 XFA_ATTRIBUTE eAttribute) { |
| 123 CXFA_FFNotify* pNotify = m_pDocument->GetParser()->GetNotify(); | 123 CXFA_FFNotify* pNotify = m_pDocument->GetParser()->GetNotify(); |
| 124 if (!pNotify) { | 124 if (!pNotify) { |
| 125 return; | 125 return; |
| 126 } | 126 } |
| 127 CXFA_FFDoc* hDoc = pNotify->GetHDOC(); | 127 CXFA_FFDoc* hDoc = pNotify->GetHDOC(); |
| (...skipping 11 matching lines...) Expand all Loading... |
| 139 CXFA_FFNotify* pNotify = m_pDocument->GetParser()->GetNotify(); | 139 CXFA_FFNotify* pNotify = m_pDocument->GetParser()->GetNotify(); |
| 140 if (!pNotify) { | 140 if (!pNotify) { |
| 141 return; | 141 return; |
| 142 } | 142 } |
| 143 if (bSetting) { | 143 if (bSetting) { |
| 144 ThrowScriptErrorMessage(XFA_IDS_UNABLE_SET_PLATFORM); | 144 ThrowScriptErrorMessage(XFA_IDS_UNABLE_SET_PLATFORM); |
| 145 return; | 145 return; |
| 146 } | 146 } |
| 147 CFX_WideString wsPlatform; | 147 CFX_WideString wsPlatform; |
| 148 pNotify->GetAppProvider()->GetPlatform(wsPlatform); | 148 pNotify->GetAppProvider()->GetPlatform(wsPlatform); |
| 149 FXJSE_Value_SetUTF8String(hValue, FX_UTF8Encode(wsPlatform)); | 149 FXJSE_Value_SetUTF8String(hValue, FX_UTF8Encode(wsPlatform).AsByteStringC()); |
| 150 } | 150 } |
| 151 void CScript_HostPseudoModel::Script_HostPseudoModel_Title( | 151 void CScript_HostPseudoModel::Script_HostPseudoModel_Title( |
| 152 FXJSE_HVALUE hValue, | 152 FXJSE_HVALUE hValue, |
| 153 FX_BOOL bSetting, | 153 FX_BOOL bSetting, |
| 154 XFA_ATTRIBUTE eAttribute) { | 154 XFA_ATTRIBUTE eAttribute) { |
| 155 if (!m_pDocument->GetScriptContext()->IsRunAtClient()) { | 155 if (!m_pDocument->GetScriptContext()->IsRunAtClient()) { |
| 156 return; | 156 return; |
| 157 } | 157 } |
| 158 CXFA_FFNotify* pNotify = m_pDocument->GetParser()->GetNotify(); | 158 CXFA_FFNotify* pNotify = m_pDocument->GetParser()->GetNotify(); |
| 159 if (!pNotify) { | 159 if (!pNotify) { |
| 160 return; | 160 return; |
| 161 } | 161 } |
| 162 CXFA_FFDoc* hDoc = pNotify->GetHDOC(); | 162 CXFA_FFDoc* hDoc = pNotify->GetHDOC(); |
| 163 if (bSetting) { | 163 if (bSetting) { |
| 164 CFX_ByteString bsValue; | 164 CFX_ByteString bsValue; |
| 165 FXJSE_Value_ToUTF8String(hValue, bsValue); | 165 FXJSE_Value_ToUTF8String(hValue, bsValue); |
| 166 pNotify->GetDocProvider()->SetTitle( | 166 pNotify->GetDocProvider()->SetTitle( |
| 167 hDoc, CFX_WideString::FromUTF8(bsValue, bsValue.GetLength())); | 167 hDoc, CFX_WideString::FromUTF8(bsValue, bsValue.GetLength())); |
| 168 return; | 168 return; |
| 169 } | 169 } |
| 170 CFX_WideString wsTitle; | 170 CFX_WideString wsTitle; |
| 171 pNotify->GetDocProvider()->GetTitle(hDoc, wsTitle); | 171 pNotify->GetDocProvider()->GetTitle(hDoc, wsTitle); |
| 172 FXJSE_Value_SetUTF8String(hValue, FX_UTF8Encode(wsTitle)); | 172 FXJSE_Value_SetUTF8String(hValue, FX_UTF8Encode(wsTitle).AsByteStringC()); |
| 173 } | 173 } |
| 174 void CScript_HostPseudoModel::Script_HostPseudoModel_ValidationsEnabled( | 174 void CScript_HostPseudoModel::Script_HostPseudoModel_ValidationsEnabled( |
| 175 FXJSE_HVALUE hValue, | 175 FXJSE_HVALUE hValue, |
| 176 FX_BOOL bSetting, | 176 FX_BOOL bSetting, |
| 177 XFA_ATTRIBUTE eAttribute) { | 177 XFA_ATTRIBUTE eAttribute) { |
| 178 CXFA_FFNotify* pNotify = m_pDocument->GetParser()->GetNotify(); | 178 CXFA_FFNotify* pNotify = m_pDocument->GetParser()->GetNotify(); |
| 179 if (!pNotify) { | 179 if (!pNotify) { |
| 180 return; | 180 return; |
| 181 } | 181 } |
| 182 CXFA_FFDoc* hDoc = pNotify->GetHDOC(); | 182 CXFA_FFDoc* hDoc = pNotify->GetHDOC(); |
| (...skipping 15 matching lines...) Expand all Loading... |
| 198 CXFA_FFNotify* pNotify = m_pDocument->GetParser()->GetNotify(); | 198 CXFA_FFNotify* pNotify = m_pDocument->GetParser()->GetNotify(); |
| 199 if (!pNotify) { | 199 if (!pNotify) { |
| 200 return; | 200 return; |
| 201 } | 201 } |
| 202 if (bSetting) { | 202 if (bSetting) { |
| 203 ThrowScriptErrorMessage(XFA_IDS_UNABLE_SET_VARIATION); | 203 ThrowScriptErrorMessage(XFA_IDS_UNABLE_SET_VARIATION); |
| 204 return; | 204 return; |
| 205 } | 205 } |
| 206 CFX_WideString wsVariation; | 206 CFX_WideString wsVariation; |
| 207 pNotify->GetAppProvider()->GetVariation(wsVariation); | 207 pNotify->GetAppProvider()->GetVariation(wsVariation); |
| 208 FXJSE_Value_SetUTF8String(hValue, FX_UTF8Encode(wsVariation)); | 208 FXJSE_Value_SetUTF8String(hValue, FX_UTF8Encode(wsVariation).AsByteStringC()); |
| 209 } | 209 } |
| 210 void CScript_HostPseudoModel::Script_HostPseudoModel_Version( | 210 void CScript_HostPseudoModel::Script_HostPseudoModel_Version( |
| 211 FXJSE_HVALUE hValue, | 211 FXJSE_HVALUE hValue, |
| 212 FX_BOOL bSetting, | 212 FX_BOOL bSetting, |
| 213 XFA_ATTRIBUTE eAttribute) { | 213 XFA_ATTRIBUTE eAttribute) { |
| 214 CXFA_FFNotify* pNotify = m_pDocument->GetParser()->GetNotify(); | 214 CXFA_FFNotify* pNotify = m_pDocument->GetParser()->GetNotify(); |
| 215 if (!pNotify) { | 215 if (!pNotify) { |
| 216 return; | 216 return; |
| 217 } | 217 } |
| 218 if (bSetting) { | 218 if (bSetting) { |
| 219 ThrowScriptErrorMessage(XFA_IDS_UNABLE_SET_VERSION); | 219 ThrowScriptErrorMessage(XFA_IDS_UNABLE_SET_VERSION); |
| 220 return; | 220 return; |
| 221 } | 221 } |
| 222 CFX_WideString wsVersion; | 222 CFX_WideString wsVersion; |
| 223 pNotify->GetAppProvider()->GetVersion(wsVersion); | 223 pNotify->GetAppProvider()->GetVersion(wsVersion); |
| 224 FXJSE_Value_SetUTF8String(hValue, FX_UTF8Encode(wsVersion)); | 224 FXJSE_Value_SetUTF8String(hValue, FX_UTF8Encode(wsVersion).AsByteStringC()); |
| 225 } | 225 } |
| 226 void CScript_HostPseudoModel::Script_HostPseudoModel_FoxitVersion( | 226 void CScript_HostPseudoModel::Script_HostPseudoModel_FoxitVersion( |
| 227 FXJSE_HVALUE hValue, | 227 FXJSE_HVALUE hValue, |
| 228 FX_BOOL bSetting, | 228 FX_BOOL bSetting, |
| 229 XFA_ATTRIBUTE eAttribute) { | 229 XFA_ATTRIBUTE eAttribute) { |
| 230 CXFA_FFNotify* pNotify = m_pDocument->GetParser()->GetNotify(); | 230 CXFA_FFNotify* pNotify = m_pDocument->GetParser()->GetNotify(); |
| 231 if (!pNotify) { | 231 if (!pNotify) { |
| 232 return; | 232 return; |
| 233 } | 233 } |
| 234 if (bSetting) { | 234 if (bSetting) { |
| 235 ThrowScriptErrorMessage(XFA_IDS_UNABLE_SET_VERSION); | 235 ThrowScriptErrorMessage(XFA_IDS_UNABLE_SET_VERSION); |
| 236 return; | 236 return; |
| 237 } | 237 } |
| 238 CFX_WideString wsVersion; | 238 CFX_WideString wsVersion; |
| 239 pNotify->GetAppProvider()->GetFoxitVersion(wsVersion); | 239 pNotify->GetAppProvider()->GetFoxitVersion(wsVersion); |
| 240 FXJSE_Value_SetUTF8String(hValue, FX_UTF8Encode(wsVersion)); | 240 FXJSE_Value_SetUTF8String(hValue, FX_UTF8Encode(wsVersion).AsByteStringC()); |
| 241 } | 241 } |
| 242 void CScript_HostPseudoModel::Script_HostPseudoModel_Name( | 242 void CScript_HostPseudoModel::Script_HostPseudoModel_Name( |
| 243 FXJSE_HVALUE hValue, | 243 FXJSE_HVALUE hValue, |
| 244 FX_BOOL bSetting, | 244 FX_BOOL bSetting, |
| 245 XFA_ATTRIBUTE eAttribute) { | 245 XFA_ATTRIBUTE eAttribute) { |
| 246 CXFA_FFNotify* pNotify = m_pDocument->GetParser()->GetNotify(); | 246 CXFA_FFNotify* pNotify = m_pDocument->GetParser()->GetNotify(); |
| 247 if (!pNotify) { | 247 if (!pNotify) { |
| 248 return; | 248 return; |
| 249 } | 249 } |
| 250 if (bSetting) { | 250 if (bSetting) { |
| 251 ThrowScriptErrorMessage(XFA_IDS_INVAlID_PROP_SET); | 251 ThrowScriptErrorMessage(XFA_IDS_INVAlID_PROP_SET); |
| 252 return; | 252 return; |
| 253 } | 253 } |
| 254 CFX_WideString wsAppName; | 254 CFX_WideString wsAppName; |
| 255 pNotify->GetAppProvider()->GetAppName(wsAppName); | 255 pNotify->GetAppProvider()->GetAppName(wsAppName); |
| 256 FXJSE_Value_SetUTF8String(hValue, FX_UTF8Encode(wsAppName)); | 256 FXJSE_Value_SetUTF8String(hValue, FX_UTF8Encode(wsAppName).AsByteStringC()); |
| 257 } | 257 } |
| 258 void CScript_HostPseudoModel::Script_HostPseudoModel_FoxitName( | 258 void CScript_HostPseudoModel::Script_HostPseudoModel_FoxitName( |
| 259 FXJSE_HVALUE hValue, | 259 FXJSE_HVALUE hValue, |
| 260 FX_BOOL bSetting, | 260 FX_BOOL bSetting, |
| 261 XFA_ATTRIBUTE eAttribute) { | 261 XFA_ATTRIBUTE eAttribute) { |
| 262 CXFA_FFNotify* pNotify = m_pDocument->GetParser()->GetNotify(); | 262 CXFA_FFNotify* pNotify = m_pDocument->GetParser()->GetNotify(); |
| 263 if (!pNotify) { | 263 if (!pNotify) { |
| 264 return; | 264 return; |
| 265 } | 265 } |
| 266 if (bSetting) { | 266 if (bSetting) { |
| 267 ThrowScriptErrorMessage(XFA_IDS_INVAlID_PROP_SET); | 267 ThrowScriptErrorMessage(XFA_IDS_INVAlID_PROP_SET); |
| 268 return; | 268 return; |
| 269 } | 269 } |
| 270 CFX_WideString wsFoxitAppName; | 270 CFX_WideString wsFoxitAppName; |
| 271 pNotify->GetAppProvider()->GetFoxitAppName(wsFoxitAppName); | 271 pNotify->GetAppProvider()->GetFoxitAppName(wsFoxitAppName); |
| 272 FXJSE_Value_SetUTF8String(hValue, FX_UTF8Encode(wsFoxitAppName)); | 272 FXJSE_Value_SetUTF8String(hValue, |
| 273 FX_UTF8Encode(wsFoxitAppName).AsByteStringC()); |
| 273 } | 274 } |
| 274 void CScript_HostPseudoModel::Script_HostPseudoModel_GotoURL( | 275 void CScript_HostPseudoModel::Script_HostPseudoModel_GotoURL( |
| 275 CFXJSE_Arguments* pArguments) { | 276 CFXJSE_Arguments* pArguments) { |
| 276 if (!m_pDocument->GetScriptContext()->IsRunAtClient()) { | 277 if (!m_pDocument->GetScriptContext()->IsRunAtClient()) { |
| 277 return; | 278 return; |
| 278 } | 279 } |
| 279 int32_t iLength = pArguments->GetLength(); | 280 int32_t iLength = pArguments->GetLength(); |
| 280 if (iLength != 1) { | 281 if (iLength != 1) { |
| 281 ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"gotoURL"); | 282 ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"gotoURL"); |
| 282 return; | 283 return; |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 381 CFX_WideString::FromUTF8(bsDefaultAnswer, bsDefaultAnswer.GetLength()); | 382 CFX_WideString::FromUTF8(bsDefaultAnswer, bsDefaultAnswer.GetLength()); |
| 382 } | 383 } |
| 383 if (iLength >= 4) { | 384 if (iLength >= 4) { |
| 384 bMark = pArguments->GetInt32(3) == 0 ? FALSE : TRUE; | 385 bMark = pArguments->GetInt32(3) == 0 ? FALSE : TRUE; |
| 385 } | 386 } |
| 386 CFX_WideString wsAnswer; | 387 CFX_WideString wsAnswer; |
| 387 pNotify->GetAppProvider()->Response(wsAnswer, wsQuestion, wsTitle, | 388 pNotify->GetAppProvider()->Response(wsAnswer, wsQuestion, wsTitle, |
| 388 wsDefaultAnswer, bMark); | 389 wsDefaultAnswer, bMark); |
| 389 FXJSE_HVALUE hValue = pArguments->GetReturnValue(); | 390 FXJSE_HVALUE hValue = pArguments->GetReturnValue(); |
| 390 if (hValue) { | 391 if (hValue) { |
| 391 FXJSE_Value_SetUTF8String(hValue, FX_UTF8Encode(wsAnswer)); | 392 FXJSE_Value_SetUTF8String(hValue, FX_UTF8Encode(wsAnswer).AsByteStringC()); |
| 392 } | 393 } |
| 393 } | 394 } |
| 394 void CScript_HostPseudoModel::Script_HostPseudoModel_DocumentInBatch( | 395 void CScript_HostPseudoModel::Script_HostPseudoModel_DocumentInBatch( |
| 395 CFXJSE_Arguments* pArguments) { | 396 CFXJSE_Arguments* pArguments) { |
| 396 CXFA_FFNotify* pNotify = m_pDocument->GetParser()->GetNotify(); | 397 CXFA_FFNotify* pNotify = m_pDocument->GetParser()->GetNotify(); |
| 397 if (!pNotify) { | 398 if (!pNotify) { |
| 398 return; | 399 return; |
| 399 } | 400 } |
| 400 int32_t iCur = pNotify->GetAppProvider()->GetCurDocumentInBatch(); | 401 int32_t iCur = pNotify->GetAppProvider()->GetCurDocumentInBatch(); |
| 401 FXJSE_HVALUE hValue = pArguments->GetReturnValue(); | 402 FXJSE_HVALUE hValue = pArguments->GetReturnValue(); |
| (...skipping 392 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 794 } | 795 } |
| 795 void CScript_HostPseudoModel::Script_HostPseudoModel_CurrentDateTime( | 796 void CScript_HostPseudoModel::Script_HostPseudoModel_CurrentDateTime( |
| 796 CFXJSE_Arguments* pArguments) { | 797 CFXJSE_Arguments* pArguments) { |
| 797 CXFA_FFNotify* pNotify = m_pDocument->GetParser()->GetNotify(); | 798 CXFA_FFNotify* pNotify = m_pDocument->GetParser()->GetNotify(); |
| 798 if (!pNotify) { | 799 if (!pNotify) { |
| 799 return; | 800 return; |
| 800 } | 801 } |
| 801 CFX_WideString wsDataTime = pNotify->GetCurrentDateTime(); | 802 CFX_WideString wsDataTime = pNotify->GetCurrentDateTime(); |
| 802 FXJSE_HVALUE hValue = pArguments->GetReturnValue(); | 803 FXJSE_HVALUE hValue = pArguments->GetReturnValue(); |
| 803 if (hValue) { | 804 if (hValue) { |
| 804 FXJSE_Value_SetUTF8String(hValue, FX_UTF8Encode(wsDataTime)); | 805 FXJSE_Value_SetUTF8String(hValue, |
| 806 FX_UTF8Encode(wsDataTime).AsByteStringC()); |
| 805 } | 807 } |
| 806 } | 808 } |
| OLD | NEW |