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_fm2js.h" | 7 #include "xfa_fm2js.h" |
8 #include <time.h> | 8 #include <time.h> |
9 #define FINANCIAL_PRECISION 0.00000001 | 9 #define FINANCIAL_PRECISION 0.00000001 |
10 struct XFA_FMHtmlReserveCode { | 10 struct XFA_FMHtmlReserveCode { |
(...skipping 2454 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2465 CFX_ByteString strIsoTime; | 2465 CFX_ByteString strIsoTime; |
2466 strIsoTime.Format("%02d:%02d:%02d", iHour, iMin, iSec); | 2466 strIsoTime.Format("%02d:%02d:%02d", iHour, iMin, iSec); |
2467 if (bGM) { | 2467 if (bGM) { |
2468 iRet = GetGMTTime(hThis, strIsoTime, szFormat, szLocale, strTime); | 2468 iRet = GetGMTTime(hThis, strIsoTime, szFormat, szLocale, strTime); |
2469 } else { | 2469 } else { |
2470 iRet = IsoTime2Local(hThis, strIsoTime, szFormat, szLocale, strTime); | 2470 iRet = IsoTime2Local(hThis, strIsoTime, szFormat, szLocale, strTime); |
2471 } | 2471 } |
2472 if (!iRet) { | 2472 if (!iRet) { |
2473 strTime = ""; | 2473 strTime = ""; |
2474 } | 2474 } |
2475 return; | |
2476 } | 2475 } |
| 2476 |
2477 void CXFA_FM2JSContext::GetLocalTimeZone(int32_t& iHour, | 2477 void CXFA_FM2JSContext::GetLocalTimeZone(int32_t& iHour, |
2478 int32_t& iMin, | 2478 int32_t& iMin, |
2479 int32_t& iSec) { | 2479 int32_t& iSec) { |
2480 time_t now; | 2480 time_t now; |
2481 time(&now); | 2481 time(&now); |
2482 struct tm* pGmt = gmtime(&now); | 2482 struct tm* pGmt = gmtime(&now); |
2483 int32_t iGMHour = pGmt->tm_hour; | 2483 int32_t iGMHour = pGmt->tm_hour; |
2484 int32_t iGMMin = pGmt->tm_min; | 2484 int32_t iGMMin = pGmt->tm_min; |
2485 int32_t iGMSec = pGmt->tm_sec; | 2485 int32_t iGMSec = pGmt->tm_sec; |
2486 struct tm* pLocal = localtime(&now); | 2486 struct tm* pLocal = localtime(&now); |
(...skipping 4706 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7193 FXSYS_assert(pAppProvider); | 7193 FXSYS_assert(pAppProvider); |
7194 CFX_WideString wsFormat; | 7194 CFX_WideString wsFormat; |
7195 pAppProvider->LoadString(iStringID, wsFormat); | 7195 pAppProvider->LoadString(iStringID, wsFormat); |
7196 CFX_WideString wsMessage; | 7196 CFX_WideString wsMessage; |
7197 va_list arg_ptr; | 7197 va_list arg_ptr; |
7198 va_start(arg_ptr, iStringID); | 7198 va_start(arg_ptr, iStringID); |
7199 wsMessage.FormatV((const FX_WCHAR*)wsFormat, arg_ptr); | 7199 wsMessage.FormatV((const FX_WCHAR*)wsFormat, arg_ptr); |
7200 va_end(arg_ptr); | 7200 va_end(arg_ptr); |
7201 FXJSE_ThrowMessage("", FX_UTF8Encode(wsMessage, wsMessage.GetLength())); | 7201 FXJSE_ThrowMessage("", FX_UTF8Encode(wsMessage, wsMessage.GetLength())); |
7202 } | 7202 } |
OLD | NEW |