summaryrefslogtreecommitdiff
path: root/fpdfsdk/src/fpdftext.cpp
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2015-11-30 12:39:54 -0800
committerTom Sepez <tsepez@chromium.org>2015-11-30 12:39:54 -0800
commit40e9ff30b7f22b37c071dc9751f489d4cc22b0ee (patch)
tree33f50b65518fcb32bc197adc94bb0073244113e1 /fpdfsdk/src/fpdftext.cpp
parentd029d934e1a23aadc07cc99753a55b308f20ef2b (diff)
downloadpdfium-40e9ff30b7f22b37c071dc9751f489d4cc22b0ee.tar.xz
Tidy PDF_ENABLE_XFA #ifdefs in fpdfsdk.
-- label matching #endifs -- prefer #ifdef over #ifndef -- consolidate some blocks. R=ochang@chromium.org Review URL: https://codereview.chromium.org/1484843002 .
Diffstat (limited to 'fpdfsdk/src/fpdftext.cpp')
-rw-r--r--fpdfsdk/src/fpdftext.cpp17
1 files changed, 9 insertions, 8 deletions
diff --git a/fpdfsdk/src/fpdftext.cpp b/fpdfsdk/src/fpdftext.cpp
index 741bbe718d..e91da7e210 100644
--- a/fpdfsdk/src/fpdftext.cpp
+++ b/fpdfsdk/src/fpdftext.cpp
@@ -6,14 +6,15 @@
#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"
+#ifdef PDF_ENABLE_XFA
+#include "../include/fpdfxfa/fpdfxfa_doc.h"
+#include "../include/fpdfxfa/fpdfxfa_page.h"
+#endif // PDF_ENABLE_XFA
+
#ifdef _WIN32
#include <tchar.h>
#endif
@@ -22,13 +23,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
+#ifdef PDF_ENABLE_XFA
CPDFXFA_Page* pPage = (CPDFXFA_Page*)page;
CPDFXFA_Document* pDoc = pPage->GetDocument();
CPDF_ViewerPreferences viewRef(pDoc->GetPDFDoc());
-#endif
+#else // PDF_ENABLE_XFA
+ CPDF_ViewerPreferences viewRef(pPDFPage->m_pDocument);
+#endif // PDF_ENABLE_XFA
IPDF_TextPage* textpage =
IPDF_TextPage::CreateTextPage(pPDFPage, viewRef.IsDirectionR2L());
textpage->ParseTextPage();