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

Side by Side Diff: core/src/fxge/ge/fx_ge_fontmap.cpp

Issue 1406363002: Don't bother passing -1 as the length to the CFX_ByteString ctor. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 5 years, 2 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/src/fpdftext/fpdf_text.cpp ('k') | core/src/fxge/win32/fx_win32_device.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 <limits> 7 #include <limits>
8 8
9 #include "../../../include/fxge/fx_ge.h" 9 #include "../../../include/fxge/fx_ge.h"
10 #include "../../../include/fxge/fx_freetype.h" 10 #include "../../../include/fxge/fx_freetype.h"
(...skipping 437 matching lines...) Expand 10 before | Expand all | Expand 10 after
448 void CFX_FontMapper::SetSystemFontInfo(IFX_SystemFontInfo* pFontInfo) { 448 void CFX_FontMapper::SetSystemFontInfo(IFX_SystemFontInfo* pFontInfo) {
449 if (pFontInfo == NULL) { 449 if (pFontInfo == NULL) {
450 return; 450 return;
451 } 451 }
452 if (m_pFontInfo) { 452 if (m_pFontInfo) {
453 m_pFontInfo->Release(); 453 m_pFontInfo->Release();
454 } 454 }
455 m_pFontInfo = pFontInfo; 455 m_pFontInfo = pFontInfo;
456 } 456 }
457 static CFX_ByteString _TT_NormalizeName(const FX_CHAR* family) { 457 static CFX_ByteString _TT_NormalizeName(const FX_CHAR* family) {
458 CFX_ByteString norm(family, -1); 458 CFX_ByteString norm(family);
459 norm.Remove(' '); 459 norm.Remove(' ');
460 norm.Remove('-'); 460 norm.Remove('-');
461 norm.Remove(','); 461 norm.Remove(',');
462 int pos = norm.Find('+'); 462 int pos = norm.Find('+');
463 if (pos > 0) { 463 if (pos > 0) {
464 norm = norm.Left(pos); 464 norm = norm.Left(pos);
465 } 465 }
466 norm.MakeLower(); 466 norm.MakeLower();
467 return norm; 467 return norm;
468 } 468 }
(...skipping 1095 matching lines...) Expand 10 before | Expand all | Expand 10 after
1564 int PDF_GetStandardFontName(CFX_ByteString* name) { 1564 int PDF_GetStandardFontName(CFX_ByteString* name) {
1565 AltFontName* found = static_cast<AltFontName*>( 1565 AltFontName* found = static_cast<AltFontName*>(
1566 FXSYS_bsearch(name->c_str(), g_AltFontNames, FX_ArraySize(g_AltFontNames), 1566 FXSYS_bsearch(name->c_str(), g_AltFontNames, FX_ArraySize(g_AltFontNames),
1567 sizeof(AltFontName), compareString)); 1567 sizeof(AltFontName), compareString));
1568 if (!found) 1568 if (!found)
1569 return -1; 1569 return -1;
1570 1570
1571 *name = g_Base14FontNames[found->m_Index]; 1571 *name = g_Base14FontNames[found->m_Index];
1572 return found->m_Index; 1572 return found->m_Index;
1573 } 1573 }
OLDNEW
« no previous file with comments | « core/src/fpdftext/fpdf_text.cpp ('k') | core/src/fxge/win32/fx_win32_device.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698