summaryrefslogtreecommitdiff
path: root/fpdfsdk/src/fpdftext.cpp
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2015-11-25 15:15:31 -0800
committerTom Sepez <tsepez@chromium.org>2015-11-25 15:15:31 -0800
commit1b2462846b5deee5b142251cbe2bb7d7c07df41b (patch)
tree4338992c2fe5d005c0cbbd5d1a68b54eb3fe1709 /fpdfsdk/src/fpdftext.cpp
parent5c4c193fd4b6dd0657abf5e74125f9887f91d720 (diff)
downloadpdfium-1b2462846b5deee5b142251cbe2bb7d7c07df41b.tar.xz
XFA: More underlying types
Precursor to https://codereview.chromium.org/1477583002/ Also: whitespace in fxjs_v8.h Merge where possible. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1472363003 .
Diffstat (limited to 'fpdfsdk/src/fpdftext.cpp')
-rw-r--r--fpdfsdk/src/fpdftext.cpp13
1 files changed, 6 insertions, 7 deletions
diff --git a/fpdfsdk/src/fpdftext.cpp b/fpdfsdk/src/fpdftext.cpp
index 7675dada61..ac4e01e2bc 100644
--- a/fpdfsdk/src/fpdftext.cpp
+++ b/fpdfsdk/src/fpdftext.cpp
@@ -10,22 +10,21 @@
#include "../include/fpdfxfa/fpdfxfa_page.h"
#include "core/include/fpdfdoc/fpdf_doc.h"
#include "core/include/fpdftext/fpdf_text.h"
+#include "fpdfsdk/include/fsdk_define.h"
#ifdef _WIN32
#include <tchar.h>
#endif
DLLEXPORT FPDF_TEXTPAGE STDCALL FPDFText_LoadPage(FPDF_PAGE page) {
- if (!page)
- return NULL;
- IPDF_TextPage* textpage = NULL;
+ CPDF_Page* pPDFPage = CPDFPageFromFPDFPage(page);
+ if (!pPDFPage)
+ return nullptr;
CPDFXFA_Page* pPage = (CPDFXFA_Page*)page;
- if (!pPage->GetPDFPage())
- return NULL;
CPDFXFA_Document* pDoc = pPage->GetDocument();
CPDF_ViewerPreferences viewRef(pDoc->GetPDFDoc());
- textpage = IPDF_TextPage::CreateTextPage((CPDF_Page*)pPage->GetPDFPage(),
- viewRef.IsDirectionR2L());
+ IPDF_TextPage* textpage =
+ IPDF_TextPage::CreateTextPage(pPDFPage, viewRef.IsDirectionR2L());
textpage->ParseTextPage();
return textpage;
}