| OLD | NEW |
| 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/include/xfa_fontmgr.h" | 7 #include "xfa/fxfa/include/xfa_fontmgr.h" |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 1720 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1731 break; | 1731 break; |
| 1732 } else if (dwFontNameHash < dwCurFontNameHash) { | 1732 } else if (dwFontNameHash < dwCurFontNameHash) { |
| 1733 iStart = iMid + 1; | 1733 iStart = iMid + 1; |
| 1734 } else { | 1734 } else { |
| 1735 iEnd = iMid - 1; | 1735 iEnd = iMid - 1; |
| 1736 } | 1736 } |
| 1737 } while (iEnd >= iStart); | 1737 } while (iEnd >= iStart); |
| 1738 return pFontInfo; | 1738 return pFontInfo; |
| 1739 } | 1739 } |
| 1740 | 1740 |
| 1741 CXFA_DefFontMgr::CXFA_DefFontMgr() {} |
| 1742 |
| 1741 CXFA_DefFontMgr::~CXFA_DefFontMgr() { | 1743 CXFA_DefFontMgr::~CXFA_DefFontMgr() { |
| 1742 for (int32_t i = 0; i < m_CacheFonts.GetSize(); i++) | 1744 for (int32_t i = 0; i < m_CacheFonts.GetSize(); i++) |
| 1743 m_CacheFonts[i]->Release(); | 1745 m_CacheFonts[i]->Release(); |
| 1744 } | 1746 } |
| 1745 | 1747 |
| 1746 CFGAS_GEFont* CXFA_DefFontMgr::GetFont(CXFA_FFDoc* hDoc, | 1748 CFGAS_GEFont* CXFA_DefFontMgr::GetFont(CXFA_FFDoc* hDoc, |
| 1747 const CFX_WideStringC& wsFontFamily, | 1749 const CFX_WideStringC& wsFontFamily, |
| 1748 uint32_t dwFontStyles, | 1750 uint32_t dwFontStyles, |
| 1749 uint16_t wCodePage) { | 1751 uint16_t wCodePage) { |
| 1750 CFX_WideString wsFontName(wsFontFamily); | 1752 CFX_WideString wsFontName(wsFontFamily); |
| (...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2051 m_PDFFontMgrMap[hDoc].reset(new CXFA_PDFFontMgr(hDoc)); | 2053 m_PDFFontMgrMap[hDoc].reset(new CXFA_PDFFontMgr(hDoc)); |
| 2052 } | 2054 } |
| 2053 | 2055 |
| 2054 void CXFA_FontMgr::ReleaseDocFonts(CXFA_FFDoc* hDoc) { | 2056 void CXFA_FontMgr::ReleaseDocFonts(CXFA_FFDoc* hDoc) { |
| 2055 m_PDFFontMgrMap.erase(hDoc); | 2057 m_PDFFontMgrMap.erase(hDoc); |
| 2056 } | 2058 } |
| 2057 | 2059 |
| 2058 void CXFA_FontMgr::SetDefFontMgr(std::unique_ptr<CXFA_DefFontMgr> pFontMgr) { | 2060 void CXFA_FontMgr::SetDefFontMgr(std::unique_ptr<CXFA_DefFontMgr> pFontMgr) { |
| 2059 m_pDefFontMgr = std::move(pFontMgr); | 2061 m_pDefFontMgr = std::move(pFontMgr); |
| 2060 } | 2062 } |
| OLD | NEW |