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

Unified Diff: fpdfsdk/src/fpdftext.cpp

Issue 1477583002: Inflict PDF_ENABLE_XFA ifdefs on XFA fpdfsdk/ (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: Created 5 years, 1 month 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 side-by-side diff with in-line comments
Download patch
Index: fpdfsdk/src/fpdftext.cpp
diff --git a/fpdfsdk/src/fpdftext.cpp b/fpdfsdk/src/fpdftext.cpp
index 7675dada6184fba59dc70bf7dcdcb003eebe0b76..26017fe7906050277e9ff0aa5e5b26dc78ff8ba0 100644
--- a/fpdfsdk/src/fpdftext.cpp
+++ b/fpdfsdk/src/fpdftext.cpp
@@ -6,16 +6,29 @@
#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"
+#ifndef PDF_ENABLE_XFA
+#include "fpdfsdk/include/fsdk_define.h"
+#endif
#ifdef _WIN32
#include <tchar.h>
#endif
DLLEXPORT FPDF_TEXTPAGE STDCALL FPDFText_LoadPage(FPDF_PAGE page) {
+#ifndef PDF_ENABLE_XFA
Lei Zhang 2015/11/25 00:34:30 Use UnderlyingPageType here?
Tom Sepez 2015/11/25 21:45:29 Unified a bit.
+ CPDF_Page* pPage = CPDFPageFromFPDFPage(page);
+ if (!pPage)
+ return nullptr;
+ CPDF_ViewerPreferences viewRef(pPage->m_pDocument);
+ IPDF_TextPage* textpage =
+ IPDF_TextPage::CreateTextPage(pPage, viewRef.IsDirectionR2L());
+#else
if (!page)
return NULL;
IPDF_TextPage* textpage = NULL;
@@ -26,6 +39,7 @@ DLLEXPORT FPDF_TEXTPAGE STDCALL FPDFText_LoadPage(FPDF_PAGE page) {
CPDF_ViewerPreferences viewRef(pDoc->GetPDFDoc());
textpage = IPDF_TextPage::CreateTextPage((CPDF_Page*)pPage->GetPDFPage(),
viewRef.IsDirectionR2L());
+#endif
textpage->ParseTextPage();
return textpage;
}

Powered by Google App Engine
This is Rietveld 408576698