| 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/include/fxfa/xfa_fontmgr.h" | 7 #include "xfa/include/fxfa/xfa_fontmgr.h" |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 | 10 |
| (...skipping 1843 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1854 } | 1854 } |
| 1855 pFontSetDict = (CPDF_Dictionary*)pFontSetDict->GetDictBy("Font"); | 1855 pFontSetDict = (CPDF_Dictionary*)pFontSetDict->GetDictBy("Font"); |
| 1856 if (!pFontSetDict) { | 1856 if (!pFontSetDict) { |
| 1857 return NULL; | 1857 return NULL; |
| 1858 } | 1858 } |
| 1859 strPsName.Remove(' '); | 1859 strPsName.Remove(' '); |
| 1860 IFX_FontMgr* pFDEFontMgr = m_pDoc->GetApp()->GetFDEFontMgr(); | 1860 IFX_FontMgr* pFDEFontMgr = m_pDoc->GetApp()->GetFDEFontMgr(); |
| 1861 for (const auto& it : *pFontSetDict) { | 1861 for (const auto& it : *pFontSetDict) { |
| 1862 const CFX_ByteString& key = it.first; | 1862 const CFX_ByteString& key = it.first; |
| 1863 CPDF_Object* pObj = it.second; | 1863 CPDF_Object* pObj = it.second; |
| 1864 if (!PsNameMatchDRFontName(strPsName, bBold, bItalic, key, bStrictMatch)) { | 1864 if (!PsNameMatchDRFontName(strPsName.AsByteStringC(), bBold, bItalic, key, |
| 1865 bStrictMatch)) { |
| 1865 continue; | 1866 continue; |
| 1866 } | 1867 } |
| 1867 CPDF_Object* pDirect = pObj->GetDirect(); | 1868 CPDF_Object* pDirect = pObj->GetDirect(); |
| 1868 if (!pDirect || !pDirect->IsDictionary()) { | 1869 if (!pDirect || !pDirect->IsDictionary()) { |
| 1869 return NULL; | 1870 return NULL; |
| 1870 } | 1871 } |
| 1871 CPDF_Dictionary* pFontDict = (CPDF_Dictionary*)pDirect; | 1872 CPDF_Dictionary* pFontDict = (CPDF_Dictionary*)pDirect; |
| 1872 if (pFontDict->GetStringBy("Type") != "Font") { | 1873 if (pFontDict->GetStringBy("Type") != "Font") { |
| 1873 return NULL; | 1874 return NULL; |
| 1874 } | 1875 } |
| (...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2073 CXFA_PDFFontMgr* pMgr = NULL; | 2074 CXFA_PDFFontMgr* pMgr = NULL; |
| 2074 m_PDFFontMgrArray.GetNextAssoc(ps, (void*&)hDoc, (void*&)pMgr); | 2075 m_PDFFontMgrArray.GetNextAssoc(ps, (void*&)hDoc, (void*&)pMgr); |
| 2075 delete pMgr; | 2076 delete pMgr; |
| 2076 } | 2077 } |
| 2077 m_PDFFontMgrArray.RemoveAll(); | 2078 m_PDFFontMgrArray.RemoveAll(); |
| 2078 m_FontMap.clear(); | 2079 m_FontMap.clear(); |
| 2079 } | 2080 } |
| 2080 void CXFA_FontMgr::SetDefFontMgr(CXFA_DefFontMgr* pFontMgr) { | 2081 void CXFA_FontMgr::SetDefFontMgr(CXFA_DefFontMgr* pFontMgr) { |
| 2081 m_pDefFontMgr = pFontMgr; | 2082 m_pDefFontMgr = pFontMgr; |
| 2082 } | 2083 } |
| OLD | NEW |