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

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

Issue 1853233002: Make down-conversion explicit from CFX_ByteString to CFX_ByteStringC. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Fix CPDF_Name::GetConstString() Created 4 years, 8 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/fxfa/app/xfa_fftextedit.cpp ('k') | xfa/fxfa/fm2js/xfa_fm2jscontext.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 "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
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
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 }
OLDNEW
« no previous file with comments | « xfa/fxfa/app/xfa_fftextedit.cpp ('k') | xfa/fxfa/fm2js/xfa_fm2jscontext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698