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 <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "core/fxcrt/fx_ext.h" | 9 #include "core/fxcrt/fx_ext.h" |
10 #include "core/fxcrt/fx_xml.h" | 10 #include "core/fxcrt/fx_xml.h" |
(...skipping 2223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2234 datetime = datetime + ut; | 2234 datetime = datetime + ut; |
2235 return !!cc; | 2235 return !!cc; |
2236 } | 2236 } |
2237 | 2237 |
2238 static void FX_ResolveZone(uint8_t& wHour, | 2238 static void FX_ResolveZone(uint8_t& wHour, |
2239 uint8_t& wMinute, | 2239 uint8_t& wMinute, |
2240 FX_TIMEZONE tzDiff, | 2240 FX_TIMEZONE tzDiff, |
2241 IFX_Locale* pLocale) { | 2241 IFX_Locale* pLocale) { |
2242 int32_t iMinuteDiff = wHour * 60 + wMinute; | 2242 int32_t iMinuteDiff = wHour * 60 + wMinute; |
2243 FX_TIMEZONE tzLocale; | 2243 FX_TIMEZONE tzLocale; |
2244 pLocale->GetTimeZone(tzLocale); | 2244 pLocale->GetTimeZone(&tzLocale); |
2245 iMinuteDiff += tzLocale.tzHour * 60 + | 2245 iMinuteDiff += tzLocale.tzHour * 60 + |
2246 (tzLocale.tzHour < 0 ? -tzLocale.tzMinute : tzLocale.tzMinute); | 2246 (tzLocale.tzHour < 0 ? -tzLocale.tzMinute : tzLocale.tzMinute); |
2247 iMinuteDiff -= tzDiff.tzHour * 60 + | 2247 iMinuteDiff -= tzDiff.tzHour * 60 + |
2248 (tzDiff.tzHour < 0 ? -tzDiff.tzMinute : tzDiff.tzMinute); | 2248 (tzDiff.tzHour < 0 ? -tzDiff.tzMinute : tzDiff.tzMinute); |
2249 while (iMinuteDiff > 1440) { | 2249 while (iMinuteDiff > 1440) { |
2250 iMinuteDiff -= 1440; | 2250 iMinuteDiff -= 1440; |
2251 } | 2251 } |
2252 while (iMinuteDiff < 0) { | 2252 while (iMinuteDiff < 0) { |
2253 iMinuteDiff += 1440; | 2253 iMinuteDiff += 1440; |
2254 } | 2254 } |
(...skipping 1661 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3916 CFX_WideString wsMilliseconds; | 3916 CFX_WideString wsMilliseconds; |
3917 wsMilliseconds.Format(L"%03d", millisecond); | 3917 wsMilliseconds.Format(L"%03d", millisecond); |
3918 wsResult += wsMilliseconds; | 3918 wsResult += wsMilliseconds; |
3919 } else if (dwSymbol == FXBSTR_ID(0, 0, 'A', '1')) { | 3919 } else if (dwSymbol == FXBSTR_ID(0, 0, 'A', '1')) { |
3920 CFX_WideString wsMeridiem; | 3920 CFX_WideString wsMeridiem; |
3921 pLocale->GetMeridiemName(wsMeridiem, !bPM); | 3921 pLocale->GetMeridiemName(wsMeridiem, !bPM); |
3922 wsResult += wsMeridiem; | 3922 wsResult += wsMeridiem; |
3923 } else if (dwSymbol == FXBSTR_ID(0, 0, 'Z', '1')) { | 3923 } else if (dwSymbol == FXBSTR_ID(0, 0, 'Z', '1')) { |
3924 wsResult += FX_WSTRC(L"GMT"); | 3924 wsResult += FX_WSTRC(L"GMT"); |
3925 FX_TIMEZONE tz; | 3925 FX_TIMEZONE tz; |
3926 pLocale->GetTimeZone(tz); | 3926 pLocale->GetTimeZone(&tz); |
3927 if (!bGMT && (tz.tzHour != 0 || tz.tzMinute != 0)) { | 3927 if (!bGMT && (tz.tzHour != 0 || tz.tzMinute != 0)) { |
3928 if (tz.tzHour < 0) { | 3928 if (tz.tzHour < 0) { |
3929 wsResult += FX_WSTRC(L"-"); | 3929 wsResult += FX_WSTRC(L"-"); |
3930 } else { | 3930 } else { |
3931 wsResult += FX_WSTRC(L"+"); | 3931 wsResult += FX_WSTRC(L"+"); |
3932 } | 3932 } |
3933 CFX_WideString wsTimezone; | 3933 CFX_WideString wsTimezone; |
3934 wsTimezone.Format(L"%02d:%02d", FXSYS_abs(tz.tzHour), tz.tzMinute); | 3934 wsTimezone.Format(L"%02d:%02d", FXSYS_abs(tz.tzHour), tz.tzMinute); |
3935 wsResult += wsTimezone; | 3935 wsResult += wsTimezone; |
3936 } | 3936 } |
3937 } else if (dwSymbol == FXBSTR_ID(0, 0, 'z', '1')) { | 3937 } else if (dwSymbol == FXBSTR_ID(0, 0, 'z', '1')) { |
3938 FX_TIMEZONE tz; | 3938 FX_TIMEZONE tz; |
3939 pLocale->GetTimeZone(tz); | 3939 pLocale->GetTimeZone(&tz); |
3940 if (!bGMT && tz.tzHour != 0 && tz.tzMinute != 0) { | 3940 if (!bGMT && tz.tzHour != 0 && tz.tzMinute != 0) { |
3941 if (tz.tzHour < 0) { | 3941 if (tz.tzHour < 0) { |
3942 wsResult += FX_WSTRC(L"-"); | 3942 wsResult += FX_WSTRC(L"-"); |
3943 } else { | 3943 } else { |
3944 wsResult += FX_WSTRC(L"+"); | 3944 wsResult += FX_WSTRC(L"+"); |
3945 } | 3945 } |
3946 CFX_WideString wsTimezone; | 3946 CFX_WideString wsTimezone; |
3947 wsTimezone.Format(L"%02d:%02d", FXSYS_abs(tz.tzHour), tz.tzMinute); | 3947 wsTimezone.Format(L"%02d:%02d", FXSYS_abs(tz.tzHour), tz.tzMinute); |
3948 wsResult += wsTimezone; | 3948 wsResult += wsTimezone; |
3949 } | 3949 } |
(...skipping 802 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4752 } | 4752 } |
4753 CFX_Decimal CFX_Decimal::operator*(const CFX_Decimal& val) const { | 4753 CFX_Decimal CFX_Decimal::operator*(const CFX_Decimal& val) const { |
4754 return Multiply(val); | 4754 return Multiply(val); |
4755 } | 4755 } |
4756 CFX_Decimal CFX_Decimal::operator/(const CFX_Decimal& val) const { | 4756 CFX_Decimal CFX_Decimal::operator/(const CFX_Decimal& val) const { |
4757 return Divide(val); | 4757 return Divide(val); |
4758 } | 4758 } |
4759 CFX_Decimal CFX_Decimal::operator%(const CFX_Decimal& val) const { | 4759 CFX_Decimal CFX_Decimal::operator%(const CFX_Decimal& val) const { |
4760 return Modulus(val); | 4760 return Modulus(val); |
4761 } | 4761 } |
OLD | NEW |