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 "../../../include/fpdfapi/fpdf_page.h" | 7 #include "../../../include/fpdfapi/fpdf_page.h" |
8 #include "../../../include/fpdfapi/fpdf_module.h" | 8 #include "../../../include/fpdfapi/fpdf_module.h" |
9 #include "../../../include/fdrm/fx_crypt.h" | 9 #include "../../../include/fdrm/fx_crypt.h" |
10 #include "../fpdf_font/font_int.h" | 10 #include "../fpdf_font/font_int.h" |
(...skipping 467 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
478 ptData = FX_NEW CPDF_CountedObject<CPDF_Pattern*>; | 478 ptData = FX_NEW CPDF_CountedObject<CPDF_Pattern*>; |
479 bNew = TRUE; | 479 bNew = TRUE; |
480 if (!ptData) { | 480 if (!ptData) { |
481 return NULL; | 481 return NULL; |
482 } | 482 } |
483 } | 483 } |
484 CPDF_Pattern* pPattern = NULL; | 484 CPDF_Pattern* pPattern = NULL; |
485 if (bShading) { | 485 if (bShading) { |
486 pPattern = FX_NEW CPDF_ShadingPattern(m_pPDFDoc, pPatternObj, bShading,
matrix); | 486 pPattern = FX_NEW CPDF_ShadingPattern(m_pPDFDoc, pPatternObj, bShading,
matrix); |
487 } else { | 487 } else { |
488 CPDF_Dictionary* pDict = pPatternObj->GetDict(); | 488 CPDF_Dictionary* pDict = pPatternObj ? pPatternObj->GetDict() : NULL; |
489 if (pDict) { | 489 if (pDict) { |
490 int type = pDict->GetInteger(FX_BSTRC("PatternType")); | 490 int type = pDict->GetInteger(FX_BSTRC("PatternType")); |
491 if (type == 1) { | 491 if (type == 1) { |
492 pPattern = FX_NEW CPDF_TilingPattern(m_pPDFDoc, pPatternObj, mat
rix); | 492 pPattern = FX_NEW CPDF_TilingPattern(m_pPDFDoc, pPatternObj, mat
rix); |
493 } else if (type == 2) { | 493 } else if (type == 2) { |
494 pPattern = FX_NEW CPDF_ShadingPattern(m_pPDFDoc, pPatternObj, FA
LSE, matrix); | 494 pPattern = FX_NEW CPDF_ShadingPattern(m_pPDFDoc, pPatternObj, FA
LSE, matrix); |
495 } | 495 } |
496 } | 496 } |
497 } | 497 } |
498 if (!pPattern) { | 498 if (!pPattern) { |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
638 m_FontFileMap.SetAt(pFontStream, ftData); | 638 m_FontFileMap.SetAt(pFontStream, ftData); |
639 return pFontFile; | 639 return pFontFile; |
640 } | 640 } |
641 void CPDF_DocPageData::ReleaseFontFileStreamAcc(CPDF_Stream* pFontStream, FX_BOO
L bForce) | 641 void CPDF_DocPageData::ReleaseFontFileStreamAcc(CPDF_Stream* pFontStream, FX_BOO
L bForce) |
642 { | 642 { |
643 if (!pFontStream) { | 643 if (!pFontStream) { |
644 return; | 644 return; |
645 } | 645 } |
646 PDF_DocPageData_Release<CPDF_Stream*, CPDF_StreamAcc*>(m_FontFileMap, pFontS
tream, NULL, bForce); | 646 PDF_DocPageData_Release<CPDF_Stream*, CPDF_StreamAcc*>(m_FontFileMap, pFontS
tream, NULL, bForce); |
647 } | 647 } |
OLD | NEW |