| 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 "core/fpdfapi/fpdf_page/pageint.h" | 7 #include "core/fpdfapi/fpdf_page/pageint.h" |
| 8 | 8 |
| 9 #include "core/fdrm/crypto/include/fx_crypt.h" | 9 #include "core/fdrm/crypto/include/fx_crypt.h" |
| 10 #include "core/fpdfapi/fpdf_font/cpdf_type1font.h" | 10 #include "core/fpdfapi/fpdf_font/cpdf_type1font.h" |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 delete imageData->get(); | 121 delete imageData->get(); |
| 122 delete imageData; | 122 delete imageData; |
| 123 m_ImageMap.erase(curr_it); | 123 m_ImageMap.erase(curr_it); |
| 124 } | 124 } |
| 125 } | 125 } |
| 126 } | 126 } |
| 127 | 127 |
| 128 CPDF_Font* CPDF_DocPageData::GetFont(CPDF_Dictionary* pFontDict, | 128 CPDF_Font* CPDF_DocPageData::GetFont(CPDF_Dictionary* pFontDict, |
| 129 FX_BOOL findOnly) { | 129 FX_BOOL findOnly) { |
| 130 if (!pFontDict) { | 130 if (!pFontDict) { |
| 131 return NULL; | 131 return nullptr; |
| 132 } | 132 } |
| 133 if (findOnly) { | 133 if (findOnly) { |
| 134 auto it = m_FontMap.find(pFontDict); | 134 auto it = m_FontMap.find(pFontDict); |
| 135 if (it != m_FontMap.end() && it->second->get()) { | 135 if (it != m_FontMap.end() && it->second->get()) { |
| 136 return it->second->AddRef(); | 136 return it->second->AddRef(); |
| 137 } | 137 } |
| 138 return nullptr; | 138 return nullptr; |
| 139 } | 139 } |
| 140 | 140 |
| 141 CPDF_CountedFont* fontData = nullptr; | 141 CPDF_CountedFont* fontData = nullptr; |
| (...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 427 if (image->use_count() == 0) { | 427 if (image->use_count() == 0) { |
| 428 delete image->get(); | 428 delete image->get(); |
| 429 delete image; | 429 delete image; |
| 430 m_ImageMap.erase(it); | 430 m_ImageMap.erase(it); |
| 431 } | 431 } |
| 432 } | 432 } |
| 433 | 433 |
| 434 CPDF_IccProfile* CPDF_DocPageData::GetIccProfile( | 434 CPDF_IccProfile* CPDF_DocPageData::GetIccProfile( |
| 435 CPDF_Stream* pIccProfileStream) { | 435 CPDF_Stream* pIccProfileStream) { |
| 436 if (!pIccProfileStream) | 436 if (!pIccProfileStream) |
| 437 return NULL; | 437 return nullptr; |
| 438 | 438 |
| 439 auto it = m_IccProfileMap.find(pIccProfileStream); | 439 auto it = m_IccProfileMap.find(pIccProfileStream); |
| 440 if (it != m_IccProfileMap.end()) { | 440 if (it != m_IccProfileMap.end()) { |
| 441 return it->second->AddRef(); | 441 return it->second->AddRef(); |
| 442 } | 442 } |
| 443 | 443 |
| 444 CPDF_StreamAcc stream; | 444 CPDF_StreamAcc stream; |
| 445 stream.LoadAllData(pIccProfileStream, FALSE); | 445 stream.LoadAllData(pIccProfileStream, FALSE); |
| 446 uint8_t digest[20]; | 446 uint8_t digest[20]; |
| 447 CRYPT_SHA1Generate(stream.GetData(), stream.GetSize(), digest); | 447 CRYPT_SHA1Generate(stream.GetData(), stream.GetSize(), digest); |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 531 } | 531 } |
| 532 | 532 |
| 533 CPDF_CountedPattern* CPDF_DocPageData::FindPatternPtr( | 533 CPDF_CountedPattern* CPDF_DocPageData::FindPatternPtr( |
| 534 CPDF_Object* pPatternObj) const { | 534 CPDF_Object* pPatternObj) const { |
| 535 if (!pPatternObj) | 535 if (!pPatternObj) |
| 536 return nullptr; | 536 return nullptr; |
| 537 | 537 |
| 538 auto it = m_PatternMap.find(pPatternObj); | 538 auto it = m_PatternMap.find(pPatternObj); |
| 539 return it != m_PatternMap.end() ? it->second : nullptr; | 539 return it != m_PatternMap.end() ? it->second : nullptr; |
| 540 } | 540 } |
| OLD | NEW |