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_pageobj.h" | 8 #include "../../../include/fpdfapi/fpdf_pageobj.h" |
9 #include "../../../include/fpdfapi/fpdf_module.h" | 9 #include "../../../include/fpdfapi/fpdf_module.h" |
10 #include "../../../include/fpdfapi/fpdf_render.h" | 10 #include "../../../include/fpdfapi/fpdf_render.h" |
(...skipping 492 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
503 CPDF_Array* pFont = (CPDF_Array*)pObject; | 503 CPDF_Array* pFont = (CPDF_Array*)pObject; |
504 m_TextState.GetModify()->m_FontSize = pFont->GetNumber(1); | 504 m_TextState.GetModify()->m_FontSize = pFont->GetNumber(1); |
505 m_TextState.SetFont(pParser->FindFont(pFont->GetString(0))); | 505 m_TextState.SetFont(pParser->FindFont(pFont->GetString(0))); |
506 break; | 506 break; |
507 } | 507 } |
508 case FXBSTR_ID('T', 'R', 0, 0): | 508 case FXBSTR_ID('T', 'R', 0, 0): |
509 if (pGS->KeyExist(FX_BSTRC("TR2"))) { | 509 if (pGS->KeyExist(FX_BSTRC("TR2"))) { |
510 continue; | 510 continue; |
511 } | 511 } |
512 case FXBSTR_ID('T', 'R', '2', 0): | 512 case FXBSTR_ID('T', 'R', '2', 0): |
513 if (pObject && pObject->GetType() != PDFOBJ_NAME) { | 513 pGeneralState->m_pTR = |
514 pGeneralState->m_pTR = pObject; | 514 (pObject && !pObject->IsName()) ? pObject : nullptr; |
515 } else { | |
516 pGeneralState->m_pTR = NULL; | |
517 } | |
518 break; | 515 break; |
519 case FXBSTR_ID('B', 'M', 0, 0): { | 516 case FXBSTR_ID('B', 'M', 0, 0): { |
520 CFX_ByteString mode; | 517 CFX_ByteString mode; |
521 if (pObject->GetType() == PDFOBJ_ARRAY) { | 518 if (pObject->GetType() == PDFOBJ_ARRAY) { |
522 mode = ((CPDF_Array*)pObject)->GetString(0); | 519 mode = ((CPDF_Array*)pObject)->GetString(0); |
523 } else { | 520 } else { |
524 mode = pObject->GetString(); | 521 mode = pObject->GetString(); |
525 } | 522 } |
526 pGeneralState->SetBlendMode(mode); | 523 pGeneralState->SetBlendMode(mode); |
527 if (pGeneralState->m_BlendType > FXDIB_BLEND_MULTIPLY) { | 524 if (pGeneralState->m_BlendType > FXDIB_BLEND_MULTIPLY) { |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
679 pDict = NULL; | 676 pDict = NULL; |
680 if (item.GetParamType() == CPDF_ContentMarkItem::PropertiesDict || | 677 if (item.GetParamType() == CPDF_ContentMarkItem::PropertiesDict || |
681 item.GetParamType() == CPDF_ContentMarkItem::DirectDict) { | 678 item.GetParamType() == CPDF_ContentMarkItem::DirectDict) { |
682 pDict = ToDictionary(static_cast<CPDF_Object*>(item.GetParam())); | 679 pDict = ToDictionary(static_cast<CPDF_Object*>(item.GetParam())); |
683 } | 680 } |
684 return TRUE; | 681 return TRUE; |
685 } | 682 } |
686 } | 683 } |
687 return FALSE; | 684 return FALSE; |
688 } | 685 } |
OLD | NEW |