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

Side by Side Diff: xfa/fgas/font/fgas_stdfontmgr.cpp

Issue 2024463002: Avoid two C-style FX_WCHAR* casts in pdfium (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 4 years, 6 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 | « xfa/fde/css/fde_csssyntax.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 "xfa/fgas/font/fgas_stdfontmgr.h" 7 #include "xfa/fgas/font/fgas_stdfontmgr.h"
8 8
9 #include "core/fxcrt/include/fx_stream.h" 9 #include "core/fxcrt/include/fx_stream.h"
10 #include "core/fxge/include/fx_ge.h" 10 #include "core/fxge/include/fx_ge.h"
(...skipping 427 matching lines...) Expand 10 before | Expand all | Expand 10 after
438 return 1; 438 return 1;
439 } 439 }
440 static void FX_EnumGdiFonts(CFX_FontDescriptors& fonts, 440 static void FX_EnumGdiFonts(CFX_FontDescriptors& fonts,
441 const FX_WCHAR* pwsFaceName, 441 const FX_WCHAR* pwsFaceName,
442 FX_WCHAR wUnicode) { 442 FX_WCHAR wUnicode) {
443 HDC hDC = ::GetDC(NULL); 443 HDC hDC = ::GetDC(NULL);
444 LOGFONTW lfFind; 444 LOGFONTW lfFind;
445 FXSYS_memset(&lfFind, 0, sizeof(lfFind)); 445 FXSYS_memset(&lfFind, 0, sizeof(lfFind));
446 lfFind.lfCharSet = DEFAULT_CHARSET; 446 lfFind.lfCharSet = DEFAULT_CHARSET;
447 if (pwsFaceName) { 447 if (pwsFaceName) {
448 FXSYS_wcsncpy((FX_WCHAR*)lfFind.lfFaceName, pwsFaceName, 31); 448 FXSYS_wcsncpy(lfFind.lfFaceName, pwsFaceName, 31);
449 lfFind.lfFaceName[31] = 0; 449 lfFind.lfFaceName[31] = 0;
450 } 450 }
451 EnumFontFamiliesExW(hDC, (LPLOGFONTW)&lfFind, 451 EnumFontFamiliesExW(hDC, (LPLOGFONTW)&lfFind,
452 (FONTENUMPROCW)FX_GdiFontEnumProc, (LPARAM)&fonts, 0); 452 (FONTENUMPROCW)FX_GdiFontEnumProc, (LPARAM)&fonts, 0);
453 ::ReleaseDC(NULL, hDC); 453 ::ReleaseDC(NULL, hDC);
454 } 454 }
455 FX_LPEnumAllFonts FX_GetDefFontEnumerator() { 455 FX_LPEnumAllFonts FX_GetDefFontEnumerator() {
456 return FX_EnumGdiFonts; 456 return FX_EnumGdiFonts;
457 } 457 }
458 #else 458 #else
(...skipping 1027 matching lines...) Expand 10 before | Expand all | Expand 10 after
1486 } 1486 }
1487 } 1487 }
1488 int32_t CFX_FontMgrImp::IsPartName(const CFX_WideString& Name1, 1488 int32_t CFX_FontMgrImp::IsPartName(const CFX_WideString& Name1,
1489 const CFX_WideString& Name2) { 1489 const CFX_WideString& Name2) {
1490 if (Name1.Find(Name2.c_str()) != -1) { 1490 if (Name1.Find(Name2.c_str()) != -1) {
1491 return 1; 1491 return 1;
1492 } 1492 }
1493 return 0; 1493 return 0;
1494 } 1494 }
1495 #endif 1495 #endif
OLDNEW
« no previous file with comments | « xfa/fde/css/fde_csssyntax.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698