summaryrefslogtreecommitdiff
path: root/fpdfsdk/src/fpdftext.cpp
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2015-11-25 16:05:49 -0800
committerTom Sepez <tsepez@chromium.org>2015-11-25 16:05:49 -0800
commit51da093564cdfd32a6ac02ad75e981787a0f1b35 (patch)
tree9885c9445759de43e45db33a975b79de45b8dd8a /fpdfsdk/src/fpdftext.cpp
parent43dd873cb0e92ca777d3ed9d905bc7955556220b (diff)
downloadpdfium-51da093564cdfd32a6ac02ad75e981787a0f1b35.tar.xz
Inflict PDF_ENABLE_XFA ifdefs on XFA fpdfsdk/
R=thestig@chromium.org Review URL: https://codereview.chromium.org/1477583002 .
Diffstat (limited to 'fpdfsdk/src/fpdftext.cpp')
-rw-r--r--fpdfsdk/src/fpdftext.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/fpdfsdk/src/fpdftext.cpp b/fpdfsdk/src/fpdftext.cpp
index ac4e01e2bc..741bbe718d 100644
--- a/fpdfsdk/src/fpdftext.cpp
+++ b/fpdfsdk/src/fpdftext.cpp
@@ -6,8 +6,10 @@
#include "public/fpdf_text.h"
+#ifdef PDF_ENABLE_XFA
#include "../include/fpdfxfa/fpdfxfa_doc.h"
#include "../include/fpdfxfa/fpdfxfa_page.h"
+#endif
#include "core/include/fpdfdoc/fpdf_doc.h"
#include "core/include/fpdftext/fpdf_text.h"
#include "fpdfsdk/include/fsdk_define.h"
@@ -20,9 +22,13 @@ DLLEXPORT FPDF_TEXTPAGE STDCALL FPDFText_LoadPage(FPDF_PAGE page) {
CPDF_Page* pPDFPage = CPDFPageFromFPDFPage(page);
if (!pPDFPage)
return nullptr;
+#ifndef PDF_ENABLE_XFA
+ CPDF_ViewerPreferences viewRef(pPDFPage->m_pDocument);
+#else
CPDFXFA_Page* pPage = (CPDFXFA_Page*)page;
CPDFXFA_Document* pDoc = pPage->GetDocument();
CPDF_ViewerPreferences viewRef(pDoc->GetPDFDoc());
+#endif
IPDF_TextPage* textpage =
IPDF_TextPage::CreateTextPage(pPDFPage, viewRef.IsDirectionR2L());
textpage->ParseTextPage();