Collapse some more xfa/non-xfa code in cpdfsdk annots.
cpdfsdk_annot.cpp:315 and cpdfsdk_annot.cpp:338 are nearly identical,
except that the #ifdef XFA code passed along the correct type from
the argument. Prefer this behaviour even when non-XFA.
Change-Id: Id4d5fbcc773ffd10746c4ddc77a571e818e5a957
Reviewed-on: https://pdfium-review.googlesource.com/35030
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
diff --git a/fpdfsdk/cpdfsdk_annot.cpp b/fpdfsdk/cpdfsdk_annot.cpp
index 6c17628..cfd87b3 100644
--- a/fpdfsdk/cpdfsdk_annot.cpp
+++ b/fpdfsdk/cpdfsdk_annot.cpp
@@ -75,10 +75,11 @@
IPDF_Page* CPDFSDK_Annot::GetPage() {
#ifdef PDF_ENABLE_XFA
- return GetPDFXFAPage();
-#else // PDF_ENABLE_XFA
- return GetPDFPage();
+ CPDFXFA_Page* pXFAPage = GetPDFXFAPage();
+ if (pXFAPage)
+ return pXFAPage;
#endif // PDF_ENABLE_XFA
+ return GetPDFPage();
}
CPDF_Page* CPDFSDK_Annot::GetPDFPage() {