Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(56)

Side by Side Diff: fpdfsdk/src/fsdk_baseannot.cpp

Issue 1477583002: Inflict PDF_ENABLE_XFA ifdefs on XFA fpdfsdk/ (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: Remove fsdk_actionhandler.cpp Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « fpdfsdk/src/fsdk_annothandler.cpp ('k') | fpdfsdk/src/fsdk_baseform.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
8 #include "fpdfsdk/include/fpdfxfa/fpdfxfa_doc.h" 9 #include "fpdfsdk/include/fpdfxfa/fpdfxfa_doc.h"
10 #endif
9 #include "fpdfsdk/include/fsdk_baseannot.h" 11 #include "fpdfsdk/include/fsdk_baseannot.h"
10 #include "fpdfsdk/include/fsdk_define.h" 12 #include "fpdfsdk/include/fsdk_define.h"
11 #include "fpdfsdk/include/fsdk_mgr.h" 13 #include "fpdfsdk/include/fsdk_mgr.h"
12 14
13 int _gAfxGetTimeZoneInSeconds(FX_CHAR tzhour, uint8_t tzminute) { 15 int _gAfxGetTimeZoneInSeconds(FX_CHAR tzhour, uint8_t tzminute) {
14 return (int)tzhour * 3600 + (int)tzminute * (tzhour >= 0 ? 60 : -60); 16 return (int)tzhour * 3600 + (int)tzminute * (tzhour >= 0 ? 60 : -60);
15 } 17 }
16 18
17 FX_BOOL _gAfxIsLeapYear(int16_t year) { 19 FX_BOOL _gAfxIsLeapYear(int16_t year) {
18 return ((year % 400 == 0) || ((year % 4 == 0) && (year % 100 != 0))); 20 return ((year % 400 == 0) || ((year % 4 == 0) && (year % 100 != 0)));
(...skipping 941 matching lines...) Expand 10 before | Expand all | Expand 10 after
960 962
961 if (AAction.ActionExist(eAAT)) 963 if (AAction.ActionExist(eAAT))
962 return AAction.GetAction(eAAT); 964 return AAction.GetAction(eAAT);
963 965
964 if (eAAT == CPDF_AAction::ButtonUp) 966 if (eAAT == CPDF_AAction::ButtonUp)
965 return GetAction(); 967 return GetAction();
966 968
967 return CPDF_Action(); 969 return CPDF_Action();
968 } 970 }
969 971
972 #ifdef PDF_ENABLE_XFA
970 FX_BOOL CPDFSDK_BAAnnot::IsXFAField() { 973 FX_BOOL CPDFSDK_BAAnnot::IsXFAField() {
971 return FALSE; 974 return FALSE;
972 } 975 }
973 976
977 #endif
974 void CPDFSDK_BAAnnot::Annot_OnDraw(CFX_RenderDevice* pDevice, 978 void CPDFSDK_BAAnnot::Annot_OnDraw(CFX_RenderDevice* pDevice,
975 CPDF_Matrix* pUser2Device, 979 CPDF_Matrix* pUser2Device,
976 CPDF_RenderOptions* pOptions) { 980 CPDF_RenderOptions* pOptions) {
977 m_pAnnot->GetAPForm(m_pPageView->GetPDFPage(), CPDF_Annot::Normal); 981 m_pAnnot->GetAPForm(m_pPageView->GetPDFPage(), CPDF_Annot::Normal);
978 m_pAnnot->DrawAppearance(m_pPageView->GetPDFPage(), pDevice, pUser2Device, 982 m_pAnnot->DrawAppearance(m_pPageView->GetPDFPage(), pDevice, pUser2Device,
979 CPDF_Annot::Normal, NULL); 983 CPDF_Annot::Normal, NULL);
980 984
981 return; 985 return;
982 } 986 }
983 987
984 UnderlyingPageType* CPDFSDK_Annot::GetUnderlyingPage() { 988 UnderlyingPageType* CPDFSDK_Annot::GetUnderlyingPage() {
989 #ifndef PDF_ENABLE_XFA
990 return GetPDFPage();
991 #else
985 return GetPDFXFAPage(); 992 return GetPDFXFAPage();
993 #endif
986 } 994 }
987 995
988 CPDF_Page* CPDFSDK_Annot::GetPDFPage() { 996 CPDF_Page* CPDFSDK_Annot::GetPDFPage() {
989 if (m_pPageView) 997 if (m_pPageView)
990 return m_pPageView->GetPDFPage(); 998 return m_pPageView->GetPDFPage();
991 return NULL; 999 return NULL;
992 } 1000 }
1001 #ifdef PDF_ENABLE_XFA
993 1002
994 CPDFXFA_Page* CPDFSDK_Annot::GetPDFXFAPage() { 1003 CPDFXFA_Page* CPDFSDK_Annot::GetPDFXFAPage() {
995 if (m_pPageView) 1004 if (m_pPageView)
996 return m_pPageView->GetPDFXFAPage(); 1005 return m_pPageView->GetPDFXFAPage();
997 return NULL; 1006 return NULL;
998 } 1007 }
1008 #endif
OLDNEW
« no previous file with comments | « fpdfsdk/src/fsdk_annothandler.cpp ('k') | fpdfsdk/src/fsdk_baseform.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698