Chromium Code Reviews

Side by Side Diff: core/src/fpdfdoc/doc_form.cpp

Issue 1103343002: Fix windows-specific usage of CFX_WideStr::operator LPCWSTR(). (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Rebase from linux side. Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff |
« no previous file with comments | « core/include/fxge/fx_ge_win32.h ('k') | core/src/fxcrt/fx_basic_util.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 "../../include/fpdfdoc/fpdf_doc.h" 7 #include "../../include/fpdfdoc/fpdf_doc.h"
8 #include "../../include/fxcrt/fx_xml.h" 8 #include "../../include/fxcrt/fx_xml.h"
9 CFX_WideString GetFullName(CPDF_Dictionary* pFieldDict); 9 CFX_WideString GetFullName(CPDF_Dictionary* pFieldDict);
10 void InitInterFormDict(CPDF_Dictionary*& pFormDict, CPDF_Docu ment* pDocument); 10 void InitInterFormDict(CPDF_Dictionary*& pFormDict, CPDF_Docu ment* pDocument);
(...skipping 447 matching lines...)
458 } 458 }
459 CPDF_Font* CPDF_InterForm::AddSystemFont(const CPDF_Document* pDocument, CFX_Wid eString csFontName, FX_BYTE iCharSet) 459 CPDF_Font* CPDF_InterForm::AddSystemFont(const CPDF_Document* pDocument, CFX_Wid eString csFontName, FX_BYTE iCharSet)
460 { 460 {
461 if (pDocument == NULL || csFontName.IsEmpty()) { 461 if (pDocument == NULL || csFontName.IsEmpty()) {
462 return NULL; 462 return NULL;
463 } 463 }
464 #if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ 464 #if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_
465 if (iCharSet == 1) { 465 if (iCharSet == 1) {
466 iCharSet = GetNativeCharSet(); 466 iCharSet = GetNativeCharSet();
467 } 467 }
468 HFONT hFont = ::CreateFontW(0, 0, 0, 0, 0, 0, 0, 0, iCharSet, OUT_DEFAULT_PR ECIS, CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH | FF_DONTCARE, csFontN ame); 468 HFONT hFont = ::CreateFontW(0, 0, 0, 0, 0, 0, 0, 0, iCharSet, OUT_DEFAULT_PR ECIS, CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH | FF_DONTCARE, csFontN ame.c_str());
469 if (hFont != NULL) { 469 if (hFont != NULL) {
470 LOGFONTA lf; 470 LOGFONTA lf;
471 memset(&lf, 0, sizeof(LOGFONTA)); 471 memset(&lf, 0, sizeof(LOGFONTA));
472 ::GetObject(hFont, sizeof(LOGFONTA), &lf); 472 ::GetObject(hFont, sizeof(LOGFONTA), &lf);
473 ::DeleteObject(hFont); 473 ::DeleteObject(hFont);
474 if (strlen(lf.lfFaceName) > 0) { 474 if (strlen(lf.lfFaceName) > 0) {
475 return ((CPDF_Document*)pDocument)->AddWindowsFont(&lf, FALSE, TRUE) ; 475 return ((CPDF_Document*)pDocument)->AddWindowsFont(&lf, FALSE, TRUE) ;
476 } 476 }
477 } 477 }
478 #endif 478 #endif
(...skipping 1171 matching lines...)
1650 continue; 1650 continue;
1651 } 1651 }
1652 CPDF_FormControl* pControl = NULL; 1652 CPDF_FormControl* pControl = NULL;
1653 if (m_ControlMap.Lookup(pAnnotDict, (void*&)pControl)) { 1653 if (m_ControlMap.Lookup(pAnnotDict, (void*&)pControl)) {
1654 return iNewPage; 1654 return iNewPage;
1655 } 1655 }
1656 } 1656 }
1657 } while (TRUE); 1657 } while (TRUE);
1658 return -1; 1658 return -1;
1659 } 1659 }
OLDNEW
« no previous file with comments | « core/include/fxge/fx_ge_win32.h ('k') | core/src/fxcrt/fx_basic_util.cpp » ('j') | no next file with comments »

Powered by Google App Engine