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 <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 CFX_ByteStringC replacement; | 75 CFX_ByteStringC replacement; |
76 }; | 76 }; |
77 | 77 |
78 class CPDF_StreamParserAutoClearer { | 78 class CPDF_StreamParserAutoClearer { |
79 public: | 79 public: |
80 CPDF_StreamParserAutoClearer(CPDF_StreamParser** scoped_variable, | 80 CPDF_StreamParserAutoClearer(CPDF_StreamParser** scoped_variable, |
81 CPDF_StreamParser* new_parser) | 81 CPDF_StreamParser* new_parser) |
82 : scoped_variable_(scoped_variable) { | 82 : scoped_variable_(scoped_variable) { |
83 *scoped_variable_ = new_parser; | 83 *scoped_variable_ = new_parser; |
84 } | 84 } |
85 ~CPDF_StreamParserAutoClearer() { *scoped_variable_ = NULL; } | 85 ~CPDF_StreamParserAutoClearer() { *scoped_variable_ = nullptr; } |
86 | 86 |
87 private: | 87 private: |
88 CPDF_StreamParser** scoped_variable_; | 88 CPDF_StreamParser** scoped_variable_; |
89 }; | 89 }; |
90 | 90 |
91 CFX_ByteStringC PDF_FindFullName(const PDF_AbbrPair* table, | 91 CFX_ByteStringC PDF_FindFullName(const PDF_AbbrPair* table, |
92 size_t count, | 92 size_t count, |
93 const CFX_ByteStringC& abbr) { | 93 const CFX_ByteStringC& abbr) { |
94 auto it = std::find_if( | 94 auto it = std::find_if( |
95 table, table + count, | 95 table, table + count, |
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
314 if (index == PARAM_BUF_SIZE) { | 314 if (index == PARAM_BUF_SIZE) { |
315 index = 0; | 315 index = 0; |
316 } | 316 } |
317 } | 317 } |
318 m_ParamStartPos = 0; | 318 m_ParamStartPos = 0; |
319 m_ParamCount = 0; | 319 m_ParamCount = 0; |
320 } | 320 } |
321 | 321 |
322 CPDF_Object* CPDF_StreamContentParser::GetObject(uint32_t index) { | 322 CPDF_Object* CPDF_StreamContentParser::GetObject(uint32_t index) { |
323 if (index >= m_ParamCount) { | 323 if (index >= m_ParamCount) { |
324 return NULL; | 324 return nullptr; |
325 } | 325 } |
326 int real_index = m_ParamStartPos + m_ParamCount - index - 1; | 326 int real_index = m_ParamStartPos + m_ParamCount - index - 1; |
327 if (real_index >= PARAM_BUF_SIZE) { | 327 if (real_index >= PARAM_BUF_SIZE) { |
328 real_index -= PARAM_BUF_SIZE; | 328 real_index -= PARAM_BUF_SIZE; |
329 } | 329 } |
330 ContentParam& param = m_ParamBuf[real_index]; | 330 ContentParam& param = m_ParamBuf[real_index]; |
331 if (param.m_Type == ContentParam::NUMBER) { | 331 if (param.m_Type == ContentParam::NUMBER) { |
332 CPDF_Number* pNumber = param.m_Number.m_bInteger | 332 CPDF_Number* pNumber = param.m_Number.m_bInteger |
333 ? new CPDF_Number(param.m_Number.m_Integer) | 333 ? new CPDF_Number(param.m_Number.m_Integer) |
334 : new CPDF_Number(param.m_Number.m_Float); | 334 : new CPDF_Number(param.m_Number.m_Float); |
335 | 335 |
336 param.m_Type = ContentParam::OBJECT; | 336 param.m_Type = ContentParam::OBJECT; |
337 param.m_pObject = pNumber; | 337 param.m_pObject = pNumber; |
338 return pNumber; | 338 return pNumber; |
339 } | 339 } |
340 if (param.m_Type == ContentParam::NAME) { | 340 if (param.m_Type == ContentParam::NAME) { |
341 CPDF_Name* pName = new CPDF_Name( | 341 CPDF_Name* pName = new CPDF_Name( |
342 CFX_ByteString(param.m_Name.m_Buffer, param.m_Name.m_Len)); | 342 CFX_ByteString(param.m_Name.m_Buffer, param.m_Name.m_Len)); |
343 param.m_Type = ContentParam::OBJECT; | 343 param.m_Type = ContentParam::OBJECT; |
344 param.m_pObject = pName; | 344 param.m_pObject = pName; |
345 return pName; | 345 return pName; |
346 } | 346 } |
347 if (param.m_Type == ContentParam::OBJECT) { | 347 if (param.m_Type == ContentParam::OBJECT) { |
348 return param.m_pObject; | 348 return param.m_pObject; |
349 } | 349 } |
350 ASSERT(FALSE); | 350 ASSERT(FALSE); |
351 return NULL; | 351 return nullptr; |
352 } | 352 } |
353 | 353 |
354 CFX_ByteString CPDF_StreamContentParser::GetString(uint32_t index) { | 354 CFX_ByteString CPDF_StreamContentParser::GetString(uint32_t index) { |
355 if (index >= m_ParamCount) { | 355 if (index >= m_ParamCount) { |
356 return CFX_ByteString(); | 356 return CFX_ByteString(); |
357 } | 357 } |
358 int real_index = m_ParamStartPos + m_ParamCount - index - 1; | 358 int real_index = m_ParamStartPos + m_ParamCount - index - 1; |
359 if (real_index >= PARAM_BUF_SIZE) { | 359 if (real_index >= PARAM_BUF_SIZE) { |
360 real_index -= PARAM_BUF_SIZE; | 360 real_index -= PARAM_BUF_SIZE; |
361 } | 361 } |
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
605 m_pSyntax->ReadNextObject(false, 0)); | 605 m_pSyntax->ReadNextObject(false, 0)); |
606 if (!key.IsEmpty()) { | 606 if (!key.IsEmpty()) { |
607 uint32_t dwObjNum = pObj ? pObj->GetObjNum() : 0; | 607 uint32_t dwObjNum = pObj ? pObj->GetObjNum() : 0; |
608 if (dwObjNum) | 608 if (dwObjNum) |
609 pDict->SetAtReference(key, m_pDocument, dwObjNum); | 609 pDict->SetAtReference(key, m_pDocument, dwObjNum); |
610 else | 610 else |
611 pDict->SetAt(key, pObj.release()); | 611 pDict->SetAt(key, pObj.release()); |
612 } | 612 } |
613 } | 613 } |
614 PDF_ReplaceAbbr(pDict); | 614 PDF_ReplaceAbbr(pDict); |
615 CPDF_Object* pCSObj = NULL; | 615 CPDF_Object* pCSObj = nullptr; |
616 if (pDict->KeyExist("ColorSpace")) { | 616 if (pDict->KeyExist("ColorSpace")) { |
617 pCSObj = pDict->GetDirectObjectBy("ColorSpace"); | 617 pCSObj = pDict->GetDirectObjectBy("ColorSpace"); |
618 if (pCSObj->IsName()) { | 618 if (pCSObj->IsName()) { |
619 CFX_ByteString name = pCSObj->GetString(); | 619 CFX_ByteString name = pCSObj->GetString(); |
620 if (name != "DeviceRGB" && name != "DeviceGray" && name != "DeviceCMYK") { | 620 if (name != "DeviceRGB" && name != "DeviceGray" && name != "DeviceCMYK") { |
621 pCSObj = FindResourceObj("ColorSpace", name); | 621 pCSObj = FindResourceObj("ColorSpace", name); |
622 if (pCSObj && !pCSObj->GetObjNum()) { | 622 if (pCSObj && !pCSObj->GetObjNum()) { |
623 pCSObj = pCSObj->Clone(); | 623 pCSObj = pCSObj->Clone(); |
624 pDict->SetAt("ColorSpace", pCSObj); | 624 pDict->SetAt("ColorSpace", pCSObj); |
625 } | 625 } |
626 } | 626 } |
627 } | 627 } |
628 } | 628 } |
629 CPDF_Stream* pStream = | 629 CPDF_Stream* pStream = |
630 m_pSyntax->ReadInlineStream(m_pDocument, pDict, pCSObj); | 630 m_pSyntax->ReadInlineStream(m_pDocument, pDict, pCSObj); |
631 while (1) { | 631 while (1) { |
632 CPDF_StreamParser::SyntaxType type = m_pSyntax->ParseNextElement(); | 632 CPDF_StreamParser::SyntaxType type = m_pSyntax->ParseNextElement(); |
633 if (type == CPDF_StreamParser::EndOfData) { | 633 if (type == CPDF_StreamParser::EndOfData) { |
634 break; | 634 break; |
635 } | 635 } |
636 if (type != CPDF_StreamParser::Keyword) { | 636 if (type != CPDF_StreamParser::Keyword) { |
637 continue; | 637 continue; |
638 } | 638 } |
639 if (m_pSyntax->GetWordSize() == 2 && m_pSyntax->GetWordBuf()[0] == 'E' && | 639 if (m_pSyntax->GetWordSize() == 2 && m_pSyntax->GetWordBuf()[0] == 'E' && |
640 m_pSyntax->GetWordBuf()[1] == 'I') { | 640 m_pSyntax->GetWordBuf()[1] == 'I') { |
641 break; | 641 break; |
642 } | 642 } |
643 } | 643 } |
644 pDict->SetAtName("Subtype", "Image"); | 644 pDict->SetAtName("Subtype", "Image"); |
645 CPDF_ImageObject* pImgObj = AddImage(pStream, NULL, TRUE); | 645 CPDF_ImageObject* pImgObj = AddImage(pStream, nullptr, TRUE); |
646 if (!pImgObj) { | 646 if (!pImgObj) { |
647 if (pStream) { | 647 if (pStream) { |
648 pStream->Release(); | 648 pStream->Release(); |
649 } else { | 649 } else { |
650 pDict->Release(); | 650 pDict->Release(); |
651 } | 651 } |
652 } | 652 } |
653 } | 653 } |
654 | 654 |
655 void CPDF_StreamContentParser::Handle_BeginMarkedContent() { | 655 void CPDF_StreamContentParser::Handle_BeginMarkedContent() { |
656 CFX_ByteString tag = GetString(0); | 656 CFX_ByteString tag = GetString(0); |
657 m_CurContentMark.GetModify()->AddMark(tag, NULL, FALSE); | 657 m_CurContentMark.GetModify()->AddMark(tag, nullptr, FALSE); |
658 } | 658 } |
659 | 659 |
660 void CPDF_StreamContentParser::Handle_BeginText() { | 660 void CPDF_StreamContentParser::Handle_BeginText() { |
661 m_pCurStates->m_TextMatrix.Set(1.0f, 0, 0, 1.0f, 0, 0); | 661 m_pCurStates->m_TextMatrix.Set(1.0f, 0, 0, 1.0f, 0, 0); |
662 OnChangeTextMatrix(); | 662 OnChangeTextMatrix(); |
663 m_pCurStates->m_TextX = 0; | 663 m_pCurStates->m_TextX = 0; |
664 m_pCurStates->m_TextY = 0; | 664 m_pCurStates->m_TextY = 0; |
665 m_pCurStates->m_TextLineX = 0; | 665 m_pCurStates->m_TextLineX = 0; |
666 m_pCurStates->m_TextLineY = 0; | 666 m_pCurStates->m_TextLineY = 0; |
667 } | 667 } |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
731 if (!pXObject) { | 731 if (!pXObject) { |
732 m_bResourceMissing = TRUE; | 732 m_bResourceMissing = TRUE; |
733 return; | 733 return; |
734 } | 734 } |
735 | 735 |
736 CFX_ByteString type; | 736 CFX_ByteString type; |
737 if (pXObject->GetDict()) | 737 if (pXObject->GetDict()) |
738 type = pXObject->GetDict()->GetStringBy("Subtype"); | 738 type = pXObject->GetDict()->GetStringBy("Subtype"); |
739 | 739 |
740 if (type == "Image") { | 740 if (type == "Image") { |
741 CPDF_ImageObject* pObj = AddImage(pXObject, NULL, FALSE); | 741 CPDF_ImageObject* pObj = AddImage(pXObject, nullptr, FALSE); |
742 m_LastImageName = name; | 742 m_LastImageName = name; |
743 m_pLastImage = pObj->m_pImage; | 743 m_pLastImage = pObj->m_pImage; |
744 if (!m_pObjectHolder->HasImageMask()) | 744 if (!m_pObjectHolder->HasImageMask()) |
745 m_pObjectHolder->SetHasImageMask(m_pLastImage->IsMask()); | 745 m_pObjectHolder->SetHasImageMask(m_pLastImage->IsMask()); |
746 } else if (type == "Form") { | 746 } else if (type == "Form") { |
747 AddForm(pXObject); | 747 AddForm(pXObject); |
748 } | 748 } |
749 } | 749 } |
750 | 750 |
751 void CPDF_StreamContentParser::AddForm(CPDF_Stream* pStream) { | 751 void CPDF_StreamContentParser::AddForm(CPDF_Stream* pStream) { |
(...skipping 14 matching lines...) Expand all Loading... |
766 } | 766 } |
767 pFormObj->CalcBoundingBox(); | 767 pFormObj->CalcBoundingBox(); |
768 SetGraphicStates(pFormObj.get(), TRUE, TRUE, TRUE); | 768 SetGraphicStates(pFormObj.get(), TRUE, TRUE, TRUE); |
769 m_pObjectHolder->GetPageObjectList()->push_back(std::move(pFormObj)); | 769 m_pObjectHolder->GetPageObjectList()->push_back(std::move(pFormObj)); |
770 } | 770 } |
771 | 771 |
772 CPDF_ImageObject* CPDF_StreamContentParser::AddImage(CPDF_Stream* pStream, | 772 CPDF_ImageObject* CPDF_StreamContentParser::AddImage(CPDF_Stream* pStream, |
773 CPDF_Image* pImage, | 773 CPDF_Image* pImage, |
774 FX_BOOL bInline) { | 774 FX_BOOL bInline) { |
775 if (!pStream && !pImage) { | 775 if (!pStream && !pImage) { |
776 return NULL; | 776 return nullptr; |
777 } | 777 } |
778 CFX_Matrix ImageMatrix; | 778 CFX_Matrix ImageMatrix; |
779 ImageMatrix.Copy(m_pCurStates->m_CTM); | 779 ImageMatrix.Copy(m_pCurStates->m_CTM); |
780 ImageMatrix.Concat(m_mtContentToUser); | 780 ImageMatrix.Concat(m_mtContentToUser); |
781 | 781 |
782 std::unique_ptr<CPDF_ImageObject> pImageObj(new CPDF_ImageObject); | 782 std::unique_ptr<CPDF_ImageObject> pImageObj(new CPDF_ImageObject); |
783 if (pImage) { | 783 if (pImage) { |
784 pImageObj->m_pImage = | 784 pImageObj->m_pImage = |
785 m_pDocument->GetPageData()->GetImage(pImage->GetStream()); | 785 m_pDocument->GetPageData()->GetImage(pImage->GetStream()); |
786 } else if (pStream->GetObjNum()) { | 786 } else if (pStream->GetObjNum()) { |
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1003 | 1003 |
1004 void CPDF_StreamContentParser::Handle_SetColor_Fill() { | 1004 void CPDF_StreamContentParser::Handle_SetColor_Fill() { |
1005 FX_FLOAT values[4]; | 1005 FX_FLOAT values[4]; |
1006 int nargs = m_ParamCount; | 1006 int nargs = m_ParamCount; |
1007 if (nargs > 4) { | 1007 if (nargs > 4) { |
1008 nargs = 4; | 1008 nargs = 4; |
1009 } | 1009 } |
1010 for (int i = 0; i < nargs; i++) { | 1010 for (int i = 0; i < nargs; i++) { |
1011 values[i] = GetNumber(nargs - i - 1); | 1011 values[i] = GetNumber(nargs - i - 1); |
1012 } | 1012 } |
1013 m_pCurStates->m_ColorState.SetFillColor(NULL, values, nargs); | 1013 m_pCurStates->m_ColorState.SetFillColor(nullptr, values, nargs); |
1014 } | 1014 } |
1015 | 1015 |
1016 void CPDF_StreamContentParser::Handle_SetColor_Stroke() { | 1016 void CPDF_StreamContentParser::Handle_SetColor_Stroke() { |
1017 FX_FLOAT values[4]; | 1017 FX_FLOAT values[4]; |
1018 int nargs = m_ParamCount; | 1018 int nargs = m_ParamCount; |
1019 if (nargs > 4) { | 1019 if (nargs > 4) { |
1020 nargs = 4; | 1020 nargs = 4; |
1021 } | 1021 } |
1022 for (int i = 0; i < nargs; i++) { | 1022 for (int i = 0; i < nargs; i++) { |
1023 values[i] = GetNumber(nargs - i - 1); | 1023 values[i] = GetNumber(nargs - i - 1); |
1024 } | 1024 } |
1025 m_pCurStates->m_ColorState.SetStrokeColor(NULL, values, nargs); | 1025 m_pCurStates->m_ColorState.SetStrokeColor(nullptr, values, nargs); |
1026 } | 1026 } |
1027 | 1027 |
1028 void CPDF_StreamContentParser::Handle_SetColorPS_Fill() { | 1028 void CPDF_StreamContentParser::Handle_SetColorPS_Fill() { |
1029 CPDF_Object* pLastParam = GetObject(0); | 1029 CPDF_Object* pLastParam = GetObject(0); |
1030 if (!pLastParam) { | 1030 if (!pLastParam) { |
1031 return; | 1031 return; |
1032 } | 1032 } |
1033 uint32_t nargs = m_ParamCount; | 1033 uint32_t nargs = m_ParamCount; |
1034 uint32_t nvalues = nargs; | 1034 uint32_t nvalues = nargs; |
1035 if (pLastParam->IsName()) | 1035 if (pLastParam->IsName()) |
1036 nvalues--; | 1036 nvalues--; |
1037 FX_FLOAT* values = NULL; | 1037 FX_FLOAT* values = nullptr; |
1038 if (nvalues) { | 1038 if (nvalues) { |
1039 values = FX_Alloc(FX_FLOAT, nvalues); | 1039 values = FX_Alloc(FX_FLOAT, nvalues); |
1040 for (uint32_t i = 0; i < nvalues; i++) { | 1040 for (uint32_t i = 0; i < nvalues; i++) { |
1041 values[i] = GetNumber(nargs - i - 1); | 1041 values[i] = GetNumber(nargs - i - 1); |
1042 } | 1042 } |
1043 } | 1043 } |
1044 if (nvalues != nargs) { | 1044 if (nvalues != nargs) { |
1045 CPDF_Pattern* pPattern = FindPattern(GetString(0), false); | 1045 CPDF_Pattern* pPattern = FindPattern(GetString(0), false); |
1046 if (pPattern) { | 1046 if (pPattern) { |
1047 m_pCurStates->m_ColorState.SetFillPattern(pPattern, values, nvalues); | 1047 m_pCurStates->m_ColorState.SetFillPattern(pPattern, values, nvalues); |
1048 } | 1048 } |
1049 } else { | 1049 } else { |
1050 m_pCurStates->m_ColorState.SetFillColor(NULL, values, nvalues); | 1050 m_pCurStates->m_ColorState.SetFillColor(nullptr, values, nvalues); |
1051 } | 1051 } |
1052 FX_Free(values); | 1052 FX_Free(values); |
1053 } | 1053 } |
1054 | 1054 |
1055 void CPDF_StreamContentParser::Handle_SetColorPS_Stroke() { | 1055 void CPDF_StreamContentParser::Handle_SetColorPS_Stroke() { |
1056 CPDF_Object* pLastParam = GetObject(0); | 1056 CPDF_Object* pLastParam = GetObject(0); |
1057 if (!pLastParam) { | 1057 if (!pLastParam) { |
1058 return; | 1058 return; |
1059 } | 1059 } |
1060 int nargs = m_ParamCount; | 1060 int nargs = m_ParamCount; |
1061 int nvalues = nargs; | 1061 int nvalues = nargs; |
1062 if (pLastParam->IsName()) | 1062 if (pLastParam->IsName()) |
1063 nvalues--; | 1063 nvalues--; |
1064 | 1064 |
1065 FX_FLOAT* values = NULL; | 1065 FX_FLOAT* values = nullptr; |
1066 if (nvalues) { | 1066 if (nvalues) { |
1067 values = FX_Alloc(FX_FLOAT, nvalues); | 1067 values = FX_Alloc(FX_FLOAT, nvalues); |
1068 for (int i = 0; i < nvalues; i++) { | 1068 for (int i = 0; i < nvalues; i++) { |
1069 values[i] = GetNumber(nargs - i - 1); | 1069 values[i] = GetNumber(nargs - i - 1); |
1070 } | 1070 } |
1071 } | 1071 } |
1072 if (nvalues != nargs) { | 1072 if (nvalues != nargs) { |
1073 CPDF_Pattern* pPattern = FindPattern(GetString(0), false); | 1073 CPDF_Pattern* pPattern = FindPattern(GetString(0), false); |
1074 if (pPattern) { | 1074 if (pPattern) { |
1075 m_pCurStates->m_ColorState.SetStrokePattern(pPattern, values, nvalues); | 1075 m_pCurStates->m_ColorState.SetStrokePattern(pPattern, values, nvalues); |
1076 } | 1076 } |
1077 } else { | 1077 } else { |
1078 m_pCurStates->m_ColorState.SetStrokeColor(NULL, values, nvalues); | 1078 m_pCurStates->m_ColorState.SetStrokeColor(nullptr, values, nvalues); |
1079 } | 1079 } |
1080 FX_Free(values); | 1080 FX_Free(values); |
1081 } | 1081 } |
1082 | 1082 |
1083 void CPDF_StreamContentParser::Handle_ShadeFill() { | 1083 void CPDF_StreamContentParser::Handle_ShadeFill() { |
1084 CPDF_Pattern* pPattern = FindPattern(GetString(0), true); | 1084 CPDF_Pattern* pPattern = FindPattern(GetString(0), true); |
1085 if (!pPattern) | 1085 if (!pPattern) |
1086 return; | 1086 return; |
1087 | 1087 |
1088 CPDF_ShadingPattern* pShading = pPattern->AsShadingPattern(); | 1088 CPDF_ShadingPattern* pShading = pPattern->AsShadingPattern(); |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1182 if (name == "DeviceRGB") { | 1182 if (name == "DeviceRGB") { |
1183 return CPDF_ColorSpace::GetStockCS(PDFCS_DEVICERGB); | 1183 return CPDF_ColorSpace::GetStockCS(PDFCS_DEVICERGB); |
1184 } | 1184 } |
1185 return CPDF_ColorSpace::GetStockCS(PDFCS_DEVICECMYK); | 1185 return CPDF_ColorSpace::GetStockCS(PDFCS_DEVICECMYK); |
1186 } | 1186 } |
1187 return m_pDocument->LoadColorSpace(pDefObj); | 1187 return m_pDocument->LoadColorSpace(pDefObj); |
1188 } | 1188 } |
1189 CPDF_Object* pCSObj = FindResourceObj("ColorSpace", name); | 1189 CPDF_Object* pCSObj = FindResourceObj("ColorSpace", name); |
1190 if (!pCSObj) { | 1190 if (!pCSObj) { |
1191 m_bResourceMissing = TRUE; | 1191 m_bResourceMissing = TRUE; |
1192 return NULL; | 1192 return nullptr; |
1193 } | 1193 } |
1194 return m_pDocument->LoadColorSpace(pCSObj); | 1194 return m_pDocument->LoadColorSpace(pCSObj); |
1195 } | 1195 } |
1196 | 1196 |
1197 CPDF_Pattern* CPDF_StreamContentParser::FindPattern(const CFX_ByteString& name, | 1197 CPDF_Pattern* CPDF_StreamContentParser::FindPattern(const CFX_ByteString& name, |
1198 bool bShading) { | 1198 bool bShading) { |
1199 CPDF_Object* pPattern = | 1199 CPDF_Object* pPattern = |
1200 FindResourceObj(bShading ? "Shading" : "Pattern", name); | 1200 FindResourceObj(bShading ? "Shading" : "Pattern", name); |
1201 if (!pPattern || (!pPattern->IsDictionary() && !pPattern->IsStream())) { | 1201 if (!pPattern || (!pPattern->IsDictionary() && !pPattern->IsStream())) { |
1202 m_bResourceMissing = TRUE; | 1202 m_bResourceMissing = TRUE; |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1277 1000; | 1277 1000; |
1278 } | 1278 } |
1279 } | 1279 } |
1280 } | 1280 } |
1281 | 1281 |
1282 void CPDF_StreamContentParser::Handle_ShowText() { | 1282 void CPDF_StreamContentParser::Handle_ShowText() { |
1283 CFX_ByteString str = GetString(0); | 1283 CFX_ByteString str = GetString(0); |
1284 if (str.IsEmpty()) { | 1284 if (str.IsEmpty()) { |
1285 return; | 1285 return; |
1286 } | 1286 } |
1287 AddTextObject(&str, 0, NULL, 1); | 1287 AddTextObject(&str, 0, nullptr, 1); |
1288 } | 1288 } |
1289 | 1289 |
1290 void CPDF_StreamContentParser::Handle_ShowText_Positioning() { | 1290 void CPDF_StreamContentParser::Handle_ShowText_Positioning() { |
1291 CPDF_Array* pArray = ToArray(GetObject(0)); | 1291 CPDF_Array* pArray = ToArray(GetObject(0)); |
1292 if (!pArray) | 1292 if (!pArray) |
1293 return; | 1293 return; |
1294 | 1294 |
1295 size_t n = pArray->GetCount(); | 1295 size_t n = pArray->GetCount(); |
1296 size_t nsegs = 0; | 1296 size_t nsegs = 0; |
1297 for (size_t i = 0; i < n; i++) { | 1297 for (size_t i = 0; i < n; i++) { |
(...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1681 } else { | 1681 } else { |
1682 PDF_ReplaceAbbr(pElement); | 1682 PDF_ReplaceAbbr(pElement); |
1683 } | 1683 } |
1684 } | 1684 } |
1685 break; | 1685 break; |
1686 } | 1686 } |
1687 default: | 1687 default: |
1688 break; | 1688 break; |
1689 } | 1689 } |
1690 } | 1690 } |
OLD | NEW |