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

Side by Side Diff: xfa/fxfa/app/xfa_fwltheme.cpp

Issue 2512213002: Clean up CFGAS_FontMgr (Closed)
Patch Set: Nits Created 4 years, 1 month 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/fgas/font/fgas_gefont.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/fxfa/app/xfa_fwltheme.h" 7 #include "xfa/fxfa/app/xfa_fwltheme.h"
8 8
9 #include "xfa/fde/tto/fde_textout.h" 9 #include "xfa/fde/tto/fde_textout.h"
10 #include "xfa/fgas/crt/fgas_codepage.h" 10 #include "xfa/fgas/crt/fgas_codepage.h"
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 m_pCalendarFont(nullptr), 61 m_pCalendarFont(nullptr),
62 m_pApp(pApp) { 62 m_pApp(pApp) {
63 m_Rect.Reset(); 63 m_Rect.Reset();
64 64
65 for (size_t i = 0; !m_pCalendarFont && i < FX_ArraySize(g_FWLTheme_CalFonts); 65 for (size_t i = 0; !m_pCalendarFont && i < FX_ArraySize(g_FWLTheme_CalFonts);
66 ++i) { 66 ++i) {
67 m_pCalendarFont = CFGAS_GEFont::LoadFont(g_FWLTheme_CalFonts[i], 0, 0, 67 m_pCalendarFont = CFGAS_GEFont::LoadFont(g_FWLTheme_CalFonts[i], 0, 0,
68 m_pApp->GetFDEFontMgr()); 68 m_pApp->GetFDEFontMgr());
69 } 69 }
70 if (!m_pCalendarFont) { 70 if (!m_pCalendarFont) {
71 #if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_
72 m_pCalendarFont = m_pApp->GetFDEFontMgr()->GetDefFontByCodePage(
73 FX_CODEPAGE_MSWin_WesternEuropean, 0, nullptr);
74 #else
75 m_pCalendarFont = m_pApp->GetFDEFontMgr()->GetFontByCodePage( 71 m_pCalendarFont = m_pApp->GetFDEFontMgr()->GetFontByCodePage(
76 FX_CODEPAGE_MSWin_WesternEuropean, 0, nullptr); 72 FX_CODEPAGE_MSWin_WesternEuropean, 0, nullptr);
77 #endif
78 } 73 }
79 74
80 ASSERT(m_pCalendarFont); 75 ASSERT(m_pCalendarFont);
81 } 76 }
82 77
83 CXFA_FWLTheme::~CXFA_FWLTheme() { 78 CXFA_FWLTheme::~CXFA_FWLTheme() {
84 m_pTextOut.reset(); 79 m_pTextOut.reset();
85 if (m_pCalendarFont) { 80 if (m_pCalendarFont) {
86 m_pCalendarFont->Release(); 81 m_pCalendarFont->Release();
87 m_pCalendarFont = nullptr; 82 m_pCalendarFont = nullptr;
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after
376 case FWL_Type::PushButton: 371 case FWL_Type::PushButton:
377 return m_pPushButtonTP.get(); 372 return m_pPushButtonTP.get();
378 case FWL_Type::Caret: 373 case FWL_Type::Caret:
379 return m_pCaretTP.get(); 374 return m_pCaretTP.get();
380 case FWL_Type::Barcode: 375 case FWL_Type::Barcode:
381 return m_pBarcodeTP.get(); 376 return m_pBarcodeTP.get();
382 default: 377 default:
383 return nullptr; 378 return nullptr;
384 } 379 }
385 } 380 }
OLDNEW
« no previous file with comments | « xfa/fgas/font/fgas_gefont.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698