Wrap a couple CPDFSDK_FormFillEnvironment methods inside ifdefs.
They are only used when PDF_ENABLE_V8 is set.
Change-Id: I8cc9ea9b5ebb3bb63639dc9775a86b31ddbeb618
Reviewed-on: https://pdfium-review.googlesource.com/c/48630
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
diff --git a/fpdfsdk/cpdfsdk_formfillenvironment.cpp b/fpdfsdk/cpdfsdk_formfillenvironment.cpp
index f016ff4..de3587e 100644
--- a/fpdfsdk/cpdfsdk_formfillenvironment.cpp
+++ b/fpdfsdk/cpdfsdk_formfillenvironment.cpp
@@ -291,6 +291,7 @@
m_pInfo->FFI_OnChange(m_pInfo);
}
+#ifdef PDF_ENABLE_V8
FPDF_PAGE CPDFSDK_FormFillEnvironment::GetCurrentPage() const {
if (m_pInfo && m_pInfo->FFI_GetCurrentPage) {
return m_pInfo->FFI_GetCurrentPage(
@@ -298,6 +299,7 @@
}
return nullptr;
}
+#endif
void CPDFSDK_FormFillEnvironment::ExecuteNamedAction(const char* namedAction) {
if (m_pInfo && m_pInfo->FFI_ExecuteNamedAction)
@@ -543,10 +545,12 @@
return pPageView;
}
+#ifdef PDF_ENABLE_V8
CPDFSDK_PageView* CPDFSDK_FormFillEnvironment::GetCurrentView() {
IPDF_Page* pPage = IPDFPageFromFPDFPage(GetCurrentPage());
return pPage ? GetPageView(pPage, true) : nullptr;
}
+#endif
CPDFSDK_PageView* CPDFSDK_FormFillEnvironment::GetPageView(int nIndex) {
IPDF_Page* pTempPage = GetPage(nIndex);
diff --git a/fpdfsdk/cpdfsdk_formfillenvironment.h b/fpdfsdk/cpdfsdk_formfillenvironment.h
index cd04451..a61a157 100644
--- a/fpdfsdk/cpdfsdk_formfillenvironment.h
+++ b/fpdfsdk/cpdfsdk_formfillenvironment.h
@@ -54,7 +54,9 @@
CPDFSDK_PageView* GetPageView(IPDF_Page* pPage, bool renew);
CPDFSDK_PageView* GetPageView(int nIndex);
+#ifdef PDF_ENABLE_V8
CPDFSDK_PageView* GetCurrentView();
+#endif
void RemovePageView(IPDF_Page* pPage);
void UpdateAllViews(CPDFSDK_PageView* pSender, CPDFSDK_Annot* pAnnot);
@@ -89,7 +91,9 @@
int SetTimer(int uElapse, TimerCallback lpTimerFunc);
void KillTimer(int nTimerID);
+#ifdef PDF_ENABLE_V8
FPDF_PAGE GetCurrentPage() const;
+#endif
void OnChange();
void ExecuteNamedAction(const char* namedAction);