Chromium Code Reviews| 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/fpdfview.h" | 7 #include "public/fpdfview.h" |
| 8 | 8 |
| 9 #include <memory> | 9 #include <memory> |
| 10 | 10 |
| (...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 274 void SetLastError(int err) { | 274 void SetLastError(int err) { |
| 275 g_LastError = err; | 275 g_LastError = err; |
| 276 } | 276 } |
| 277 | 277 |
| 278 int GetLastError() { | 278 int GetLastError() { |
| 279 return g_LastError; | 279 return g_LastError; |
| 280 } | 280 } |
| 281 #endif // _WIN32 | 281 #endif // _WIN32 |
| 282 | 282 |
| 283 void ProcessParseError(CPDF_Parser::Error err) { | 283 void ProcessParseError(CPDF_Parser::Error err) { |
| 284 FX_DWORD err_code; | 284 FX_DWORD err_code = FPDF_ERR_SUCCESS; |
| 285 // Translate FPDFAPI error code to FPDFVIEW error code | 285 // Translate FPDFAPI error code to FPDFVIEW error code |
| 286 switch (err) { | 286 switch (err) { |
|
Tom Sepez
2016/03/16 18:35:00
Strage, we're not missing coverage for one of thes
Wei Li
2016/03/17 02:24:06
Acknowledged.
| |
| 287 case CPDF_Parser::SUCCESS: | 287 case CPDF_Parser::SUCCESS: |
| 288 err_code = FPDF_ERR_SUCCESS; | 288 err_code = FPDF_ERR_SUCCESS; |
| 289 break; | 289 break; |
| 290 case CPDF_Parser::FILE_ERROR: | 290 case CPDF_Parser::FILE_ERROR: |
| 291 err_code = FPDF_ERR_FILE; | 291 err_code = FPDF_ERR_FILE; |
| 292 break; | 292 break; |
| 293 case CPDF_Parser::FORMAT_ERROR: | 293 case CPDF_Parser::FORMAT_ERROR: |
| 294 err_code = FPDF_ERR_FORMAT; | 294 err_code = FPDF_ERR_FORMAT; |
| 295 break; | 295 break; |
| 296 case CPDF_Parser::PASSWORD_ERROR: | 296 case CPDF_Parser::PASSWORD_ERROR: |
| (...skipping 860 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1157 if (!buffer) { | 1157 if (!buffer) { |
| 1158 *buflen = len; | 1158 *buflen = len; |
| 1159 } else if (*buflen >= len) { | 1159 } else if (*buflen >= len) { |
| 1160 memcpy(buffer, utf16Name.c_str(), len); | 1160 memcpy(buffer, utf16Name.c_str(), len); |
| 1161 *buflen = len; | 1161 *buflen = len; |
| 1162 } else { | 1162 } else { |
| 1163 *buflen = -1; | 1163 *buflen = -1; |
| 1164 } | 1164 } |
| 1165 return (FPDF_DEST)pDestObj; | 1165 return (FPDF_DEST)pDestObj; |
| 1166 } | 1166 } |
| OLD | NEW |