| 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 "fpdfsdk/javascript/JS_Value.h" | 7 #include "fpdfsdk/javascript/JS_Value.h" |
| 8 | 8 |
| 9 #include <time.h> | 9 #include <time.h> |
| 10 | 10 |
| (...skipping 700 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 711 return 10; | 711 return 10; |
| 712 if ((334 + _isLeapYear(year)) <= day && day < (365 + _isLeapYear(year))) | 712 if ((334 + _isLeapYear(year)) <= day && day < (365 + _isLeapYear(year))) |
| 713 return 11; | 713 return 11; |
| 714 | 714 |
| 715 return -1; | 715 return -1; |
| 716 } | 716 } |
| 717 | 717 |
| 718 int _DateFromTime(double t) { | 718 int _DateFromTime(double t) { |
| 719 int day = _DayWithinYear(t); | 719 int day = _DayWithinYear(t); |
| 720 int year = _YearFromTime(t); | 720 int year = _YearFromTime(t); |
| 721 bool leap = _isLeapYear(year); | 721 int leap = _isLeapYear(year); |
| 722 int month = _MonthFromTime(t); | 722 int month = _MonthFromTime(t); |
| 723 switch (month) { | 723 switch (month) { |
| 724 case 0: | 724 case 0: |
| 725 return day + 1; | 725 return day + 1; |
| 726 case 1: | 726 case 1: |
| 727 return day - 30; | 727 return day - 30; |
| 728 case 2: | 728 case 2: |
| 729 return day - 58 - leap; | 729 return day - 58 - leap; |
| 730 case 3: | 730 case 3: |
| 731 return day - 89 - leap; | 731 return day - 89 - leap; |
| (...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 893 for (size_t i = 0; i < nKeywords; ++i) { | 893 for (size_t i = 0; i < nKeywords; ++i) { |
| 894 const wchar_t* property = va_arg(ap, const wchar_t*); | 894 const wchar_t* property = va_arg(ap, const wchar_t*); |
| 895 v8::Local<v8::Value> v8Value = | 895 v8::Local<v8::Value> v8Value = |
| 896 FXJS_GetObjectElement(pRuntime->GetIsolate(), pObj, property); | 896 FXJS_GetObjectElement(pRuntime->GetIsolate(), pObj, property); |
| 897 if (!v8Value->IsUndefined()) | 897 if (!v8Value->IsUndefined()) |
| 898 result[i] = CJS_Value(pRuntime, v8Value, CJS_Value::VT_unknown); | 898 result[i] = CJS_Value(pRuntime, v8Value, CJS_Value::VT_unknown); |
| 899 } | 899 } |
| 900 va_end(ap); | 900 va_end(ap); |
| 901 return result; | 901 return result; |
| 902 } | 902 } |
| OLD | NEW |