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

Side by Side Diff: fpdfsdk/formfiller/cba_fontmap.cpp

Issue 2425783002: Revert "Make CPDF_Object containers hold objects via unique pointers." (Closed)
Patch Set: Created 4 years, 2 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 | « core/fpdfdoc/cpdf_interform.cpp ('k') | fpdfsdk/fpdf_flatten.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 "fpdfsdk/formfiller/cba_fontmap.h" 7 #include "fpdfsdk/formfiller/cba_fontmap.h"
8 8
9 #include "core/fpdfapi/font/cpdf_font.h" 9 #include "core/fpdfapi/font/cpdf_font.h"
10 #include "core/fpdfapi/page/cpdf_page.h" 10 #include "core/fpdfapi/page/cpdf_page.h"
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 return nullptr; 112 return nullptr;
113 113
114 CPDF_Dictionary* pFonts = pResDict->GetDictFor("Font"); 114 CPDF_Dictionary* pFonts = pResDict->GetDictFor("Font");
115 if (!pFonts) 115 if (!pFonts)
116 return nullptr; 116 return nullptr;
117 117
118 CPDF_Document* pDocument = GetDocument(); 118 CPDF_Document* pDocument = GetDocument();
119 CPDF_Font* pFind = nullptr; 119 CPDF_Font* pFind = nullptr;
120 for (const auto& it : *pFonts) { 120 for (const auto& it : *pFonts) {
121 const CFX_ByteString& csKey = it.first; 121 const CFX_ByteString& csKey = it.first;
122 CPDF_Object* pObj = it.second.get(); 122 CPDF_Object* pObj = it.second;
123 if (!pObj) 123 if (!pObj)
124 continue; 124 continue;
125 125
126 CPDF_Dictionary* pElement = ToDictionary(pObj->GetDirect()); 126 CPDF_Dictionary* pElement = ToDictionary(pObj->GetDirect());
127 if (!pElement) 127 if (!pElement)
128 continue; 128 continue;
129 if (pElement->GetStringFor("Type") != "Font") 129 if (pElement->GetStringFor("Type") != "Font")
130 continue; 130 continue;
131 131
132 CPDF_Font* pFont = pDocument->LoadFont(pElement); 132 CPDF_Font* pFont = pDocument->LoadFont(pElement);
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
245 245
246 return pFontDict ? m_pDocument->LoadFont(pFontDict) : nullptr; 246 return pFontDict ? m_pDocument->LoadFont(pFontDict) : nullptr;
247 } 247 }
248 248
249 void CBA_FontMap::SetAPType(const CFX_ByteString& sAPType) { 249 void CBA_FontMap::SetAPType(const CFX_ByteString& sAPType) {
250 m_sAPType = sAPType; 250 m_sAPType = sAPType;
251 251
252 Reset(); 252 Reset();
253 Initialize(); 253 Initialize();
254 } 254 }
OLDNEW
« no previous file with comments | « core/fpdfdoc/cpdf_interform.cpp ('k') | fpdfsdk/fpdf_flatten.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698