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 "core/include/fxcrt/fx_ext.h" | 7 #include "core/include/fxcrt/fx_ext.h" |
8 #ifdef PDF_ENABLE_XFA | |
9 #include "fpdfsdk/include/fpdfxfa/fpdfxfa_doc.h" | |
10 #endif | |
11 #include "fpdfsdk/include/fsdk_baseannot.h" | 8 #include "fpdfsdk/include/fsdk_baseannot.h" |
12 #include "fpdfsdk/include/fsdk_define.h" | 9 #include "fpdfsdk/include/fsdk_define.h" |
13 #include "fpdfsdk/include/fsdk_mgr.h" | 10 #include "fpdfsdk/include/fsdk_mgr.h" |
14 | 11 |
| 12 #ifdef PDF_ENABLE_XFA |
| 13 #include "fpdfsdk/include/fpdfxfa/fpdfxfa_doc.h" |
| 14 #endif // PDF_ENABLE_XFA |
| 15 |
15 int _gAfxGetTimeZoneInSeconds(FX_CHAR tzhour, uint8_t tzminute) { | 16 int _gAfxGetTimeZoneInSeconds(FX_CHAR tzhour, uint8_t tzminute) { |
16 return (int)tzhour * 3600 + (int)tzminute * (tzhour >= 0 ? 60 : -60); | 17 return (int)tzhour * 3600 + (int)tzminute * (tzhour >= 0 ? 60 : -60); |
17 } | 18 } |
18 | 19 |
19 FX_BOOL _gAfxIsLeapYear(int16_t year) { | 20 FX_BOOL _gAfxIsLeapYear(int16_t year) { |
20 return ((year % 400 == 0) || ((year % 4 == 0) && (year % 100 != 0))); | 21 return ((year % 400 == 0) || ((year % 4 == 0) && (year % 100 != 0))); |
21 } | 22 } |
22 | 23 |
23 FX_WORD _gAfxGetYearDays(int16_t year) { | 24 FX_WORD _gAfxGetYearDays(int16_t year) { |
24 return (_gAfxIsLeapYear(year) == TRUE ? 366 : 365); | 25 return (_gAfxIsLeapYear(year) == TRUE ? 366 : 365); |
(...skipping 941 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
966 if (eAAT == CPDF_AAction::ButtonUp) | 967 if (eAAT == CPDF_AAction::ButtonUp) |
967 return GetAction(); | 968 return GetAction(); |
968 | 969 |
969 return CPDF_Action(); | 970 return CPDF_Action(); |
970 } | 971 } |
971 | 972 |
972 #ifdef PDF_ENABLE_XFA | 973 #ifdef PDF_ENABLE_XFA |
973 FX_BOOL CPDFSDK_BAAnnot::IsXFAField() { | 974 FX_BOOL CPDFSDK_BAAnnot::IsXFAField() { |
974 return FALSE; | 975 return FALSE; |
975 } | 976 } |
| 977 #endif // PDF_ENABLE_XFA |
976 | 978 |
977 #endif | |
978 void CPDFSDK_BAAnnot::Annot_OnDraw(CFX_RenderDevice* pDevice, | 979 void CPDFSDK_BAAnnot::Annot_OnDraw(CFX_RenderDevice* pDevice, |
979 CPDF_Matrix* pUser2Device, | 980 CPDF_Matrix* pUser2Device, |
980 CPDF_RenderOptions* pOptions) { | 981 CPDF_RenderOptions* pOptions) { |
981 m_pAnnot->GetAPForm(m_pPageView->GetPDFPage(), CPDF_Annot::Normal); | 982 m_pAnnot->GetAPForm(m_pPageView->GetPDFPage(), CPDF_Annot::Normal); |
982 m_pAnnot->DrawAppearance(m_pPageView->GetPDFPage(), pDevice, pUser2Device, | 983 m_pAnnot->DrawAppearance(m_pPageView->GetPDFPage(), pDevice, pUser2Device, |
983 CPDF_Annot::Normal, NULL); | 984 CPDF_Annot::Normal, NULL); |
984 | |
985 return; | |
986 } | 985 } |
987 | 986 |
988 UnderlyingPageType* CPDFSDK_Annot::GetUnderlyingPage() { | 987 UnderlyingPageType* CPDFSDK_Annot::GetUnderlyingPage() { |
989 #ifndef PDF_ENABLE_XFA | 988 #ifdef PDF_ENABLE_XFA |
| 989 return GetPDFXFAPage(); |
| 990 #else // PDF_ENABLE_XFA |
990 return GetPDFPage(); | 991 return GetPDFPage(); |
991 #else | 992 #endif // PDF_ENABLE_XFA |
992 return GetPDFXFAPage(); | |
993 #endif | |
994 } | 993 } |
995 | 994 |
996 CPDF_Page* CPDFSDK_Annot::GetPDFPage() { | 995 CPDF_Page* CPDFSDK_Annot::GetPDFPage() { |
997 if (m_pPageView) | 996 if (m_pPageView) |
998 return m_pPageView->GetPDFPage(); | 997 return m_pPageView->GetPDFPage(); |
999 return NULL; | 998 return NULL; |
1000 } | 999 } |
| 1000 |
1001 #ifdef PDF_ENABLE_XFA | 1001 #ifdef PDF_ENABLE_XFA |
1002 | |
1003 CPDFXFA_Page* CPDFSDK_Annot::GetPDFXFAPage() { | 1002 CPDFXFA_Page* CPDFSDK_Annot::GetPDFXFAPage() { |
1004 if (m_pPageView) | 1003 if (m_pPageView) |
1005 return m_pPageView->GetPDFXFAPage(); | 1004 return m_pPageView->GetPDFXFAPage(); |
1006 return NULL; | 1005 return NULL; |
1007 } | 1006 } |
1008 #endif | 1007 #endif // PDF_ENABLE_XFA |
OLD | NEW |