diff options
author | Tom Sepez <tsepez@chromium.org> | 2015-10-15 16:34:32 -0700 |
---|---|---|
committer | Tom Sepez <tsepez@chromium.org> | 2015-10-15 16:34:32 -0700 |
commit | 943ea142b6a7e6edc91fe3c307013129e6eb0ef3 (patch) | |
tree | 8de4aaa7bb8eb3d463246d2a2f400006e60bae99 /fpdfsdk/src/fpdftext.cpp | |
parent | b456ba7f62fa416f456ef78750c18fd2bdf837be (diff) | |
download | pdfium-943ea142b6a7e6edc91fe3c307013129e6eb0ef3.tar.xz |
Introduce CPDFPageFromFPFDPage()
Abstracts the way that pages are passed to the embedder
between XFA and master.
R=thestig@chromium.org
Review URL: https://codereview.chromium.org/1406543004 .
Diffstat (limited to 'fpdfsdk/src/fpdftext.cpp')
-rw-r--r-- | fpdfsdk/src/fpdftext.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/fpdfsdk/src/fpdftext.cpp b/fpdfsdk/src/fpdftext.cpp index 43edd525e8..800c138f3f 100644 --- a/fpdfsdk/src/fpdftext.cpp +++ b/fpdfsdk/src/fpdftext.cpp @@ -7,18 +7,19 @@ #include "../../core/include/fpdfdoc/fpdf_doc.h" #include "../../core/include/fpdftext/fpdf_text.h" #include "../../public/fpdf_text.h" +#include "../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_ViewerPreferences viewRef(((CPDF_Page*)page)->m_pDocument); - textpage = - IPDF_TextPage::CreateTextPage((CPDF_Page*)page, viewRef.IsDirectionR2L()); + CPDF_Page* pPage = CPDFPageFromFPDFPage(page); + if (!pPage) + return nullptr; + CPDF_ViewerPreferences viewRef(pPage->m_pDocument); + IPDF_TextPage* textpage = + IPDF_TextPage::CreateTextPage(pPage, viewRef.IsDirectionR2L()); textpage->ParseTextPage(); return textpage; } |