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

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

Issue 1406303006: Merge to XFA: Don't bother passing -1 as the length to the CFX_ByteString ctor. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
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 445 matching lines...) Expand 10 before | Expand all | Expand 10 after
456 void CFX_FontMapper::SetSystemFontInfo(IFX_SystemFontInfo* pFontInfo) { 456 void CFX_FontMapper::SetSystemFontInfo(IFX_SystemFontInfo* pFontInfo) {
457 if (pFontInfo == NULL) { 457 if (pFontInfo == NULL) {
458 return; 458 return;
459 } 459 }
460 if (m_pFontInfo) { 460 if (m_pFontInfo) {
461 m_pFontInfo->Release(); 461 m_pFontInfo->Release();
462 } 462 }
463 m_pFontInfo = pFontInfo; 463 m_pFontInfo = pFontInfo;
464 } 464 }
465 static CFX_ByteString _TT_NormalizeName(const FX_CHAR* family) { 465 static CFX_ByteString _TT_NormalizeName(const FX_CHAR* family) {
466 CFX_ByteString norm(family, -1); 466 CFX_ByteString norm(family);
467 norm.Remove(' '); 467 norm.Remove(' ');
468 norm.Remove('-'); 468 norm.Remove('-');
469 norm.Remove(','); 469 norm.Remove(',');
470 int pos = norm.Find('+'); 470 int pos = norm.Find('+');
471 if (pos > 0) { 471 if (pos > 0) {
472 norm = norm.Left(pos); 472 norm = norm.Left(pos);
473 } 473 }
474 norm.MakeLower(); 474 norm.MakeLower();
475 return norm; 475 return norm;
476 } 476 }
(...skipping 1186 matching lines...) Expand 10 before | Expand all | Expand 10 after
1663 int PDF_GetStandardFontName(CFX_ByteString* name) { 1663 int PDF_GetStandardFontName(CFX_ByteString* name) {
1664 AltFontName* found = static_cast<AltFontName*>( 1664 AltFontName* found = static_cast<AltFontName*>(
1665 FXSYS_bsearch(name->c_str(), g_AltFontNames, FX_ArraySize(g_AltFontNames), 1665 FXSYS_bsearch(name->c_str(), g_AltFontNames, FX_ArraySize(g_AltFontNames),
1666 sizeof(AltFontName), compareString)); 1666 sizeof(AltFontName), compareString));
1667 if (!found) 1667 if (!found)
1668 return -1; 1668 return -1;
1669 1669
1670 *name = g_Base14FontNames[found->m_Index]; 1670 *name = g_Base14FontNames[found->m_Index];
1671 return found->m_Index; 1671 return found->m_Index;
1672 } 1672 }
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