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

Side by Side Diff: fpdfsdk/src/fpdfview.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/src/fpdftext.cpp ('k') | fpdfsdk/src/fsdk_mgr.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 "../../core/include/fpdfapi/fpdf_module.h" 7 #include "../../core/include/fpdfapi/fpdf_module.h"
8 #include "../../core/include/fxcodec/fx_codec.h" 8 #include "../../core/include/fxcodec/fx_codec.h"
9 #include "../../core/include/fxcrt/fx_safe_types.h" 9 #include "../../core/include/fxcrt/fx_safe_types.h"
10 #include "../../public/fpdf_ext.h" 10 #include "../../public/fpdf_ext.h"
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after
293 else 293 else
294 *docType = DOCTYPE_STATIC_XFA; 294 *docType = DOCTYPE_STATIC_XFA;
295 295
296 return TRUE; 296 return TRUE;
297 } 297 }
298 298
299 DLLEXPORT FPDF_BOOL STDCALL FPDF_LoadXFA(FPDF_DOCUMENT document) { 299 DLLEXPORT FPDF_BOOL STDCALL FPDF_LoadXFA(FPDF_DOCUMENT document) {
300 return document && (static_cast<CPDFXFA_Document*>(document))->LoadXFADoc(); 300 return document && (static_cast<CPDFXFA_Document*>(document))->LoadXFADoc();
301 } 301 }
302 302
303 extern void CheckUnSupportError(CPDF_Document* pDoc, FX_DWORD err_code);
304
305 class CMemFile final : public IFX_FileRead { 303 class CMemFile final : public IFX_FileRead {
306 public: 304 public:
307 CMemFile(uint8_t* pBuf, FX_FILESIZE size) : m_pBuf(pBuf), m_size(size) {} 305 CMemFile(uint8_t* pBuf, FX_FILESIZE size) : m_pBuf(pBuf), m_size(size) {}
308 306
309 virtual void Release() { delete this; } 307 virtual void Release() { delete this; }
310 virtual FX_FILESIZE GetSize() { return m_size; } 308 virtual FX_FILESIZE GetSize() { return m_size; }
311 virtual FX_BOOL ReadBlock(void* buffer, FX_FILESIZE offset, size_t size) { 309 virtual FX_BOOL ReadBlock(void* buffer, FX_FILESIZE offset, size_t size) {
312 if (offset < 0) { 310 if (offset < 0) {
313 return FALSE; 311 return FALSE;
314 } 312 }
(...skipping 779 matching lines...) Expand 10 before | Expand all | Expand 10 after
1094 if (!buffer) { 1092 if (!buffer) {
1095 *buflen = len; 1093 *buflen = len;
1096 } else if (*buflen >= len) { 1094 } else if (*buflen >= len) {
1097 memcpy(buffer, utf16Name.c_str(), len); 1095 memcpy(buffer, utf16Name.c_str(), len);
1098 *buflen = len; 1096 *buflen = len;
1099 } else { 1097 } else {
1100 *buflen = -1; 1098 *buflen = -1;
1101 } 1099 }
1102 return (FPDF_DEST)pDestObj; 1100 return (FPDF_DEST)pDestObj;
1103 } 1101 }
OLDNEW
« no previous file with comments | « fpdfsdk/src/fpdftext.cpp ('k') | fpdfsdk/src/fsdk_mgr.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698