From 211d4edbe2f71ca62c76f36ce25090342c58e43c Mon Sep 17 00:00:00 2001 From: tsepez Date: Fri, 11 Nov 2016 17:23:48 -0800 Subject: Add fpdfppo_embeddertest.cpp. The lack of coverage of the fpdfppo APIs was noticed while trying to diagnose another issue. Adding basic calls to these APIs then kicked out an assert in XFA, where duplicate global CFXA_TimeZoneProviders were not expected. These are cheap to create except for the global C RTL tzset() call, so keep track of that and make these on demand. Review-Url: https://codereview.chromium.org/2488403004 --- xfa/fgas/localization/fgas_locale.cpp | 6 +++--- xfa/fgas/localization/fgas_locale.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'xfa/fgas/localization') diff --git a/xfa/fgas/localization/fgas_locale.cpp b/xfa/fgas/localization/fgas_locale.cpp index da4acb2a81..68fd94e29f 100644 --- a/xfa/fgas/localization/fgas_locale.cpp +++ b/xfa/fgas/localization/fgas_locale.cpp @@ -2241,7 +2241,7 @@ static void FX_ResolveZone(uint8_t& wHour, IFX_Locale* pLocale) { int32_t iMinuteDiff = wHour * 60 + wMinute; FX_TIMEZONE tzLocale; - pLocale->GetTimeZone(tzLocale); + pLocale->GetTimeZone(&tzLocale); iMinuteDiff += tzLocale.tzHour * 60 + (tzLocale.tzHour < 0 ? -tzLocale.tzMinute : tzLocale.tzMinute); iMinuteDiff -= tzDiff.tzHour * 60 + @@ -3923,7 +3923,7 @@ static bool FX_TimeFormat(const CFX_WideString& wsTimePattern, } else if (dwSymbol == FXBSTR_ID(0, 0, 'Z', '1')) { wsResult += FX_WSTRC(L"GMT"); FX_TIMEZONE tz; - pLocale->GetTimeZone(tz); + pLocale->GetTimeZone(&tz); if (!bGMT && (tz.tzHour != 0 || tz.tzMinute != 0)) { if (tz.tzHour < 0) { wsResult += FX_WSTRC(L"-"); @@ -3936,7 +3936,7 @@ static bool FX_TimeFormat(const CFX_WideString& wsTimePattern, } } else if (dwSymbol == FXBSTR_ID(0, 0, 'z', '1')) { FX_TIMEZONE tz; - pLocale->GetTimeZone(tz); + pLocale->GetTimeZone(&tz); if (!bGMT && tz.tzHour != 0 && tz.tzMinute != 0) { if (tz.tzHour < 0) { wsResult += FX_WSTRC(L"-"); diff --git a/xfa/fgas/localization/fgas_locale.h b/xfa/fgas/localization/fgas_locale.h index f9b84c5487..a3272b455f 100644 --- a/xfa/fgas/localization/fgas_locale.h +++ b/xfa/fgas/localization/fgas_locale.h @@ -68,7 +68,7 @@ class IFX_Locale { bool bAbbr = true) const = 0; virtual void GetMeridiemName(CFX_WideString& wsMeridiemName, bool bAM = true) const = 0; - virtual void GetTimeZone(FX_TIMEZONE& tz) const = 0; + virtual void GetTimeZone(FX_TIMEZONE* tz) const = 0; virtual void GetEraName(CFX_WideString& wsEraName, bool bAD = true) const = 0; virtual void GetDatePattern(FX_LOCALEDATETIMESUBCATEGORY eType, CFX_WideString& wsPattern) const = 0; -- cgit v1.2.3