Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(324)

Unified Diff: xfa/fxfa/parser/xfa_localemgr.cpp

Issue 2488403004: Add fpdfppo_embeddertest.cpp. (Closed)
Patch Set: One last suggestion Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « xfa/fxfa/parser/xfa_localemgr.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: xfa/fxfa/parser/xfa_localemgr.cpp
diff --git a/xfa/fxfa/parser/xfa_localemgr.cpp b/xfa/fxfa/parser/xfa_localemgr.cpp
index 74565a7ea0afa12f26aa0ab01bb4706840025be1..cfa5801e3ce23485c513a730520191e25f56f002 100644
--- a/xfa/fxfa/parser/xfa_localemgr.cpp
+++ b/xfa/fxfa/parser/xfa_localemgr.cpp
@@ -6,6 +6,8 @@
#include "xfa/fxfa/parser/xfa_localemgr.h"
+#include <time.h>
+
#include <memory>
#include <utility>
@@ -1245,37 +1247,21 @@ CFX_WideStringC CXFA_LocaleMgr::GetConfigLocaleName(CXFA_Node* pConfig) {
return m_wsConfigLocale.AsStringC();
}
-static CXFA_TimeZoneProvider* g_pProvider = nullptr;
-
-// Static.
-CXFA_TimeZoneProvider* CXFA_TimeZoneProvider::Create() {
- ASSERT(!g_pProvider);
- g_pProvider = new CXFA_TimeZoneProvider();
- return g_pProvider;
-}
-
-// Static.
-CXFA_TimeZoneProvider* CXFA_TimeZoneProvider::Get() {
- if (!g_pProvider) {
- g_pProvider = new CXFA_TimeZoneProvider();
- }
- return g_pProvider;
-}
-
-// Static.
-void CXFA_TimeZoneProvider::Destroy() {
- delete g_pProvider;
- g_pProvider = nullptr;
-}
+static bool g_bProviderTimeZoneSet = false;
-#include <time.h>
CXFA_TimeZoneProvider::CXFA_TimeZoneProvider() {
#if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_
- _tzset();
+ if (!g_bProviderTimeZoneSet) {
+ g_bProviderTimeZoneSet = true;
+ _tzset();
+ }
m_tz.tzHour = (int8_t)(_timezone / 3600 * -1);
m_tz.tzMinute = (int8_t)((FXSYS_abs(_timezone) % 3600) / 60);
#else
- tzset();
+ if (!g_bProviderTimeZoneSet) {
+ g_bProviderTimeZoneSet = true;
+ tzset();
+ }
m_tz.tzHour = (int8_t)(timezone / 3600 * -1);
m_tz.tzMinute = (int8_t)((FXSYS_abs((int)timezone) % 3600) / 60);
#endif
@@ -1283,10 +1269,6 @@ CXFA_TimeZoneProvider::CXFA_TimeZoneProvider() {
CXFA_TimeZoneProvider::~CXFA_TimeZoneProvider() {}
-void CXFA_TimeZoneProvider::SetTimeZone(FX_TIMEZONE& tz) {
- m_tz = tz;
-}
-
-void CXFA_TimeZoneProvider::GetTimeZone(FX_TIMEZONE& tz) {
- tz = m_tz;
+void CXFA_TimeZoneProvider::GetTimeZone(FX_TIMEZONE* tz) const {
+ *tz = m_tz;
}
« no previous file with comments | « xfa/fxfa/parser/xfa_localemgr.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698