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 "pageint.h" | 7 #include "pageint.h" |
8 | 8 |
9 #include "core/include/fdrm/fx_crypt.h" | 9 #include "core/include/fdrm/fx_crypt.h" |
10 #include "core/include/fpdfapi/fpdf_module.h" | 10 #include "core/include/fpdfapi/fpdf_module.h" |
(...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
300 | 300 |
301 CPDF_CountedFont* fontData = it->second; | 301 CPDF_CountedFont* fontData = it->second; |
302 if (fontData->get()) { | 302 if (fontData->get()) { |
303 fontData->RemoveRef(); | 303 fontData->RemoveRef(); |
304 if (fontData->use_count() == 0) { | 304 if (fontData->use_count() == 0) { |
305 fontData->clear(); | 305 fontData->clear(); |
306 } | 306 } |
307 } | 307 } |
308 } | 308 } |
309 | 309 |
310 CPDF_ColorSpace* CPDF_DocPageData::GetColorSpace(CPDF_Object* pCSObj, | 310 CPDF_ColorSpace* CPDF_DocPageData::GetColorSpace( |
311 CPDF_Dictionary* pResources) { | 311 CPDF_Object* pCSObj, |
| 312 const CPDF_Dictionary* pResources) { |
312 if (!pCSObj) | 313 if (!pCSObj) |
313 return nullptr; | 314 return nullptr; |
314 | 315 |
315 if (pCSObj->IsName()) { | 316 if (pCSObj->IsName()) { |
316 CFX_ByteString name = pCSObj->GetConstString(); | 317 CFX_ByteString name = pCSObj->GetConstString(); |
317 CPDF_ColorSpace* pCS = _CSFromName(name); | 318 CPDF_ColorSpace* pCS = _CSFromName(name); |
318 if (!pCS && pResources) { | 319 if (!pCS && pResources) { |
319 CPDF_Dictionary* pList = pResources->GetDict(FX_BSTRC("ColorSpace")); | 320 CPDF_Dictionary* pList = pResources->GetDict(FX_BSTRC("ColorSpace")); |
320 if (pList) { | 321 if (pList) { |
321 pCSObj = pList->GetElementValue(name); | 322 pCSObj = pList->GetElementValue(name); |
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
597 } | 598 } |
598 | 599 |
599 CPDF_CountedPattern* CPDF_DocPageData::FindPatternPtr( | 600 CPDF_CountedPattern* CPDF_DocPageData::FindPatternPtr( |
600 CPDF_Object* pPatternObj) const { | 601 CPDF_Object* pPatternObj) const { |
601 if (!pPatternObj) | 602 if (!pPatternObj) |
602 return nullptr; | 603 return nullptr; |
603 | 604 |
604 auto it = m_PatternMap.find(pPatternObj); | 605 auto it = m_PatternMap.find(pPatternObj); |
605 return it != m_PatternMap.end() ? it->second : nullptr; | 606 return it != m_PatternMap.end() ? it->second : nullptr; |
606 } | 607 } |
OLD | NEW |