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

Unified Diff: fpdfsdk/src/fpdftext.cpp

Issue 1411623002: Merge to XFA: Introduce CPDFPageFromFPFDPage() (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: Created 5 years, 2 months 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 99f282a2b56a5d82614804bc0e79ed20732d4bd1..b86156557f57950d100d8c8a5e6fab3a31301695 100644
--- a/fpdfsdk/src/fpdftext.cpp
+++ b/fpdfsdk/src/fpdftext.cpp
@@ -7,6 +7,7 @@
#include "../../core/include/fpdfdoc/fpdf_doc.h"
#include "../../core/include/fpdftext/fpdf_text.h"
#include "../../public/fpdf_text.h"
+#include "../include/fsdk_define.h"
#include "../include/fpdfxfa/fpdfxfa_doc.h"
#include "../include/fpdfxfa/fpdfxfa_page.h"
@@ -15,16 +16,13 @@
#endif
DLLEXPORT FPDF_TEXTPAGE STDCALL FPDFText_LoadPage(FPDF_PAGE page) {
- if (!page)
- return NULL;
- IPDF_TextPage* textpage = NULL;
- 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());
+ CPDF_Page* pPage = CPDFPageFromFPDFPage(page);
+ if (!pPage)
Tom Sepez 2015/10/16 00:18:55 wrong, fix.
Tom Sepez 2015/10/16 16:58:54 reverted.
+ return nullptr;
+ CPDFXFA_Page* pXFAPage = (CPDFXFA_Page*)page;
+ CPDF_ViewerPreferences viewRef(pXFAPage->m_pDocument);
+ IPDF_TextPage* textpage =
+ IPDF_TextPage::CreateTextPage(pPage, viewRef.IsDirectionR2L());
textpage->ParseTextPage();
return textpage;
}

Powered by Google App Engine
This is Rietveld 408576698