| OLD | NEW |
| 1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 PDFium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
| 6 | 6 |
| 7 #include "public/fpdf_text.h" | 7 #include "public/fpdf_text.h" |
| 8 | 8 |
| 9 #include "core/fpdfapi/fpdf_page/include/cpdf_page.h" | 9 #include "core/fpdfapi/fpdf_page/include/cpdf_page.h" |
| 10 #include "core/fpdfdoc/include/fpdf_doc.h" | 10 #include "core/fpdfdoc/include/fpdf_doc.h" |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 return nullptr; | 46 return nullptr; |
| 47 | 47 |
| 48 #ifdef PDF_ENABLE_XFA | 48 #ifdef PDF_ENABLE_XFA |
| 49 CPDFXFA_Page* pPage = (CPDFXFA_Page*)page; | 49 CPDFXFA_Page* pPage = (CPDFXFA_Page*)page; |
| 50 CPDFXFA_Document* pDoc = pPage->GetDocument(); | 50 CPDFXFA_Document* pDoc = pPage->GetDocument(); |
| 51 CPDF_ViewerPreferences viewRef(pDoc->GetPDFDoc()); | 51 CPDF_ViewerPreferences viewRef(pDoc->GetPDFDoc()); |
| 52 #else // PDF_ENABLE_XFA | 52 #else // PDF_ENABLE_XFA |
| 53 CPDF_ViewerPreferences viewRef(pPDFPage->m_pDocument); | 53 CPDF_ViewerPreferences viewRef(pPDFPage->m_pDocument); |
| 54 #endif // PDF_ENABLE_XFA | 54 #endif // PDF_ENABLE_XFA |
| 55 | 55 |
| 56 CPDF_TextPage* textpage = | 56 CPDF_TextPage* textpage = new CPDF_TextPage( |
| 57 new CPDF_TextPage(pPDFPage, viewRef.IsDirectionR2L()); | 57 pPDFPage, viewRef.IsDirectionR2L() ? FPDFText_Direction::Right |
| 58 : FPDFText_Direction::Left); |
| 58 textpage->ParseTextPage(); | 59 textpage->ParseTextPage(); |
| 59 return textpage; | 60 return textpage; |
| 60 } | 61 } |
| 61 | 62 |
| 62 DLLEXPORT void STDCALL FPDFText_ClosePage(FPDF_TEXTPAGE text_page) { | 63 DLLEXPORT void STDCALL FPDFText_ClosePage(FPDF_TEXTPAGE text_page) { |
| 63 delete CPDFTextPageFromFPDFTextPage(text_page); | 64 delete CPDFTextPageFromFPDFTextPage(text_page); |
| 64 } | 65 } |
| 65 | 66 |
| 66 DLLEXPORT int STDCALL FPDFText_CountChars(FPDF_TEXTPAGE text_page) { | 67 DLLEXPORT int STDCALL FPDFText_CountChars(FPDF_TEXTPAGE text_page) { |
| 67 if (!text_page) | 68 if (!text_page) |
| (...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 337 | 338 |
| 338 *left = rectArray[rect_index].left; | 339 *left = rectArray[rect_index].left; |
| 339 *right = rectArray[rect_index].right; | 340 *right = rectArray[rect_index].right; |
| 340 *top = rectArray[rect_index].top; | 341 *top = rectArray[rect_index].top; |
| 341 *bottom = rectArray[rect_index].bottom; | 342 *bottom = rectArray[rect_index].bottom; |
| 342 } | 343 } |
| 343 | 344 |
| 344 DLLEXPORT void STDCALL FPDFLink_CloseWebLinks(FPDF_PAGELINK link_page) { | 345 DLLEXPORT void STDCALL FPDFLink_CloseWebLinks(FPDF_PAGELINK link_page) { |
| 345 delete CPDFLinkExtractFromFPDFPageLink(link_page); | 346 delete CPDFLinkExtractFromFPDFPageLink(link_page); |
| 346 } | 347 } |
| OLD | NEW |