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

Side by Side Diff: core/fpdfapi/fpdf_parser/fpdf_parser_utility.cpp

Issue 1885973002: Remove implicit cast from CFX_ByteString to (const char*). (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Typo Created 4 years, 8 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
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/fpdfapi/fpdf_parser/fpdf_parser_utility.h" 7 #include "core/fpdfapi/fpdf_parser/fpdf_parser_utility.h"
8 8
9 #include "core/fpdfapi/fpdf_parser/include/cpdf_array.h" 9 #include "core/fpdfapi/fpdf_parser/include/cpdf_array.h"
10 #include "core/fpdfapi/fpdf_parser/include/cpdf_dictionary.h" 10 #include "core/fpdfapi/fpdf_parser/include/cpdf_dictionary.h"
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 } 105 }
106 } 106 }
107 result.ReleaseBuffer((FX_STRSIZE)(pDest - pDestStart)); 107 result.ReleaseBuffer((FX_STRSIZE)(pDest - pDestStart));
108 return result; 108 return result;
109 } 109 }
110 110
111 CFX_ByteString PDF_NameDecode(const CFX_ByteString& orig) { 111 CFX_ByteString PDF_NameDecode(const CFX_ByteString& orig) {
112 if (!FXSYS_memchr(orig.c_str(), '#', orig.GetLength())) { 112 if (!FXSYS_memchr(orig.c_str(), '#', orig.GetLength())) {
113 return orig; 113 return orig;
114 } 114 }
115 return PDF_NameDecode(CFX_ByteStringC(orig)); 115 return PDF_NameDecode(orig.AsStringC());
116 } 116 }
117 117
118 CFX_ByteString PDF_NameEncode(const CFX_ByteString& orig) { 118 CFX_ByteString PDF_NameEncode(const CFX_ByteString& orig) {
119 uint8_t* src_buf = (uint8_t*)orig.c_str(); 119 uint8_t* src_buf = (uint8_t*)orig.c_str();
120 int src_len = orig.GetLength(); 120 int src_len = orig.GetLength();
121 int dest_len = 0; 121 int dest_len = 0;
122 int i; 122 int i;
123 for (i = 0; i < src_len; i++) { 123 for (i = 0; i < src_len; i++) {
124 uint8_t ch = src_buf[i]; 124 uint8_t ch = src_buf[i];
125 if (ch >= 0x80 || PDFCharIsWhitespace(ch) || ch == '#' || 125 if (ch >= 0x80 || PDFCharIsWhitespace(ch) || ch == '#' ||
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
214 buf.AppendBlock(acc.GetData(), acc.GetSize()); 214 buf.AppendBlock(acc.GetData(), acc.GetSize());
215 buf << "\r\nendstream"; 215 buf << "\r\nendstream";
216 break; 216 break;
217 } 217 }
218 default: 218 default:
219 ASSERT(FALSE); 219 ASSERT(FALSE);
220 break; 220 break;
221 } 221 }
222 return buf; 222 return buf;
223 } 223 }
OLDNEW
« no previous file with comments | « core/fpdfapi/fpdf_parser/cpdf_syntax_parser.cpp ('k') | core/fpdfapi/fpdf_render/fpdf_render_text.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698