Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(61)

Side by Side Diff: core/fpdfapi/fpdf_page/fpdf_page_parser.cpp

Issue 1918113002: Clean up CPDF_Page. (Closed) Base URL: https://pdfium.googlesource.com/pdfium@master
Patch Set: delete more dead code Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 } 121 }
122 122
123 CPDF_StreamContentParser::CPDF_StreamContentParser( 123 CPDF_StreamContentParser::CPDF_StreamContentParser(
124 CPDF_Document* pDocument, 124 CPDF_Document* pDocument,
125 CPDF_Dictionary* pPageResources, 125 CPDF_Dictionary* pPageResources,
126 CPDF_Dictionary* pParentResources, 126 CPDF_Dictionary* pParentResources,
127 CFX_Matrix* pmtContentToUser, 127 CFX_Matrix* pmtContentToUser,
128 CPDF_PageObjectHolder* pObjHolder, 128 CPDF_PageObjectHolder* pObjHolder,
129 CPDF_Dictionary* pResources, 129 CPDF_Dictionary* pResources,
130 CFX_FloatRect* pBBox, 130 CFX_FloatRect* pBBox,
131 CPDF_ParseOptions* pOptions,
132 CPDF_AllStates* pStates, 131 CPDF_AllStates* pStates,
133 int level) 132 int level)
134 : m_pDocument(pDocument), 133 : m_pDocument(pDocument),
135 m_pPageResources(pPageResources), 134 m_pPageResources(pPageResources),
136 m_pParentResources(pParentResources), 135 m_pParentResources(pParentResources),
137 m_pResources(pResources), 136 m_pResources(pResources),
138 m_pObjectHolder(pObjHolder), 137 m_pObjectHolder(pObjHolder),
139 m_Level(level), 138 m_Level(level),
140 m_ParamStartPos(0), 139 m_ParamStartPos(0),
141 m_ParamCount(0), 140 m_ParamCount(0),
142 m_pCurStates(new CPDF_AllStates), 141 m_pCurStates(new CPDF_AllStates),
143 m_pLastTextObject(nullptr), 142 m_pLastTextObject(nullptr),
144 m_DefFontSize(0), 143 m_DefFontSize(0),
145 m_pPathPoints(nullptr), 144 m_pPathPoints(nullptr),
146 m_PathPointCount(0), 145 m_PathPointCount(0),
147 m_PathAllocSize(0), 146 m_PathAllocSize(0),
148 m_PathCurrentX(0.0f), 147 m_PathCurrentX(0.0f),
149 m_PathCurrentY(0.0f), 148 m_PathCurrentY(0.0f),
150 m_PathClipType(0), 149 m_PathClipType(0),
151 m_pLastImage(nullptr), 150 m_pLastImage(nullptr),
152 m_pLastImageDict(nullptr), 151 m_pLastImageDict(nullptr),
153 m_pLastCloneImageDict(nullptr), 152 m_pLastCloneImageDict(nullptr),
154 m_bReleaseLastDict(TRUE), 153 m_bReleaseLastDict(TRUE),
155 m_bColored(FALSE), 154 m_bColored(FALSE),
156 m_bResourceMissing(FALSE) { 155 m_bResourceMissing(FALSE) {
157 if (pmtContentToUser) { 156 if (pmtContentToUser)
158 m_mtContentToUser = *pmtContentToUser; 157 m_mtContentToUser = *pmtContentToUser;
159 } 158 if (!m_pResources)
160 if (pOptions) {
161 m_Options = *pOptions;
162 }
163 if (!m_pResources) {
164 m_pResources = m_pParentResources; 159 m_pResources = m_pParentResources;
165 } 160 if (!m_pResources)
166 if (!m_pResources) {
167 m_pResources = m_pPageResources; 161 m_pResources = m_pPageResources;
168 } 162 if (pBBox)
169 if (pBBox) {
170 m_BBox = *pBBox; 163 m_BBox = *pBBox;
171 }
172 if (pStates) { 164 if (pStates) {
173 m_pCurStates->Copy(*pStates); 165 m_pCurStates->Copy(*pStates);
174 } else { 166 } else {
175 m_pCurStates->m_GeneralState.New(); 167 m_pCurStates->m_GeneralState.New();
176 m_pCurStates->m_GraphState.New(); 168 m_pCurStates->m_GraphState.New();
177 m_pCurStates->m_TextState.New(); 169 m_pCurStates->m_TextState.New();
178 m_pCurStates->m_ColorState.New(); 170 m_pCurStates->m_ColorState.New();
179 } 171 }
180 for (size_t i = 0; i < FX_ArraySize(m_Type3Data); ++i) { 172 for (size_t i = 0; i < FX_ArraySize(m_Type3Data); ++i) {
181 m_Type3Data[i] = 0.0; 173 m_Type3Data[i] = 0.0;
(...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after
485 } 477 }
486 478
487 static const OpCodes s_OpCodes = InitializeOpCodes(); 479 static const OpCodes s_OpCodes = InitializeOpCodes();
488 480
489 auto it = s_OpCodes.find(opid); 481 auto it = s_OpCodes.find(opid);
490 if (it != s_OpCodes.end()) 482 if (it != s_OpCodes.end())
491 (this->*it->second)(); 483 (this->*it->second)();
492 } 484 }
493 485
494 void CPDF_StreamContentParser::Handle_CloseFillStrokePath() { 486 void CPDF_StreamContentParser::Handle_CloseFillStrokePath() {
495 if (m_Options.m_bTextOnly) {
496 return;
497 }
498 Handle_ClosePath(); 487 Handle_ClosePath();
499 AddPathObject(FXFILL_WINDING, TRUE); 488 AddPathObject(FXFILL_WINDING, TRUE);
500 } 489 }
501 490
502 void CPDF_StreamContentParser::Handle_FillStrokePath() { 491 void CPDF_StreamContentParser::Handle_FillStrokePath() {
503 if (m_Options.m_bTextOnly) {
504 return;
505 }
506 AddPathObject(FXFILL_WINDING, TRUE); 492 AddPathObject(FXFILL_WINDING, TRUE);
507 } 493 }
508 494
509 void CPDF_StreamContentParser::Handle_CloseEOFillStrokePath() { 495 void CPDF_StreamContentParser::Handle_CloseEOFillStrokePath() {
510 if (m_Options.m_bTextOnly) {
511 return;
512 }
513 AddPathPoint(m_PathStartX, m_PathStartY, FXPT_LINETO | FXPT_CLOSEFIGURE); 496 AddPathPoint(m_PathStartX, m_PathStartY, FXPT_LINETO | FXPT_CLOSEFIGURE);
514 AddPathObject(FXFILL_ALTERNATE, TRUE); 497 AddPathObject(FXFILL_ALTERNATE, TRUE);
515 } 498 }
516 499
517 void CPDF_StreamContentParser::Handle_EOFillStrokePath() { 500 void CPDF_StreamContentParser::Handle_EOFillStrokePath() {
518 if (m_Options.m_bTextOnly) {
519 return;
520 }
521 AddPathObject(FXFILL_ALTERNATE, TRUE); 501 AddPathObject(FXFILL_ALTERNATE, TRUE);
522 } 502 }
523 503
524 void CPDF_StreamContentParser::Handle_BeginMarkedContent_Dictionary() { 504 void CPDF_StreamContentParser::Handle_BeginMarkedContent_Dictionary() {
525 if (!m_Options.m_bMarkedContent) {
526 return;
527 }
528 CFX_ByteString tag = GetString(1); 505 CFX_ByteString tag = GetString(1);
529 CPDF_Object* pProperty = GetObject(0); 506 CPDF_Object* pProperty = GetObject(0);
530 if (!pProperty) { 507 if (!pProperty) {
531 return; 508 return;
532 } 509 }
533 FX_BOOL bDirect = TRUE; 510 FX_BOOL bDirect = TRUE;
534 if (pProperty->IsName()) { 511 if (pProperty->IsName()) {
535 pProperty = FindResourceObj("Properties", pProperty->GetString()); 512 pProperty = FindResourceObj("Properties", pProperty->GetString());
536 if (!pProperty) 513 if (!pProperty)
537 return; 514 return;
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
579 CFX_ByteString name = pCSObj->GetString(); 556 CFX_ByteString name = pCSObj->GetString();
580 if (name != "DeviceRGB" && name != "DeviceGray" && name != "DeviceCMYK") { 557 if (name != "DeviceRGB" && name != "DeviceGray" && name != "DeviceCMYK") {
581 pCSObj = FindResourceObj("ColorSpace", name); 558 pCSObj = FindResourceObj("ColorSpace", name);
582 if (pCSObj && !pCSObj->GetObjNum()) { 559 if (pCSObj && !pCSObj->GetObjNum()) {
583 pCSObj = pCSObj->Clone(); 560 pCSObj = pCSObj->Clone();
584 pDict->SetAt("ColorSpace", pCSObj); 561 pDict->SetAt("ColorSpace", pCSObj);
585 } 562 }
586 } 563 }
587 } 564 }
588 } 565 }
589 CPDF_Stream* pStream = m_pSyntax->ReadInlineStream( 566 CPDF_Stream* pStream =
590 m_pDocument, pDict, pCSObj, m_Options.m_bDecodeInlineImage); 567 m_pSyntax->ReadInlineStream(m_pDocument, pDict, pCSObj);
591 while (1) { 568 while (1) {
592 CPDF_StreamParser::SyntaxType type = m_pSyntax->ParseNextElement(); 569 CPDF_StreamParser::SyntaxType type = m_pSyntax->ParseNextElement();
593 if (type == CPDF_StreamParser::EndOfData) { 570 if (type == CPDF_StreamParser::EndOfData) {
594 break; 571 break;
595 } 572 }
596 if (type != CPDF_StreamParser::Keyword) { 573 if (type != CPDF_StreamParser::Keyword) {
597 continue; 574 continue;
598 } 575 }
599 if (m_pSyntax->GetWordSize() == 2 && m_pSyntax->GetWordBuf()[0] == 'E' && 576 if (m_pSyntax->GetWordSize() == 2 && m_pSyntax->GetWordBuf()[0] == 'E' &&
600 m_pSyntax->GetWordBuf()[1] == 'I') { 577 m_pSyntax->GetWordBuf()[1] == 'I') {
601 break; 578 break;
602 } 579 }
603 } 580 }
604 if (m_Options.m_bTextOnly) {
605 if (pStream) {
606 pStream->Release();
607 } else {
608 pDict->Release();
609 }
610 return;
611 }
612 pDict->SetAtName("Subtype", "Image"); 581 pDict->SetAtName("Subtype", "Image");
613 CPDF_ImageObject* pImgObj = AddImage(pStream, NULL, TRUE); 582 CPDF_ImageObject* pImgObj = AddImage(pStream, NULL, TRUE);
614 if (!pImgObj) { 583 if (!pImgObj) {
615 if (pStream) { 584 if (pStream) {
616 pStream->Release(); 585 pStream->Release();
617 } else { 586 } else {
618 pDict->Release(); 587 pDict->Release();
619 } 588 }
620 } 589 }
621 } 590 }
622 591
623 void CPDF_StreamContentParser::Handle_BeginMarkedContent() { 592 void CPDF_StreamContentParser::Handle_BeginMarkedContent() {
624 if (!m_Options.m_bMarkedContent) {
625 return;
626 }
627 CFX_ByteString tag = GetString(0); 593 CFX_ByteString tag = GetString(0);
628 m_CurContentMark.GetModify()->AddMark(tag, NULL, FALSE); 594 m_CurContentMark.GetModify()->AddMark(tag, NULL, FALSE);
629 } 595 }
630 596
631 void CPDF_StreamContentParser::Handle_BeginText() { 597 void CPDF_StreamContentParser::Handle_BeginText() {
632 m_pCurStates->m_TextMatrix.Set(1.0f, 0, 0, 1.0f, 0, 0); 598 m_pCurStates->m_TextMatrix.Set(1.0f, 0, 0, 1.0f, 0, 0);
633 OnChangeTextMatrix(); 599 OnChangeTextMatrix();
634 m_pCurStates->m_TextX = 0; 600 m_pCurStates->m_TextX = 0;
635 m_pCurStates->m_TextY = 0; 601 m_pCurStates->m_TextY = 0;
636 m_pCurStates->m_TextLineX = 0; 602 m_pCurStates->m_TextLineX = 0;
637 m_pCurStates->m_TextLineY = 0; 603 m_pCurStates->m_TextLineY = 0;
638 } 604 }
639 605
640 void CPDF_StreamContentParser::Handle_CurveTo_123() { 606 void CPDF_StreamContentParser::Handle_CurveTo_123() {
641 if (m_Options.m_bTextOnly) {
642 return;
643 }
644 AddPathPoint(GetNumber(5), GetNumber(4), FXPT_BEZIERTO); 607 AddPathPoint(GetNumber(5), GetNumber(4), FXPT_BEZIERTO);
645 AddPathPoint(GetNumber(3), GetNumber(2), FXPT_BEZIERTO); 608 AddPathPoint(GetNumber(3), GetNumber(2), FXPT_BEZIERTO);
646 AddPathPoint(GetNumber(1), GetNumber(0), FXPT_BEZIERTO); 609 AddPathPoint(GetNumber(1), GetNumber(0), FXPT_BEZIERTO);
647 } 610 }
648 611
649 void CPDF_StreamContentParser::Handle_ConcatMatrix() { 612 void CPDF_StreamContentParser::Handle_ConcatMatrix() {
650 FX_FLOAT a2 = GetNumber16(5), b2 = GetNumber16(4), c2 = GetNumber16(3), 613 FX_FLOAT a2 = GetNumber16(5), b2 = GetNumber16(4), c2 = GetNumber16(3),
651 d2 = GetNumber16(2); 614 d2 = GetNumber16(2);
652 FX_FLOAT e2 = GetNumber(1), f2 = GetNumber(0); 615 FX_FLOAT e2 = GetNumber(1), f2 = GetNumber(0);
653 CFX_Matrix new_matrix(a2, b2, c2, d2, e2, f2); 616 CFX_Matrix new_matrix(a2, b2, c2, d2, e2, f2);
654 new_matrix.Concat(m_pCurStates->m_CTM); 617 new_matrix.Concat(m_pCurStates->m_CTM);
655 m_pCurStates->m_CTM = new_matrix; 618 m_pCurStates->m_CTM = new_matrix;
656 OnChangeTextMatrix(); 619 OnChangeTextMatrix();
657 } 620 }
658 621
659 void CPDF_StreamContentParser::Handle_SetColorSpace_Fill() { 622 void CPDF_StreamContentParser::Handle_SetColorSpace_Fill() {
660 if (m_Options.m_bTextOnly) {
661 return;
662 }
663 CFX_ByteString csname = GetString(0); 623 CFX_ByteString csname = GetString(0);
664 CPDF_ColorSpace* pCS = FindColorSpace(csname); 624 CPDF_ColorSpace* pCS = FindColorSpace(csname);
665 if (!pCS) { 625 if (!pCS) {
666 return; 626 return;
667 } 627 }
668 m_pCurStates->m_ColorState.GetModify()->m_FillColor.SetColorSpace(pCS); 628 m_pCurStates->m_ColorState.GetModify()->m_FillColor.SetColorSpace(pCS);
669 } 629 }
670 630
671 void CPDF_StreamContentParser::Handle_SetColorSpace_Stroke() { 631 void CPDF_StreamContentParser::Handle_SetColorSpace_Stroke() {
672 if (m_Options.m_bTextOnly) {
673 return;
674 }
675 CFX_ByteString csname = GetString(0); 632 CFX_ByteString csname = GetString(0);
676 CPDF_ColorSpace* pCS = FindColorSpace(csname); 633 CPDF_ColorSpace* pCS = FindColorSpace(csname);
677 if (!pCS) { 634 if (!pCS) {
678 return; 635 return;
679 } 636 }
680 m_pCurStates->m_ColorState.GetModify()->m_StrokeColor.SetColorSpace(pCS); 637 m_pCurStates->m_ColorState.GetModify()->m_StrokeColor.SetColorSpace(pCS);
681 } 638 }
682 639
683 void CPDF_StreamContentParser::Handle_SetDash() { 640 void CPDF_StreamContentParser::Handle_SetDash() {
684 if (m_Options.m_bTextOnly) { 641 CPDF_Array* pArray = GetObject(1) ? GetObject(1)->GetArray() : NULL;
dsinclair 2016/04/26 14:08:23 nit: nullptr
Lei Zhang 2016/04/26 17:25:38 Done.
642 if (!pArray)
685 return; 643 return;
686 } 644
687 CPDF_Array* pArray = GetObject(1) ? GetObject(1)->GetArray() : NULL;
688 if (!pArray) {
689 return;
690 }
691 m_pCurStates->SetLineDash(pArray, GetNumber(0), 1.0f); 645 m_pCurStates->SetLineDash(pArray, GetNumber(0), 1.0f);
692 } 646 }
693 647
694 void CPDF_StreamContentParser::Handle_SetCharWidth() { 648 void CPDF_StreamContentParser::Handle_SetCharWidth() {
695 m_Type3Data[0] = GetNumber(1); 649 m_Type3Data[0] = GetNumber(1);
696 m_Type3Data[1] = GetNumber(0); 650 m_Type3Data[1] = GetNumber(0);
697 m_bColored = TRUE; 651 m_bColored = TRUE;
698 } 652 }
699 653
700 void CPDF_StreamContentParser::Handle_SetCachedDevice() { 654 void CPDF_StreamContentParser::Handle_SetCachedDevice() {
701 for (int i = 0; i < 6; i++) { 655 for (int i = 0; i < 6; i++) {
702 m_Type3Data[i] = GetNumber(5 - i); 656 m_Type3Data[i] = GetNumber(5 - i);
703 } 657 }
704 m_bColored = FALSE; 658 m_bColored = FALSE;
705 } 659 }
706 660
707 void CPDF_StreamContentParser::Handle_ExecuteXObject() { 661 void CPDF_StreamContentParser::Handle_ExecuteXObject() {
708 CFX_ByteString name = GetString(0); 662 CFX_ByteString name = GetString(0);
709 if (name == m_LastImageName && m_pLastImage && m_pLastImage->GetStream() && 663 if (name == m_LastImageName && m_pLastImage && m_pLastImage->GetStream() &&
710 m_pLastImage->GetStream()->GetObjNum()) { 664 m_pLastImage->GetStream()->GetObjNum()) {
711 AddImage(nullptr, m_pLastImage, FALSE); 665 AddImage(nullptr, m_pLastImage, FALSE);
712 return; 666 return;
713 } 667 }
714 668
715 if (m_Options.m_bTextOnly) {
716 if (!m_pResources)
717 return;
718
719 CPDF_Dictionary* pList = m_pResources->GetDictBy("XObject");
720 if (!pList && m_pPageResources && m_pResources != m_pPageResources)
721 pList = m_pPageResources->GetDictBy("XObject");
722 if (!pList)
723 return;
724 CPDF_Reference* pRes = ToReference(pList->GetObjectBy(name));
725 if (!pRes)
726 return;
727
728 FX_BOOL bForm;
729 if (m_pDocument->IsFormStream(pRes->GetRefObjNum(), bForm) && !bForm)
730 return;
731 }
732
733 CPDF_Stream* pXObject = ToStream(FindResourceObj("XObject", name)); 669 CPDF_Stream* pXObject = ToStream(FindResourceObj("XObject", name));
734 if (!pXObject) { 670 if (!pXObject) {
735 m_bResourceMissing = TRUE; 671 m_bResourceMissing = TRUE;
736 return; 672 return;
737 } 673 }
738 674
739 CFX_ByteString type; 675 CFX_ByteString type;
740 if (pXObject->GetDict()) 676 if (pXObject->GetDict())
741 type = pXObject->GetDict()->GetStringBy("Subtype"); 677 type = pXObject->GetDict()->GetStringBy("Subtype");
742 678
743 if (type == "Image") { 679 if (type == "Image") {
744 if (m_Options.m_bTextOnly) {
745 return;
746 }
747 CPDF_ImageObject* pObj = AddImage(pXObject, NULL, FALSE); 680 CPDF_ImageObject* pObj = AddImage(pXObject, NULL, FALSE);
748 m_LastImageName = name; 681 m_LastImageName = name;
749 m_pLastImage = pObj->m_pImage; 682 m_pLastImage = pObj->m_pImage;
750 if (!m_pObjectHolder->HasImageMask()) 683 if (!m_pObjectHolder->HasImageMask())
751 m_pObjectHolder->SetHasImageMask(m_pLastImage->IsMask()); 684 m_pObjectHolder->SetHasImageMask(m_pLastImage->IsMask());
752 } else if (type == "Form") { 685 } else if (type == "Form") {
753 AddForm(pXObject); 686 AddForm(pXObject);
754 } else {
755 return;
756 } 687 }
757 } 688 }
758 689
759 void CPDF_StreamContentParser::AddForm(CPDF_Stream* pStream) { 690 void CPDF_StreamContentParser::AddForm(CPDF_Stream* pStream) {
760 if (!m_Options.m_bSeparateForm) {
761 CPDF_Dictionary* pResources = pStream->GetDict()->GetDictBy("Resources");
762 CFX_Matrix form_matrix = pStream->GetDict()->GetMatrixBy("Matrix");
763 form_matrix.Concat(m_pCurStates->m_CTM);
764 CPDF_Array* pBBox = pStream->GetDict()->GetArrayBy("BBox");
765 CFX_FloatRect form_bbox;
766 CPDF_Path ClipPath;
767 if (pBBox) {
768 form_bbox = pStream->GetDict()->GetRectBy("BBox");
769 ClipPath.New();
770 ClipPath.AppendRect(form_bbox.left, form_bbox.bottom, form_bbox.right,
771 form_bbox.top);
772 ClipPath.Transform(&form_matrix);
773 form_bbox.Transform(&form_matrix);
774 }
775 CPDF_StreamContentParser parser(m_pDocument, m_pPageResources, m_pResources,
776 &m_mtContentToUser, m_pObjectHolder,
777 pResources, &form_bbox, &m_Options,
778 m_pCurStates.get(), m_Level + 1);
779 parser.m_pCurStates->m_CTM = form_matrix;
780 if (ClipPath.NotNull()) {
781 parser.m_pCurStates->m_ClipPath.AppendPath(ClipPath, FXFILL_WINDING,
782 TRUE);
783 }
784 CPDF_StreamAcc stream;
785 stream.LoadAllData(pStream, FALSE);
786 if (stream.GetSize() == 0) {
787 return;
788 }
789 parser.Parse(stream.GetData(), stream.GetSize(), 0);
790 return;
791 }
792 std::unique_ptr<CPDF_FormObject> pFormObj(new CPDF_FormObject); 691 std::unique_ptr<CPDF_FormObject> pFormObj(new CPDF_FormObject);
793 pFormObj->m_pForm = 692 pFormObj->m_pForm =
794 new CPDF_Form(m_pDocument, m_pPageResources, pStream, m_pResources); 693 new CPDF_Form(m_pDocument, m_pPageResources, pStream, m_pResources);
795 pFormObj->m_FormMatrix = m_pCurStates->m_CTM; 694 pFormObj->m_FormMatrix = m_pCurStates->m_CTM;
796 pFormObj->m_FormMatrix.Concat(m_mtContentToUser); 695 pFormObj->m_FormMatrix.Concat(m_mtContentToUser);
797 CPDF_AllStates status; 696 CPDF_AllStates status;
798 status.m_GeneralState = m_pCurStates->m_GeneralState; 697 status.m_GeneralState = m_pCurStates->m_GeneralState;
799 status.m_GraphState = m_pCurStates->m_GraphState; 698 status.m_GraphState = m_pCurStates->m_GraphState;
800 status.m_ColorState = m_pCurStates->m_ColorState; 699 status.m_ColorState = m_pCurStates->m_ColorState;
801 status.m_TextState = m_pCurStates->m_TextState; 700 status.m_TextState = m_pCurStates->m_TextState;
802 pFormObj->m_pForm->ParseContent(&status, NULL, NULL, &m_Options, m_Level + 1); 701 pFormObj->m_pForm->ParseContent(&status, nullptr, nullptr, m_Level + 1);
803 if (!m_pObjectHolder->BackgroundAlphaNeeded() && 702 if (!m_pObjectHolder->BackgroundAlphaNeeded() &&
804 pFormObj->m_pForm->BackgroundAlphaNeeded()) { 703 pFormObj->m_pForm->BackgroundAlphaNeeded()) {
805 m_pObjectHolder->SetBackgroundAlphaNeeded(TRUE); 704 m_pObjectHolder->SetBackgroundAlphaNeeded(TRUE);
806 } 705 }
807 pFormObj->CalcBoundingBox(); 706 pFormObj->CalcBoundingBox();
808 SetGraphicStates(pFormObj.get(), TRUE, TRUE, TRUE); 707 SetGraphicStates(pFormObj.get(), TRUE, TRUE, TRUE);
809 m_pObjectHolder->GetPageObjectList()->push_back(std::move(pFormObj)); 708 m_pObjectHolder->GetPageObjectList()->push_back(std::move(pFormObj));
810 } 709 }
811 710
812 CPDF_ImageObject* CPDF_StreamContentParser::AddImage(CPDF_Stream* pStream, 711 CPDF_ImageObject* CPDF_StreamContentParser::AddImage(CPDF_Stream* pStream,
(...skipping 23 matching lines...) Expand all
836 CPDF_ImageObject* pRet = pImageObj.get(); 735 CPDF_ImageObject* pRet = pImageObj.get();
837 m_pObjectHolder->GetPageObjectList()->push_back(std::move(pImageObj)); 736 m_pObjectHolder->GetPageObjectList()->push_back(std::move(pImageObj));
838 return pRet; 737 return pRet;
839 } 738 }
840 739
841 void CPDF_StreamContentParser::Handle_MarkPlace_Dictionary() {} 740 void CPDF_StreamContentParser::Handle_MarkPlace_Dictionary() {}
842 741
843 void CPDF_StreamContentParser::Handle_EndImage() {} 742 void CPDF_StreamContentParser::Handle_EndImage() {}
844 743
845 void CPDF_StreamContentParser::Handle_EndMarkedContent() { 744 void CPDF_StreamContentParser::Handle_EndMarkedContent() {
846 if (!m_Options.m_bMarkedContent) { 745 if (m_CurContentMark.IsNull())
847 return; 746 return;
848 } 747
849 if (m_CurContentMark.IsNull()) {
850 return;
851 }
852 int count = m_CurContentMark.GetObject()->CountItems(); 748 int count = m_CurContentMark.GetObject()->CountItems();
853 if (count == 1) { 749 if (count == 1) {
854 m_CurContentMark.SetNull(); 750 m_CurContentMark.SetNull();
855 return; 751 return;
856 } 752 }
857 m_CurContentMark.GetModify()->DeleteLastMark(); 753 m_CurContentMark.GetModify()->DeleteLastMark();
858 } 754 }
859 755
860 void CPDF_StreamContentParser::Handle_EndText() { 756 void CPDF_StreamContentParser::Handle_EndText() {
861 int count = m_ClipTextList.GetSize(); 757 int count = m_ClipTextList.GetSize();
862 if (count == 0) { 758 if (count == 0) {
863 return; 759 return;
864 } 760 }
865 if (m_pCurStates->m_TextState.GetObject()->m_TextMode < 4) { 761 if (m_pCurStates->m_TextState.GetObject()->m_TextMode < 4) {
866 for (int i = 0; i < count; i++) { 762 for (int i = 0; i < count; i++) {
867 delete m_ClipTextList.GetAt(i); 763 delete m_ClipTextList.GetAt(i);
868 } 764 }
869 } else { 765 } else {
870 m_pCurStates->m_ClipPath.AppendTexts(m_ClipTextList.GetData(), count); 766 m_pCurStates->m_ClipPath.AppendTexts(m_ClipTextList.GetData(), count);
871 } 767 }
872 m_ClipTextList.RemoveAll(); 768 m_ClipTextList.RemoveAll();
873 } 769 }
874 770
875 void CPDF_StreamContentParser::Handle_FillPath() { 771 void CPDF_StreamContentParser::Handle_FillPath() {
876 if (m_Options.m_bTextOnly) {
877 return;
878 }
879 AddPathObject(FXFILL_WINDING, FALSE); 772 AddPathObject(FXFILL_WINDING, FALSE);
880 } 773 }
881 774
882 void CPDF_StreamContentParser::Handle_FillPathOld() { 775 void CPDF_StreamContentParser::Handle_FillPathOld() {
883 if (m_Options.m_bTextOnly) {
884 return;
885 }
886 AddPathObject(FXFILL_WINDING, FALSE); 776 AddPathObject(FXFILL_WINDING, FALSE);
887 } 777 }
888 778
889 void CPDF_StreamContentParser::Handle_EOFillPath() { 779 void CPDF_StreamContentParser::Handle_EOFillPath() {
890 if (m_Options.m_bTextOnly) {
891 return;
892 }
893 AddPathObject(FXFILL_ALTERNATE, FALSE); 780 AddPathObject(FXFILL_ALTERNATE, FALSE);
894 } 781 }
895 782
896 void CPDF_StreamContentParser::Handle_SetGray_Fill() { 783 void CPDF_StreamContentParser::Handle_SetGray_Fill() {
897 FX_FLOAT value = GetNumber(0); 784 FX_FLOAT value = GetNumber(0);
898 CPDF_ColorSpace* pCS = CPDF_ColorSpace::GetStockCS(PDFCS_DEVICEGRAY); 785 CPDF_ColorSpace* pCS = CPDF_ColorSpace::GetStockCS(PDFCS_DEVICEGRAY);
899 m_pCurStates->m_ColorState.SetFillColor(pCS, &value, 1); 786 m_pCurStates->m_ColorState.SetFillColor(pCS, &value, 1);
900 } 787 }
901 788
902 void CPDF_StreamContentParser::Handle_SetGray_Stroke() { 789 void CPDF_StreamContentParser::Handle_SetGray_Stroke() {
903 FX_FLOAT value = GetNumber(0); 790 FX_FLOAT value = GetNumber(0);
904 CPDF_ColorSpace* pCS = CPDF_ColorSpace::GetStockCS(PDFCS_DEVICEGRAY); 791 CPDF_ColorSpace* pCS = CPDF_ColorSpace::GetStockCS(PDFCS_DEVICEGRAY);
905 m_pCurStates->m_ColorState.SetStrokeColor(pCS, &value, 1); 792 m_pCurStates->m_ColorState.SetStrokeColor(pCS, &value, 1);
906 } 793 }
907 794
908 void CPDF_StreamContentParser::Handle_SetExtendGraphState() { 795 void CPDF_StreamContentParser::Handle_SetExtendGraphState() {
909 CFX_ByteString name = GetString(0); 796 CFX_ByteString name = GetString(0);
910 CPDF_Dictionary* pGS = ToDictionary(FindResourceObj("ExtGState", name)); 797 CPDF_Dictionary* pGS = ToDictionary(FindResourceObj("ExtGState", name));
911 if (!pGS) { 798 if (!pGS) {
912 m_bResourceMissing = TRUE; 799 m_bResourceMissing = TRUE;
913 return; 800 return;
914 } 801 }
915 m_pCurStates->ProcessExtGS(pGS, this); 802 m_pCurStates->ProcessExtGS(pGS, this);
916 } 803 }
917 804
918 void CPDF_StreamContentParser::Handle_ClosePath() { 805 void CPDF_StreamContentParser::Handle_ClosePath() {
919 if (m_Options.m_bTextOnly) {
920 return;
921 }
922 if (m_PathPointCount == 0) { 806 if (m_PathPointCount == 0) {
923 return; 807 return;
924 } 808 }
925 if (m_PathStartX != m_PathCurrentX || m_PathStartY != m_PathCurrentY) { 809 if (m_PathStartX != m_PathCurrentX || m_PathStartY != m_PathCurrentY) {
926 AddPathPoint(m_PathStartX, m_PathStartY, FXPT_LINETO | FXPT_CLOSEFIGURE); 810 AddPathPoint(m_PathStartX, m_PathStartY, FXPT_LINETO | FXPT_CLOSEFIGURE);
927 } else if (m_pPathPoints[m_PathPointCount - 1].m_Flag != FXPT_MOVETO) { 811 } else if (m_pPathPoints[m_PathPointCount - 1].m_Flag != FXPT_MOVETO) {
928 m_pPathPoints[m_PathPointCount - 1].m_Flag |= FXPT_CLOSEFIGURE; 812 m_pPathPoints[m_PathPointCount - 1].m_Flag |= FXPT_CLOSEFIGURE;
929 } 813 }
930 } 814 }
931 815
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
966 values[i] = GetNumber(3 - i); 850 values[i] = GetNumber(3 - i);
967 } 851 }
968 CPDF_ColorSpace* pCS = CPDF_ColorSpace::GetStockCS(PDFCS_DEVICECMYK); 852 CPDF_ColorSpace* pCS = CPDF_ColorSpace::GetStockCS(PDFCS_DEVICECMYK);
969 m_pCurStates->m_ColorState.SetStrokeColor(pCS, values, 4); 853 m_pCurStates->m_ColorState.SetStrokeColor(pCS, values, 4);
970 } 854 }
971 855
972 void CPDF_StreamContentParser::Handle_LineTo() { 856 void CPDF_StreamContentParser::Handle_LineTo() {
973 if (m_ParamCount != 2) 857 if (m_ParamCount != 2)
974 return; 858 return;
975 859
976 if (m_Options.m_bTextOnly) {
977 return;
978 }
979 AddPathPoint(GetNumber(1), GetNumber(0), FXPT_LINETO); 860 AddPathPoint(GetNumber(1), GetNumber(0), FXPT_LINETO);
980 } 861 }
981 862
982 void CPDF_StreamContentParser::Handle_MoveTo() { 863 void CPDF_StreamContentParser::Handle_MoveTo() {
983 if (m_ParamCount != 2) 864 if (m_ParamCount != 2)
984 return; 865 return;
985 866
986 if (m_Options.m_bTextOnly) {
987 m_pSyntax->SkipPathObject();
988 return;
989 }
990 AddPathPoint(GetNumber(1), GetNumber(0), FXPT_MOVETO); 867 AddPathPoint(GetNumber(1), GetNumber(0), FXPT_MOVETO);
991 ParsePathObject(); 868 ParsePathObject();
992 } 869 }
993 870
994 void CPDF_StreamContentParser::Handle_SetMiterLimit() { 871 void CPDF_StreamContentParser::Handle_SetMiterLimit() {
995 m_pCurStates->m_GraphState.GetModify()->m_MiterLimit = GetNumber(0); 872 m_pCurStates->m_GraphState.GetModify()->m_MiterLimit = GetNumber(0);
996 } 873 }
997 874
998 void CPDF_StreamContentParser::Handle_MarkPlace() {} 875 void CPDF_StreamContentParser::Handle_MarkPlace() {}
999 876
1000 void CPDF_StreamContentParser::Handle_EndPath() { 877 void CPDF_StreamContentParser::Handle_EndPath() {
1001 if (m_Options.m_bTextOnly) {
1002 return;
1003 }
1004 AddPathObject(0, FALSE); 878 AddPathObject(0, FALSE);
1005 } 879 }
1006 880
1007 void CPDF_StreamContentParser::Handle_SaveGraphState() { 881 void CPDF_StreamContentParser::Handle_SaveGraphState() {
1008 std::unique_ptr<CPDF_AllStates> pStates(new CPDF_AllStates); 882 std::unique_ptr<CPDF_AllStates> pStates(new CPDF_AllStates);
1009 pStates->Copy(*m_pCurStates); 883 pStates->Copy(*m_pCurStates);
1010 m_StateStack.push_back(std::move(pStates)); 884 m_StateStack.push_back(std::move(pStates));
1011 } 885 }
1012 886
1013 void CPDF_StreamContentParser::Handle_RestoreGraphState() { 887 void CPDF_StreamContentParser::Handle_RestoreGraphState() {
1014 if (m_StateStack.empty()) 888 if (m_StateStack.empty())
1015 return; 889 return;
1016 std::unique_ptr<CPDF_AllStates> pStates = std::move(m_StateStack.back()); 890 std::unique_ptr<CPDF_AllStates> pStates = std::move(m_StateStack.back());
1017 m_StateStack.pop_back(); 891 m_StateStack.pop_back();
1018 m_pCurStates->Copy(*pStates); 892 m_pCurStates->Copy(*pStates);
1019 } 893 }
1020 894
1021 void CPDF_StreamContentParser::Handle_Rectangle() { 895 void CPDF_StreamContentParser::Handle_Rectangle() {
1022 if (m_Options.m_bTextOnly) {
1023 return;
1024 }
1025 FX_FLOAT x = GetNumber(3), y = GetNumber(2); 896 FX_FLOAT x = GetNumber(3), y = GetNumber(2);
1026 FX_FLOAT w = GetNumber(1), h = GetNumber(0); 897 FX_FLOAT w = GetNumber(1), h = GetNumber(0);
1027 AddPathRect(x, y, w, h); 898 AddPathRect(x, y, w, h);
1028 } 899 }
1029 900
1030 void CPDF_StreamContentParser::AddPathRect(FX_FLOAT x, 901 void CPDF_StreamContentParser::AddPathRect(FX_FLOAT x,
1031 FX_FLOAT y, 902 FX_FLOAT y,
1032 FX_FLOAT w, 903 FX_FLOAT w,
1033 FX_FLOAT h) { 904 FX_FLOAT h) {
1034 AddPathPoint(x, y, FXPT_MOVETO); 905 AddPathPoint(x, y, FXPT_MOVETO);
(...skipping 23 matching lines...) Expand all
1058 for (int i = 0; i < 3; i++) { 929 for (int i = 0; i < 3; i++) {
1059 values[i] = GetNumber(2 - i); 930 values[i] = GetNumber(2 - i);
1060 } 931 }
1061 CPDF_ColorSpace* pCS = CPDF_ColorSpace::GetStockCS(PDFCS_DEVICERGB); 932 CPDF_ColorSpace* pCS = CPDF_ColorSpace::GetStockCS(PDFCS_DEVICERGB);
1062 m_pCurStates->m_ColorState.SetStrokeColor(pCS, values, 3); 933 m_pCurStates->m_ColorState.SetStrokeColor(pCS, values, 3);
1063 } 934 }
1064 935
1065 void CPDF_StreamContentParser::Handle_SetRenderIntent() {} 936 void CPDF_StreamContentParser::Handle_SetRenderIntent() {}
1066 937
1067 void CPDF_StreamContentParser::Handle_CloseStrokePath() { 938 void CPDF_StreamContentParser::Handle_CloseStrokePath() {
1068 if (m_Options.m_bTextOnly) {
1069 return;
1070 }
1071 Handle_ClosePath(); 939 Handle_ClosePath();
1072 AddPathObject(0, TRUE); 940 AddPathObject(0, TRUE);
1073 } 941 }
1074 942
1075 void CPDF_StreamContentParser::Handle_StrokePath() { 943 void CPDF_StreamContentParser::Handle_StrokePath() {
1076 if (m_Options.m_bTextOnly) {
1077 return;
1078 }
1079 AddPathObject(0, TRUE); 944 AddPathObject(0, TRUE);
1080 } 945 }
1081 946
1082 void CPDF_StreamContentParser::Handle_SetColor_Fill() { 947 void CPDF_StreamContentParser::Handle_SetColor_Fill() {
1083 if (m_Options.m_bTextOnly) {
1084 return;
1085 }
1086 FX_FLOAT values[4]; 948 FX_FLOAT values[4];
1087 int nargs = m_ParamCount; 949 int nargs = m_ParamCount;
1088 if (nargs > 4) { 950 if (nargs > 4) {
1089 nargs = 4; 951 nargs = 4;
1090 } 952 }
1091 for (int i = 0; i < nargs; i++) { 953 for (int i = 0; i < nargs; i++) {
1092 values[i] = GetNumber(nargs - i - 1); 954 values[i] = GetNumber(nargs - i - 1);
1093 } 955 }
1094 m_pCurStates->m_ColorState.SetFillColor(NULL, values, nargs); 956 m_pCurStates->m_ColorState.SetFillColor(NULL, values, nargs);
1095 } 957 }
1096 958
1097 void CPDF_StreamContentParser::Handle_SetColor_Stroke() { 959 void CPDF_StreamContentParser::Handle_SetColor_Stroke() {
1098 if (m_Options.m_bTextOnly) {
1099 return;
1100 }
1101 FX_FLOAT values[4]; 960 FX_FLOAT values[4];
1102 int nargs = m_ParamCount; 961 int nargs = m_ParamCount;
1103 if (nargs > 4) { 962 if (nargs > 4) {
1104 nargs = 4; 963 nargs = 4;
1105 } 964 }
1106 for (int i = 0; i < nargs; i++) { 965 for (int i = 0; i < nargs; i++) {
1107 values[i] = GetNumber(nargs - i - 1); 966 values[i] = GetNumber(nargs - i - 1);
1108 } 967 }
1109 m_pCurStates->m_ColorState.SetStrokeColor(NULL, values, nargs); 968 m_pCurStates->m_ColorState.SetStrokeColor(NULL, values, nargs);
1110 } 969 }
1111 970
1112 void CPDF_StreamContentParser::Handle_SetColorPS_Fill() { 971 void CPDF_StreamContentParser::Handle_SetColorPS_Fill() {
1113 if (m_Options.m_bTextOnly) {
1114 return;
1115 }
1116 CPDF_Object* pLastParam = GetObject(0); 972 CPDF_Object* pLastParam = GetObject(0);
1117 if (!pLastParam) { 973 if (!pLastParam) {
1118 return; 974 return;
1119 } 975 }
1120 uint32_t nargs = m_ParamCount; 976 uint32_t nargs = m_ParamCount;
1121 uint32_t nvalues = nargs; 977 uint32_t nvalues = nargs;
1122 if (pLastParam->IsName()) 978 if (pLastParam->IsName())
1123 nvalues--; 979 nvalues--;
1124 FX_FLOAT* values = NULL; 980 FX_FLOAT* values = NULL;
1125 if (nvalues) { 981 if (nvalues) {
1126 values = FX_Alloc(FX_FLOAT, nvalues); 982 values = FX_Alloc(FX_FLOAT, nvalues);
1127 for (uint32_t i = 0; i < nvalues; i++) { 983 for (uint32_t i = 0; i < nvalues; i++) {
1128 values[i] = GetNumber(nargs - i - 1); 984 values[i] = GetNumber(nargs - i - 1);
1129 } 985 }
1130 } 986 }
1131 if (nvalues != nargs) { 987 if (nvalues != nargs) {
1132 CPDF_Pattern* pPattern = FindPattern(GetString(0), FALSE); 988 CPDF_Pattern* pPattern = FindPattern(GetString(0), FALSE);
1133 if (pPattern) { 989 if (pPattern) {
1134 m_pCurStates->m_ColorState.SetFillPattern(pPattern, values, nvalues); 990 m_pCurStates->m_ColorState.SetFillPattern(pPattern, values, nvalues);
1135 } 991 }
1136 } else { 992 } else {
1137 m_pCurStates->m_ColorState.SetFillColor(NULL, values, nvalues); 993 m_pCurStates->m_ColorState.SetFillColor(NULL, values, nvalues);
1138 } 994 }
1139 FX_Free(values); 995 FX_Free(values);
1140 } 996 }
1141 997
1142 void CPDF_StreamContentParser::Handle_SetColorPS_Stroke() { 998 void CPDF_StreamContentParser::Handle_SetColorPS_Stroke() {
1143 if (m_Options.m_bTextOnly) {
1144 return;
1145 }
1146 CPDF_Object* pLastParam = GetObject(0); 999 CPDF_Object* pLastParam = GetObject(0);
1147 if (!pLastParam) { 1000 if (!pLastParam) {
1148 return; 1001 return;
1149 } 1002 }
1150 int nargs = m_ParamCount; 1003 int nargs = m_ParamCount;
1151 int nvalues = nargs; 1004 int nvalues = nargs;
1152 if (pLastParam->IsName()) 1005 if (pLastParam->IsName())
1153 nvalues--; 1006 nvalues--;
1154 1007
1155 FX_FLOAT* values = NULL; 1008 FX_FLOAT* values = NULL;
(...skipping 15 matching lines...) Expand all
1171 } 1024 }
1172 1025
1173 CFX_FloatRect GetShadingBBox(CPDF_Stream* pStream, 1026 CFX_FloatRect GetShadingBBox(CPDF_Stream* pStream,
1174 ShadingType type, 1027 ShadingType type,
1175 const CFX_Matrix* pMatrix, 1028 const CFX_Matrix* pMatrix,
1176 CPDF_Function** pFuncs, 1029 CPDF_Function** pFuncs,
1177 int nFuncs, 1030 int nFuncs,
1178 CPDF_ColorSpace* pCS); 1031 CPDF_ColorSpace* pCS);
1179 1032
1180 void CPDF_StreamContentParser::Handle_ShadeFill() { 1033 void CPDF_StreamContentParser::Handle_ShadeFill() {
1181 if (m_Options.m_bTextOnly) {
1182 return;
1183 }
1184 CPDF_Pattern* pPattern = FindPattern(GetString(0), TRUE); 1034 CPDF_Pattern* pPattern = FindPattern(GetString(0), TRUE);
1185 if (!pPattern) { 1035 if (!pPattern) {
1186 return; 1036 return;
1187 } 1037 }
1188 if (pPattern->m_PatternType != CPDF_Pattern::SHADING) { 1038 if (pPattern->m_PatternType != CPDF_Pattern::SHADING) {
1189 return; 1039 return;
1190 } 1040 }
1191 CPDF_ShadingPattern* pShading = static_cast<CPDF_ShadingPattern*>(pPattern); 1041 CPDF_ShadingPattern* pShading = static_cast<CPDF_ShadingPattern*>(pPattern);
1192 if (!pShading->m_bShadingObj) { 1042 if (!pShading->m_bShadingObj) {
1193 return; 1043 return;
(...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after
1511 OnChangeTextMatrix(); 1361 OnChangeTextMatrix();
1512 } 1362 }
1513 1363
1514 void CPDF_StreamContentParser::Handle_MoveToNextLine() { 1364 void CPDF_StreamContentParser::Handle_MoveToNextLine() {
1515 m_pCurStates->m_TextLineY -= m_pCurStates->m_TextLeading; 1365 m_pCurStates->m_TextLineY -= m_pCurStates->m_TextLeading;
1516 m_pCurStates->m_TextX = m_pCurStates->m_TextLineX; 1366 m_pCurStates->m_TextX = m_pCurStates->m_TextLineX;
1517 m_pCurStates->m_TextY = m_pCurStates->m_TextLineY; 1367 m_pCurStates->m_TextY = m_pCurStates->m_TextLineY;
1518 } 1368 }
1519 1369
1520 void CPDF_StreamContentParser::Handle_CurveTo_23() { 1370 void CPDF_StreamContentParser::Handle_CurveTo_23() {
1521 if (m_Options.m_bTextOnly) {
1522 return;
1523 }
1524 AddPathPoint(m_PathCurrentX, m_PathCurrentY, FXPT_BEZIERTO); 1371 AddPathPoint(m_PathCurrentX, m_PathCurrentY, FXPT_BEZIERTO);
1525 AddPathPoint(GetNumber(3), GetNumber(2), FXPT_BEZIERTO); 1372 AddPathPoint(GetNumber(3), GetNumber(2), FXPT_BEZIERTO);
1526 AddPathPoint(GetNumber(1), GetNumber(0), FXPT_BEZIERTO); 1373 AddPathPoint(GetNumber(1), GetNumber(0), FXPT_BEZIERTO);
1527 } 1374 }
1528 1375
1529 void CPDF_StreamContentParser::Handle_SetLineWidth() { 1376 void CPDF_StreamContentParser::Handle_SetLineWidth() {
1530 FX_FLOAT width = GetNumber(0); 1377 FX_FLOAT width = GetNumber(0);
1531 m_pCurStates->m_GraphState.GetModify()->m_LineWidth = width; 1378 m_pCurStates->m_GraphState.GetModify()->m_LineWidth = width;
1532 } 1379 }
1533 1380
1534 void CPDF_StreamContentParser::Handle_Clip() { 1381 void CPDF_StreamContentParser::Handle_Clip() {
1535 m_PathClipType = FXFILL_WINDING; 1382 m_PathClipType = FXFILL_WINDING;
1536 } 1383 }
1537 1384
1538 void CPDF_StreamContentParser::Handle_EOClip() { 1385 void CPDF_StreamContentParser::Handle_EOClip() {
1539 m_PathClipType = FXFILL_ALTERNATE; 1386 m_PathClipType = FXFILL_ALTERNATE;
1540 } 1387 }
1541 1388
1542 void CPDF_StreamContentParser::Handle_CurveTo_13() { 1389 void CPDF_StreamContentParser::Handle_CurveTo_13() {
1543 if (m_Options.m_bTextOnly) {
1544 return;
1545 }
1546 AddPathPoint(GetNumber(3), GetNumber(2), FXPT_BEZIERTO); 1390 AddPathPoint(GetNumber(3), GetNumber(2), FXPT_BEZIERTO);
1547 AddPathPoint(GetNumber(1), GetNumber(0), FXPT_BEZIERTO); 1391 AddPathPoint(GetNumber(1), GetNumber(0), FXPT_BEZIERTO);
1548 AddPathPoint(GetNumber(1), GetNumber(0), FXPT_BEZIERTO); 1392 AddPathPoint(GetNumber(1), GetNumber(0), FXPT_BEZIERTO);
1549 } 1393 }
1550 1394
1551 void CPDF_StreamContentParser::Handle_NextLineShowText() { 1395 void CPDF_StreamContentParser::Handle_NextLineShowText() {
1552 Handle_MoveToNextLine(); 1396 Handle_MoveToNextLine();
1553 Handle_ShowText(); 1397 Handle_ShowText();
1554 } 1398 }
1555 1399
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after
1815 } else { 1659 } else {
1816 PDF_ReplaceAbbr(pElement); 1660 PDF_ReplaceAbbr(pElement);
1817 } 1661 }
1818 } 1662 }
1819 break; 1663 break;
1820 } 1664 }
1821 default: 1665 default:
1822 break; 1666 break;
1823 } 1667 }
1824 } 1668 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698