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 459 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
470 if (ptData->use_count() == 0) { | 470 if (ptData->use_count() == 0) { |
471 ptData->clear(); | 471 ptData->clear(); |
472 } | 472 } |
473 } | 473 } |
474 } | 474 } |
475 | 475 |
476 CPDF_Image* CPDF_DocPageData::GetImage(CPDF_Object* pImageStream) { | 476 CPDF_Image* CPDF_DocPageData::GetImage(CPDF_Object* pImageStream) { |
477 if (!pImageStream) | 477 if (!pImageStream) |
478 return nullptr; | 478 return nullptr; |
479 | 479 |
480 const FX_DWORD dwImageObjNum = pImageStream->GetObjNum(); | 480 const uint32_t dwImageObjNum = pImageStream->GetObjNum(); |
481 auto it = m_ImageMap.find(dwImageObjNum); | 481 auto it = m_ImageMap.find(dwImageObjNum); |
482 if (it != m_ImageMap.end()) { | 482 if (it != m_ImageMap.end()) { |
483 return it->second->AddRef(); | 483 return it->second->AddRef(); |
484 } | 484 } |
485 | 485 |
486 CPDF_Image* pImage = new CPDF_Image(m_pPDFDoc); | 486 CPDF_Image* pImage = new CPDF_Image(m_pPDFDoc); |
487 pImage->LoadImageF(pImageStream->AsStream(), FALSE); | 487 pImage->LoadImageF(pImageStream->AsStream(), FALSE); |
488 | 488 |
489 CPDF_CountedImage* imageData = new CPDF_CountedImage(pImage); | 489 CPDF_CountedImage* imageData = new CPDF_CountedImage(pImage); |
490 m_ImageMap[dwImageObjNum] = imageData; | 490 m_ImageMap[dwImageObjNum] = imageData; |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
610 } | 610 } |
611 | 611 |
612 CPDF_CountedPattern* CPDF_DocPageData::FindPatternPtr( | 612 CPDF_CountedPattern* CPDF_DocPageData::FindPatternPtr( |
613 CPDF_Object* pPatternObj) const { | 613 CPDF_Object* pPatternObj) const { |
614 if (!pPatternObj) | 614 if (!pPatternObj) |
615 return nullptr; | 615 return nullptr; |
616 | 616 |
617 auto it = m_PatternMap.find(pPatternObj); | 617 auto it = m_PatternMap.find(pPatternObj); |
618 return it != m_PatternMap.end() ? it->second : nullptr; | 618 return it != m_PatternMap.end() ? it->second : nullptr; |
619 } | 619 } |
OLD | NEW |