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

Side by Side Diff: xfa/src/fxfa/src/app/xfa_fontmgr.cpp

Issue 1153553003: Make CPDFXFA_App / IXFA_AppProvider saner (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: Address comments. Created 5 years, 7 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/src/fxfa/src/app/xfa_fontmgr.h ('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 "../../../foxitlib.h" 7 #include "../../../foxitlib.h"
8 #include "../common/xfa_common.h" 8 #include "../common/xfa_common.h"
9 #include "xfa_fontmgr.h" 9 #include "xfa_fontmgr.h"
10 #include "xfa_ffdoc.h" 10 #include "xfa_ffdoc.h"
(...skipping 992 matching lines...) Expand 10 before | Expand all | Expand 10 after
1003 iStart = iMid + 1; 1003 iStart = iMid + 1;
1004 } else { 1004 } else {
1005 iEnd = iMid - 1; 1005 iEnd = iMid - 1;
1006 } 1006 }
1007 } while (iEnd >= iStart); 1007 } while (iEnd >= iStart);
1008 return pFontInfo; 1008 return pFontInfo;
1009 #else 1009 #else
1010 return NULL; 1010 return NULL;
1011 #endif 1011 #endif
1012 } 1012 }
1013 IXFA_FontMgr* XFA_GetDefaultFontMgr() 1013 // static
1014 IXFA_FontMgr* IXFA_FontMgr::CreateDefault()
1014 { 1015 {
1015 return FX_NEW CXFA_DefFontMgr; 1016 return FX_NEW CXFA_DefFontMgr;
1016 } 1017 }
1018 // virtual
1019 IXFA_FontMgr::~IXFA_FontMgr()
1020 {
1021 }
1017 CXFA_DefFontMgr::~CXFA_DefFontMgr() 1022 CXFA_DefFontMgr::~CXFA_DefFontMgr()
1018 { 1023 {
1019 FX_INT32 iCounts = m_CacheFonts.GetSize(); 1024 FX_INT32 iCounts = m_CacheFonts.GetSize();
1020 for (FX_INT32 i = 0; i < iCounts; i++) { 1025 for (FX_INT32 i = 0; i < iCounts; i++) {
1021 ((IFX_Font*)m_CacheFonts[i])->Release(); 1026 ((IFX_Font*)m_CacheFonts[i])->Release();
1022 } 1027 }
1023 m_CacheFonts.RemoveAll(); 1028 m_CacheFonts.RemoveAll();
1024 } 1029 }
1025 #define _FXFA_USEGASFONTMGR_ 1030 #define _FXFA_USEGASFONTMGR_
1026 IFX_Font* CXFA_DefFontMgr::GetFont(XFA_HDOC hDoc, FX_WSTR wsFontFamily, FX_DWORD dwFontStyles, FX_WORD wCodePage ) 1031 IFX_Font* CXFA_DefFontMgr::GetFont(XFA_HDOC hDoc, FX_WSTR wsFontFamily, FX_DWORD dwFontStyles, FX_WORD wCodePage )
(...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after
1370 delete pMgr; 1375 delete pMgr;
1371 } 1376 }
1372 } 1377 }
1373 m_PDFFontMgrArray.RemoveAll(); 1378 m_PDFFontMgrArray.RemoveAll();
1374 m_FontArray.RemoveAll(); 1379 m_FontArray.RemoveAll();
1375 } 1380 }
1376 void CXFA_FontMgr::SetDefFontMgr(IXFA_FontMgr* pFontMgr) 1381 void CXFA_FontMgr::SetDefFontMgr(IXFA_FontMgr* pFontMgr)
1377 { 1382 {
1378 m_pDefFontMgr = pFontMgr; 1383 m_pDefFontMgr = pFontMgr;
1379 } 1384 }
OLDNEW
« no previous file with comments | « xfa/src/fxfa/src/app/xfa_fontmgr.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698