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

Side by Side Diff: core/fpdfapi/fpdf_font/fpdf_font.cpp

Issue 1884363002: Explicity use CFX_ByteStrings in a couple of places (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: 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
« no previous file with comments | « core/fpdfapi/fpdf_edit/fpdf_edit_create.cpp ('k') | no next file » | 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/fpdfapi/fpdf_font/font_int.h" 7 #include "core/fpdfapi/fpdf_font/font_int.h"
8 8
9 #include "core/fpdfapi/fpdf_page/include/cpdf_form.h" 9 #include "core/fpdfapi/fpdf_page/include/cpdf_form.h"
10 #include "core/fpdfapi/fpdf_page/pageint.h" 10 #include "core/fpdfapi/fpdf_page/pageint.h"
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after
232 if (low.IsEmpty() || low == "endbfrange") { 232 if (low.IsEmpty() || low == "endbfrange") {
233 break; 233 break;
234 } 234 }
235 high = parser.GetWord(); 235 high = parser.GetWord();
236 uint32_t lowcode = StringToCode(low.AsStringC()); 236 uint32_t lowcode = StringToCode(low.AsStringC());
237 uint32_t highcode = 237 uint32_t highcode =
238 (lowcode & 0xffffff00) | (StringToCode(high.AsStringC()) & 0xff); 238 (lowcode & 0xffffff00) | (StringToCode(high.AsStringC()) & 0xff);
239 if (highcode == (uint32_t)-1) { 239 if (highcode == (uint32_t)-1) {
240 break; 240 break;
241 } 241 }
242 CFX_ByteString start = parser.GetWord(); 242 CFX_ByteString start(parser.GetWord());
243 if (start == "[") { 243 if (start == "[") {
244 for (uint32_t code = lowcode; code <= highcode; code++) { 244 for (uint32_t code = lowcode; code <= highcode; code++) {
245 CFX_ByteString dest = parser.GetWord(); 245 CFX_ByteString dest(parser.GetWord());
246 CFX_WideString destcode = StringToWideString(dest.AsStringC()); 246 CFX_WideString destcode = StringToWideString(dest.AsStringC());
247 int len = destcode.GetLength(); 247 int len = destcode.GetLength();
248 if (len == 0) { 248 if (len == 0) {
249 continue; 249 continue;
250 } 250 }
251 if (len == 1) { 251 if (len == 1) {
252 m_Map[code] = destcode.GetAt(0); 252 m_Map[code] = destcode.GetAt(0);
253 } else { 253 } else {
254 m_Map[code] = m_MultiCharBuf.GetLength() * 0x10000 + 0xffff; 254 m_Map[code] = m_MultiCharBuf.GetLength() * 0x10000 + 0xffff;
255 m_MultiCharBuf.AppendChar(destcode.GetLength()); 255 m_MultiCharBuf.AppendChar(destcode.GetLength());
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
294 } 294 }
295 if (cid_set) { 295 if (cid_set) {
296 m_pBaseMap = CPDF_ModuleMgr::Get() 296 m_pBaseMap = CPDF_ModuleMgr::Get()
297 ->GetPageModule() 297 ->GetPageModule()
298 ->GetFontGlobals() 298 ->GetFontGlobals()
299 ->m_CMapManager.GetCID2UnicodeMap(cid_set, FALSE); 299 ->m_CMapManager.GetCID2UnicodeMap(cid_set, FALSE);
300 } else { 300 } else {
301 m_pBaseMap = NULL; 301 m_pBaseMap = NULL;
302 } 302 }
303 } 303 }
OLDNEW
« no previous file with comments | « core/fpdfapi/fpdf_edit/fpdf_edit_create.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698