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

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

Issue 2509123002: Make CPDF_Object subclass constructors intern strings (Closed)
Patch Set: Nits Created 4 years, 1 month 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/fxcrt/cfx_weak_ptr.h ('k') | fpdfsdk/fpdfdoc_unittest.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 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
177 } 177 }
178 178
179 if (pStreamDict) { 179 if (pStreamDict) {
180 CPDF_Dictionary* pStreamResList = pStreamDict->GetDictFor("Resources"); 180 CPDF_Dictionary* pStreamResList = pStreamDict->GetDictFor("Resources");
181 if (!pStreamResList) { 181 if (!pStreamResList) {
182 pStreamResList = new CPDF_Dictionary(m_pDocument->GetByteStringPool()); 182 pStreamResList = new CPDF_Dictionary(m_pDocument->GetByteStringPool());
183 pStreamDict->SetFor("Resources", pStreamResList); 183 pStreamDict->SetFor("Resources", pStreamResList);
184 } 184 }
185 CPDF_Dictionary* pStreamResFontList = pStreamResList->GetDictFor("Font"); 185 CPDF_Dictionary* pStreamResFontList = pStreamResList->GetDictFor("Font");
186 if (!pStreamResFontList) { 186 if (!pStreamResFontList) {
187 pStreamResFontList = m_pDocument->NewIndirect<CPDF_Dictionary>( 187 pStreamResFontList = m_pDocument->NewIndirect<CPDF_Dictionary>();
188 m_pDocument->GetByteStringPool());
189 pStreamResList->SetReferenceFor("Font", m_pDocument, pStreamResFontList); 188 pStreamResList->SetReferenceFor("Font", m_pDocument, pStreamResFontList);
190 } 189 }
191 if (!pStreamResFontList->KeyExist(sAlias)) { 190 if (!pStreamResFontList->KeyExist(sAlias)) {
192 pStreamResFontList->SetReferenceFor(sAlias, m_pDocument, 191 pStreamResFontList->SetReferenceFor(sAlias, m_pDocument,
193 pFont->GetFontDict()->GetObjNum()); 192 pFont->GetFontDict()->GetObjNum());
194 } 193 }
195 } 194 }
196 } 195 }
197 196
198 CPDF_Font* CBA_FontMap::GetAnnotDefaultFont(CFX_ByteString& sAlias) { 197 CPDF_Font* CBA_FontMap::GetAnnotDefaultFont(CFX_ByteString& sAlias) {
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
242 241
243 return pFontDict ? m_pDocument->LoadFont(pFontDict) : nullptr; 242 return pFontDict ? m_pDocument->LoadFont(pFontDict) : nullptr;
244 } 243 }
245 244
246 void CBA_FontMap::SetAPType(const CFX_ByteString& sAPType) { 245 void CBA_FontMap::SetAPType(const CFX_ByteString& sAPType) {
247 m_sAPType = sAPType; 246 m_sAPType = sAPType;
248 247
249 Reset(); 248 Reset();
250 Initialize(); 249 Initialize();
251 } 250 }
OLDNEW
« no previous file with comments | « core/fxcrt/cfx_weak_ptr.h ('k') | fpdfsdk/fpdfdoc_unittest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698