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

Side by Side Diff: fpdfsdk/src/fpdftext.cpp

Issue 1477583002: Inflict PDF_ENABLE_XFA ifdefs on XFA fpdfsdk/ (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: Remove fsdk_actionhandler.cpp Created 5 years 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 unified diff | Download patch
« no previous file with comments | « fpdfsdk/src/fpdfsave.cpp ('k') | fpdfsdk/src/fpdfview.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #ifdef PDF_ENABLE_XFA
9 #include "../include/fpdfxfa/fpdfxfa_doc.h" 10 #include "../include/fpdfxfa/fpdfxfa_doc.h"
10 #include "../include/fpdfxfa/fpdfxfa_page.h" 11 #include "../include/fpdfxfa/fpdfxfa_page.h"
12 #endif
11 #include "core/include/fpdfdoc/fpdf_doc.h" 13 #include "core/include/fpdfdoc/fpdf_doc.h"
12 #include "core/include/fpdftext/fpdf_text.h" 14 #include "core/include/fpdftext/fpdf_text.h"
13 #include "fpdfsdk/include/fsdk_define.h" 15 #include "fpdfsdk/include/fsdk_define.h"
14 16
15 #ifdef _WIN32 17 #ifdef _WIN32
16 #include <tchar.h> 18 #include <tchar.h>
17 #endif 19 #endif
18 20
19 DLLEXPORT FPDF_TEXTPAGE STDCALL FPDFText_LoadPage(FPDF_PAGE page) { 21 DLLEXPORT FPDF_TEXTPAGE STDCALL FPDFText_LoadPage(FPDF_PAGE page) {
20 CPDF_Page* pPDFPage = CPDFPageFromFPDFPage(page); 22 CPDF_Page* pPDFPage = CPDFPageFromFPDFPage(page);
21 if (!pPDFPage) 23 if (!pPDFPage)
22 return nullptr; 24 return nullptr;
25 #ifndef PDF_ENABLE_XFA
26 CPDF_ViewerPreferences viewRef(pPDFPage->m_pDocument);
27 #else
23 CPDFXFA_Page* pPage = (CPDFXFA_Page*)page; 28 CPDFXFA_Page* pPage = (CPDFXFA_Page*)page;
24 CPDFXFA_Document* pDoc = pPage->GetDocument(); 29 CPDFXFA_Document* pDoc = pPage->GetDocument();
25 CPDF_ViewerPreferences viewRef(pDoc->GetPDFDoc()); 30 CPDF_ViewerPreferences viewRef(pDoc->GetPDFDoc());
31 #endif
26 IPDF_TextPage* textpage = 32 IPDF_TextPage* textpage =
27 IPDF_TextPage::CreateTextPage(pPDFPage, viewRef.IsDirectionR2L()); 33 IPDF_TextPage::CreateTextPage(pPDFPage, viewRef.IsDirectionR2L());
28 textpage->ParseTextPage(); 34 textpage->ParseTextPage();
29 return textpage; 35 return textpage;
30 } 36 }
31 DLLEXPORT void STDCALL FPDFText_ClosePage(FPDF_TEXTPAGE text_page) { 37 DLLEXPORT void STDCALL FPDFText_ClosePage(FPDF_TEXTPAGE text_page) {
32 delete (IPDF_TextPage*)text_page; 38 delete (IPDF_TextPage*)text_page;
33 } 39 }
34 DLLEXPORT int STDCALL FPDFText_CountChars(FPDF_TEXTPAGE text_page) { 40 DLLEXPORT int STDCALL FPDFText_CountChars(FPDF_TEXTPAGE text_page) {
35 if (!text_page) 41 if (!text_page)
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after
281 CFX_FloatRect rect = rectArray.GetAt(rect_index); 287 CFX_FloatRect rect = rectArray.GetAt(rect_index);
282 *left = rect.left; 288 *left = rect.left;
283 *right = rect.right; 289 *right = rect.right;
284 *top = rect.top; 290 *top = rect.top;
285 *bottom = rect.bottom; 291 *bottom = rect.bottom;
286 } 292 }
287 } 293 }
288 DLLEXPORT void STDCALL FPDFLink_CloseWebLinks(FPDF_PAGELINK link_page) { 294 DLLEXPORT void STDCALL FPDFLink_CloseWebLinks(FPDF_PAGELINK link_page) {
289 delete (IPDF_LinkExtract*)link_page; 295 delete (IPDF_LinkExtract*)link_page;
290 } 296 }
OLDNEW
« no previous file with comments | « fpdfsdk/src/fpdfsave.cpp ('k') | fpdfsdk/src/fpdfview.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698