Chromium Code Reviews| Index: fpdfsdk/fsdk_baseannot.cpp |
| diff --git a/fpdfsdk/fsdk_baseannot.cpp b/fpdfsdk/fsdk_baseannot.cpp |
| index 1345f234b653d1c68a6f7455dc0b5f1841809415..7dcb663505aec9eca289f84c573dc738c012a52a 100644 |
| --- a/fpdfsdk/fsdk_baseannot.cpp |
| +++ b/fpdfsdk/fsdk_baseannot.cpp |
| @@ -376,8 +376,7 @@ CFX_ByteString CPDFSDK_DateTime::ToPDFDateTimeString() { |
| } |
| void CPDFSDK_DateTime::ToSystemTime(FX_SYSTEMTIME& st) { |
| - CPDFSDK_DateTime dt = *this; |
| - time_t t = (time_t)dt; |
| + time_t t = (time_t)(*this); |
|
dsinclair
2016/06/06 12:50:11
nit: static_cast?
Tom Sepez
2016/06/06 16:43:34
Bleh. This is wack. Let's kill CPDFSDK_DateTime:
Wei Li
2016/06/07 17:33:53
Yes, I will do this in a follow-up.
|
| struct tm* pTime = localtime(&t); |
| if (pTime) { |
| st.wYear = (uint16_t)pTime->tm_year + 1900; |
| @@ -392,11 +391,12 @@ void CPDFSDK_DateTime::ToSystemTime(FX_SYSTEMTIME& st) { |
| } |
| CPDFSDK_DateTime CPDFSDK_DateTime::ToGMT() const { |
| - CPDFSDK_DateTime dt = *this; |
| - dt.AddSeconds(-gAfxGetTimeZoneInSeconds(dt.dt.tzHour, dt.dt.tzMinute)); |
| - dt.dt.tzHour = 0; |
| - dt.dt.tzMinute = 0; |
| - return dt; |
| + CPDFSDK_DateTime new_dt = *this; |
| + new_dt.AddSeconds( |
| + -gAfxGetTimeZoneInSeconds(new_dt.dt.tzHour, new_dt.dt.tzMinute)); |
| + new_dt.dt.tzHour = 0; |
| + new_dt.dt.tzMinute = 0; |
| + return new_dt; |
| } |
| CPDFSDK_DateTime& CPDFSDK_DateTime::AddDays(short days) { |