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

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

Issue 1301073003: Merge to XFA: Extern in .cpp files is a code smell, part 1. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: Created 5 years, 4 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 unified diff | Download patch
« no previous file with comments | « fpdfsdk/include/fsdk_define.h ('k') | fpdfsdk/src/fpdftext.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_dataavail.h" 7 #include "../../public/fpdf_dataavail.h"
8 #include "../../public/fpdf_formfill.h" 8 #include "../../public/fpdf_formfill.h"
9 #include "../include/fsdk_define.h" 9 #include "../include/fsdk_define.h"
10 #include "../include/fpdfxfa/fpdfxfa_doc.h" 10 #include "../include/fpdfxfa/fpdfxfa_doc.h"
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 } 91 }
92 92
93 DLLEXPORT int STDCALL FPDFAvail_IsDocAvail(FPDF_AVAIL avail, 93 DLLEXPORT int STDCALL FPDFAvail_IsDocAvail(FPDF_AVAIL avail,
94 FX_DOWNLOADHINTS* hints) { 94 FX_DOWNLOADHINTS* hints) {
95 if (avail == NULL || hints == NULL) 95 if (avail == NULL || hints == NULL)
96 return 0; 96 return 0;
97 CFPDF_DownloadHintsWrap hints_wrap(hints); 97 CFPDF_DownloadHintsWrap hints_wrap(hints);
98 return ((CFPDF_DataAvail*)avail)->m_pDataAvail->IsDocAvail(&hints_wrap); 98 return ((CFPDF_DataAvail*)avail)->m_pDataAvail->IsDocAvail(&hints_wrap);
99 } 99 }
100 100
101 extern void CheckUnSupportError(CPDF_Document* pDoc, FX_DWORD err_code);
102
103 DLLEXPORT FPDF_DOCUMENT STDCALL 101 DLLEXPORT FPDF_DOCUMENT STDCALL
104 FPDFAvail_GetDocument(FPDF_AVAIL avail, FPDF_BYTESTRING password) { 102 FPDFAvail_GetDocument(FPDF_AVAIL avail, FPDF_BYTESTRING password) {
105 if (avail == NULL) 103 if (avail == NULL)
106 return NULL; 104 return NULL;
107 CPDF_Parser* pParser = new CPDF_Parser; 105 CPDF_Parser* pParser = new CPDF_Parser;
108 pParser->SetPassword(password); 106 pParser->SetPassword(password);
109 107
110 FX_DWORD err_code = pParser->StartAsynParse( 108 FX_DWORD err_code = pParser->StartAsynParse(
111 ((CFPDF_DataAvail*)avail)->m_pDataAvail->GetFileRead()); 109 ((CFPDF_DataAvail*)avail)->m_pDataAvail->GetFileRead());
112 if (err_code) { 110 if (err_code) {
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 return -1; 143 return -1;
146 CFPDF_DownloadHintsWrap hints_wrap(hints); 144 CFPDF_DownloadHintsWrap hints_wrap(hints);
147 return ((CFPDF_DataAvail*)avail)->m_pDataAvail->IsFormAvail(&hints_wrap); 145 return ((CFPDF_DataAvail*)avail)->m_pDataAvail->IsFormAvail(&hints_wrap);
148 } 146 }
149 147
150 DLLEXPORT FPDF_BOOL STDCALL FPDFAvail_IsLinearized(FPDF_AVAIL avail) { 148 DLLEXPORT FPDF_BOOL STDCALL FPDFAvail_IsLinearized(FPDF_AVAIL avail) {
151 if (avail == NULL) 149 if (avail == NULL)
152 return -1; 150 return -1;
153 return ((CFPDF_DataAvail*)avail)->m_pDataAvail->IsLinearizedPDF(); 151 return ((CFPDF_DataAvail*)avail)->m_pDataAvail->IsLinearizedPDF();
154 } 152 }
OLDNEW
« no previous file with comments | « fpdfsdk/include/fsdk_define.h ('k') | fpdfsdk/src/fpdftext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698