| 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/fpdfapi/fpdf_serial.h" | 9 #include "../../../include/fpdfapi/fpdf_serial.h" |
| 10 #include "pageint.h" | 10 #include "pageint.h" |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 m_bColored = FALSE; | 22 m_bColored = FALSE; |
| 23 FXSYS_memset32(m_Type3Data, 0, sizeof(FX_FLOAT) * 6); | 23 FXSYS_memset32(m_Type3Data, 0, sizeof(FX_FLOAT) * 6); |
| 24 m_ParamCount = 0; | 24 m_ParamCount = 0; |
| 25 m_ParamStartPos = 0; | 25 m_ParamStartPos = 0; |
| 26 m_bAbort = FALSE; | 26 m_bAbort = FALSE; |
| 27 m_pLastImageDict = NULL; | 27 m_pLastImageDict = NULL; |
| 28 m_pLastCloneImageDict = NULL; | 28 m_pLastCloneImageDict = NULL; |
| 29 m_pLastImage = NULL; | 29 m_pLastImage = NULL; |
| 30 m_bReleaseLastDict = TRUE; | 30 m_bReleaseLastDict = TRUE; |
| 31 m_pParentResources = NULL; | 31 m_pParentResources = NULL; |
| 32 #ifdef _FPDFAPI_MINI_ | |
| 33 m_pObjectState = NULL; | |
| 34 m_pObjectStack = NULL; | |
| 35 m_pWordBuf = NULL; | |
| 36 m_pDictName = NULL; | |
| 37 m_pStreamBuf = NULL; | |
| 38 m_WordState = 0; | |
| 39 m_ObjectSize = 0; | |
| 40 #endif | |
| 41 } | 32 } |
| 42 FX_BOOL CPDF_StreamContentParser::Initialize() | 33 FX_BOOL CPDF_StreamContentParser::Initialize() |
| 43 { | 34 { |
| 44 #ifdef _FPDFAPI_MINI_ | |
| 45 m_pObjectState = FX_Alloc(FX_BOOL, _FPDF_MAX_OBJECT_STACK_SIZE_); | |
| 46 FXSYS_memset32(m_pObjectState, 0, _FPDF_MAX_OBJECT_STACK_SIZE_ * sizeof(FX_B
OOL)); | |
| 47 m_pObjectStack = FX_Alloc(CPDF_Object*, _FPDF_MAX_OBJECT_STACK_SIZE_); | |
| 48 FXSYS_memset32(m_pObjectStack, 0, _FPDF_MAX_OBJECT_STACK_SIZE_ * sizeof(CPDF
_Object*)); | |
| 49 m_pWordBuf = FX_Alloc(FX_BYTE, 256); | |
| 50 FXSYS_memset32(m_pWordBuf, 0, 256 * sizeof(FX_BYTE)); | |
| 51 m_pDictName = FX_Alloc(FX_BYTE, 256); | |
| 52 FXSYS_memset32(m_pDictName, 0, 256 * sizeof(FX_BYTE)); | |
| 53 m_pStreamBuf = FX_Alloc(FX_BYTE, STREAM_PARSE_BUFSIZE); | |
| 54 FXSYS_memset32(m_pStreamBuf, 0, STREAM_PARSE_BUFSIZE * sizeof(FX_BYTE)); | |
| 55 m_StringBuf.EstimateSize(1024); | |
| 56 m_ObjectSize = 0; | |
| 57 m_ImageSrcBuf.EstimateSize(STREAM_PARSE_BUFSIZE); | |
| 58 #endif | |
| 59 return TRUE; | 35 return TRUE; |
| 60 } | 36 } |
| 61 CPDF_StreamContentParser::~CPDF_StreamContentParser() | 37 CPDF_StreamContentParser::~CPDF_StreamContentParser() |
| 62 { | 38 { |
| 63 ClearAllParams(); | 39 ClearAllParams(); |
| 64 int i = 0; | 40 int i = 0; |
| 65 for (i = 0; i < m_StateStack.GetSize(); i ++) { | 41 for (i = 0; i < m_StateStack.GetSize(); i ++) { |
| 66 delete (CPDF_AllStates*)m_StateStack[i]; | 42 delete (CPDF_AllStates*)m_StateStack[i]; |
| 67 } | 43 } |
| 68 if (m_pPathPoints) { | 44 if (m_pPathPoints) { |
| 69 FX_Free(m_pPathPoints); | 45 FX_Free(m_pPathPoints); |
| 70 } | 46 } |
| 71 if (m_pCurStates) { | 47 if (m_pCurStates) { |
| 72 delete m_pCurStates; | 48 delete m_pCurStates; |
| 73 } | 49 } |
| 74 if (m_pLastImageDict) { | 50 if (m_pLastImageDict) { |
| 75 m_pLastImageDict->Release(); | 51 m_pLastImageDict->Release(); |
| 76 } | 52 } |
| 77 if (m_pLastCloneImageDict) { | 53 if (m_pLastCloneImageDict) { |
| 78 m_pLastCloneImageDict->Release(); | 54 m_pLastCloneImageDict->Release(); |
| 79 } | 55 } |
| 80 #ifdef _FPDFAPI_MINI_ | |
| 81 for (i = 0; i < (int)m_ObjectSize; ++i) { | |
| 82 if (!m_pObjectState[i]) { | |
| 83 m_pObjectStack[i]->Release(); | |
| 84 } | |
| 85 } | |
| 86 FX_Free(m_pObjectStack); | |
| 87 FX_Free(m_pObjectState); | |
| 88 FX_Free(m_pStreamBuf); | |
| 89 FX_Free(m_pWordBuf); | |
| 90 FX_Free(m_pDictName); | |
| 91 #endif | |
| 92 } | 56 } |
| 93 void CPDF_StreamContentParser::PrepareParse(CPDF_Document* pDocument, | 57 void CPDF_StreamContentParser::PrepareParse(CPDF_Document* pDocument, |
| 94 CPDF_Dictionary* pPageResources, CPDF_Dictionary* pParentResources, CFX_
AffineMatrix* pmtContentToUser, CPDF_PageObjects* pObjList, | 58 CPDF_Dictionary* pPageResources, CPDF_Dictionary* pParentResources, CFX_
AffineMatrix* pmtContentToUser, CPDF_PageObjects* pObjList, |
| 95 CPDF_Dictionary* pResources, CPDF_Rect* pBBox, CPDF_ParseOptions* pOptio
ns, | 59 CPDF_Dictionary* pResources, CPDF_Rect* pBBox, CPDF_ParseOptions* pOptio
ns, |
| 96 CPDF_AllStates* pStates, int level) | 60 CPDF_AllStates* pStates, int level) |
| 97 { | 61 { |
| 98 for (int i = 0; i < 6; i ++) { | 62 for (int i = 0; i < 6; i ++) { |
| 99 m_Type3Data[i] = 0; | 63 m_Type3Data[i] = 0; |
| 100 } | 64 } |
| 101 m_pDocument = pDocument; | 65 m_pDocument = pDocument; |
| (...skipping 19 matching lines...) Expand all Loading... |
| 121 m_Level = level; | 85 m_Level = level; |
| 122 m_pCurStates = FX_NEW CPDF_AllStates; | 86 m_pCurStates = FX_NEW CPDF_AllStates; |
| 123 if (pStates) { | 87 if (pStates) { |
| 124 m_pCurStates->Copy(*pStates); | 88 m_pCurStates->Copy(*pStates); |
| 125 } else { | 89 } else { |
| 126 m_pCurStates->m_GeneralState.New(); | 90 m_pCurStates->m_GeneralState.New(); |
| 127 m_pCurStates->m_GraphState.New(); | 91 m_pCurStates->m_GraphState.New(); |
| 128 m_pCurStates->m_TextState.New(); | 92 m_pCurStates->m_TextState.New(); |
| 129 m_pCurStates->m_ColorState.New(); | 93 m_pCurStates->m_ColorState.New(); |
| 130 } | 94 } |
| 131 #ifdef _FPDFAPI_MINI_ | |
| 132 FXSYS_memset32(m_pObjectState, 0, _FPDF_MAX_OBJECT_STACK_SIZE_ * sizeof(FX_B
OOL)); | |
| 133 #endif | |
| 134 } | 95 } |
| 135 int CPDF_StreamContentParser::GetNextParamPos() | 96 int CPDF_StreamContentParser::GetNextParamPos() |
| 136 { | 97 { |
| 137 if (m_ParamCount == PARAM_BUF_SIZE) { | 98 if (m_ParamCount == PARAM_BUF_SIZE) { |
| 138 m_ParamStartPos ++; | 99 m_ParamStartPos ++; |
| 139 if (m_ParamStartPos == PARAM_BUF_SIZE) { | 100 if (m_ParamStartPos == PARAM_BUF_SIZE) { |
| 140 m_ParamStartPos = 0; | 101 m_ParamStartPos = 0; |
| 141 } | 102 } |
| 142 if (m_ParamBuf1[m_ParamStartPos].m_Type == 0) { | 103 if (m_ParamBuf1[m_ParamStartPos].m_Type == 0) { |
| 143 if (CPDF_Object* pObject = m_ParamBuf1[m_ParamStartPos].m_pObject) | 104 if (CPDF_Object* pObject = m_ParamBuf1[m_ParamStartPos].m_pObject) |
| (...skipping 525 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 669 { | 630 { |
| 670 for (int i = 0; i < 6; i ++) { | 631 for (int i = 0; i < 6; i ++) { |
| 671 m_Type3Data[i] = GetNumber(5 - i); | 632 m_Type3Data[i] = GetNumber(5 - i); |
| 672 } | 633 } |
| 673 m_bColored = FALSE; | 634 m_bColored = FALSE; |
| 674 } | 635 } |
| 675 void CPDF_StreamContentParser::Handle_ExecuteXObject() | 636 void CPDF_StreamContentParser::Handle_ExecuteXObject() |
| 676 { | 637 { |
| 677 CFX_ByteString name = GetString(0); | 638 CFX_ByteString name = GetString(0); |
| 678 if (name == m_LastImageName && m_pLastImage && m_pLastImage->GetStream() &&
m_pLastImage->GetStream()->GetObjNum()) { | 639 if (name == m_LastImageName && m_pLastImage && m_pLastImage->GetStream() &&
m_pLastImage->GetStream()->GetObjNum()) { |
| 679 #if defined(_FPDFAPI_MINI_) && !defined(_FXCORE_FEATURE_ALL_) | |
| 680 AddDuplicateImage(); | |
| 681 #else | |
| 682 AddImage(NULL, m_pLastImage, FALSE); | 640 AddImage(NULL, m_pLastImage, FALSE); |
| 683 #endif | |
| 684 return; | 641 return; |
| 685 } | 642 } |
| 686 if (m_Options.m_bTextOnly) { | 643 if (m_Options.m_bTextOnly) { |
| 687 CPDF_Object* pRes = NULL; | 644 CPDF_Object* pRes = NULL; |
| 688 if (m_pResources == NULL) { | 645 if (m_pResources == NULL) { |
| 689 return; | 646 return; |
| 690 } | 647 } |
| 691 if (m_pResources == m_pPageResources) { | 648 if (m_pResources == m_pPageResources) { |
| 692 CPDF_Dictionary* pList = m_pResources->GetDict(FX_BSTRC("XObject")); | 649 CPDF_Dictionary* pList = m_pResources->GetDict(FX_BSTRC("XObject")); |
| 693 if (pList == NULL) { | 650 if (pList == NULL) { |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 737 m_LastImageName = name; | 694 m_LastImageName = name; |
| 738 m_pLastImage = pObj->m_pImage; | 695 m_pLastImage = pObj->m_pImage; |
| 739 } else if (type == FX_BSTRC("Form")) { | 696 } else if (type == FX_BSTRC("Form")) { |
| 740 AddForm(pXObject); | 697 AddForm(pXObject); |
| 741 } else { | 698 } else { |
| 742 return; | 699 return; |
| 743 } | 700 } |
| 744 } | 701 } |
| 745 void CPDF_StreamContentParser::AddForm(CPDF_Stream* pStream) | 702 void CPDF_StreamContentParser::AddForm(CPDF_Stream* pStream) |
| 746 { | 703 { |
| 747 #if !defined(_FPDFAPI_MINI_) || defined(_FXCORE_FEATURE_ALL_) | |
| 748 if (!m_Options.m_bSeparateForm) { | 704 if (!m_Options.m_bSeparateForm) { |
| 749 CPDF_Dictionary* pResources = pStream->GetDict()->GetDict(FX_BSTRC("Reso
urces")); | 705 CPDF_Dictionary* pResources = pStream->GetDict()->GetDict(FX_BSTRC("Reso
urces")); |
| 750 CFX_AffineMatrix form_matrix = pStream->GetDict()->GetMatrix(FX_BSTRC("M
atrix")); | 706 CFX_AffineMatrix form_matrix = pStream->GetDict()->GetMatrix(FX_BSTRC("M
atrix")); |
| 751 form_matrix.Concat(m_pCurStates->m_CTM); | 707 form_matrix.Concat(m_pCurStates->m_CTM); |
| 752 CPDF_Array* pBBox = pStream->GetDict()->GetArray(FX_BSTRC("BBox")); | 708 CPDF_Array* pBBox = pStream->GetDict()->GetArray(FX_BSTRC("BBox")); |
| 753 CFX_FloatRect form_bbox; | 709 CFX_FloatRect form_bbox; |
| 754 CPDF_Path ClipPath; | 710 CPDF_Path ClipPath; |
| 755 if (pBBox) { | 711 if (pBBox) { |
| 756 form_bbox = pStream->GetDict()->GetRect(FX_BSTRC("BBox")); | 712 form_bbox = pStream->GetDict()->GetRect(FX_BSTRC("BBox")); |
| 757 ClipPath.New(); | 713 ClipPath.New(); |
| 758 ClipPath.AppendRect(form_bbox.left, form_bbox.bottom, form_bbox.righ
t, form_bbox.top); | 714 ClipPath.AppendRect(form_bbox.left, form_bbox.bottom, form_bbox.righ
t, form_bbox.top); |
| 759 ClipPath.Transform(&form_matrix); | 715 ClipPath.Transform(&form_matrix); |
| 760 form_bbox.Transform(&form_matrix); | 716 form_bbox.Transform(&form_matrix); |
| 761 } | 717 } |
| 762 CPDF_StreamContentParser parser; | 718 CPDF_StreamContentParser parser; |
| 763 parser.Initialize(); | 719 parser.Initialize(); |
| 764 parser.PrepareParse(m_pDocument, m_pPageResources, m_pResources, &m_mtCo
ntentToUser, | 720 parser.PrepareParse(m_pDocument, m_pPageResources, m_pResources, &m_mtCo
ntentToUser, |
| 765 m_pObjectList, pResources, &form_bbox, &m_Options, m
_pCurStates, m_Level + 1); | 721 m_pObjectList, pResources, &form_bbox, &m_Options, m
_pCurStates, m_Level + 1); |
| 766 parser.m_pCurStates->m_CTM = form_matrix; | 722 parser.m_pCurStates->m_CTM = form_matrix; |
| 767 if (ClipPath.NotNull()) { | 723 if (ClipPath.NotNull()) { |
| 768 parser.m_pCurStates->m_ClipPath.AppendPath(ClipPath, FXFILL_WINDING,
TRUE); | 724 parser.m_pCurStates->m_ClipPath.AppendPath(ClipPath, FXFILL_WINDING,
TRUE); |
| 769 } | 725 } |
| 770 CPDF_StreamAcc stream; | 726 CPDF_StreamAcc stream; |
| 771 stream.LoadAllData(pStream, FALSE); | 727 stream.LoadAllData(pStream, FALSE); |
| 772 if (stream.GetSize() == 0) { | 728 if (stream.GetSize() == 0) { |
| 773 return; | 729 return; |
| 774 } | 730 } |
| 775 #ifdef _FPDFAPI_MINI_ | |
| 776 parser.InputData(stream.GetData(), stream.GetSize()); | |
| 777 parser.Finish(); | |
| 778 #else | |
| 779 parser.Parse(stream.GetData(), stream.GetSize(), 0); | 731 parser.Parse(stream.GetData(), stream.GetSize(), 0); |
| 780 #endif | |
| 781 return; | 732 return; |
| 782 } | 733 } |
| 783 #endif | |
| 784 CPDF_FormObject* pFormObj = FX_NEW CPDF_FormObject; | 734 CPDF_FormObject* pFormObj = FX_NEW CPDF_FormObject; |
| 785 pFormObj->m_pForm = FX_NEW CPDF_Form(m_pDocument, m_pPageResources, pStream,
m_pResources); | 735 pFormObj->m_pForm = FX_NEW CPDF_Form(m_pDocument, m_pPageResources, pStream,
m_pResources); |
| 786 pFormObj->m_FormMatrix = m_pCurStates->m_CTM; | 736 pFormObj->m_FormMatrix = m_pCurStates->m_CTM; |
| 787 pFormObj->m_FormMatrix.Concat(m_mtContentToUser); | 737 pFormObj->m_FormMatrix.Concat(m_mtContentToUser); |
| 788 CPDF_AllStates status; | 738 CPDF_AllStates status; |
| 789 status.m_GeneralState = m_pCurStates->m_GeneralState; | 739 status.m_GeneralState = m_pCurStates->m_GeneralState; |
| 790 status.m_GraphState = m_pCurStates->m_GraphState; | 740 status.m_GraphState = m_pCurStates->m_GraphState; |
| 791 status.m_ColorState = m_pCurStates->m_ColorState; | 741 status.m_ColorState = m_pCurStates->m_ColorState; |
| 792 status.m_TextState = m_pCurStates->m_TextState; | 742 status.m_TextState = m_pCurStates->m_TextState; |
| 793 pFormObj->m_pForm->ParseContent(&status, NULL, NULL, &m_Options, m_Level + 1
); | 743 pFormObj->m_pForm->ParseContent(&status, NULL, NULL, &m_Options, m_Level + 1
); |
| 794 if (!m_pObjectList->m_bBackgroundAlphaNeeded && pFormObj->m_pForm->m_bBackgr
oundAlphaNeeded) { | 744 if (!m_pObjectList->m_bBackgroundAlphaNeeded && pFormObj->m_pForm->m_bBackgr
oundAlphaNeeded) { |
| 795 m_pObjectList->m_bBackgroundAlphaNeeded = TRUE; | 745 m_pObjectList->m_bBackgroundAlphaNeeded = TRUE; |
| 796 } | 746 } |
| 797 pFormObj->CalcBoundingBox(); | 747 pFormObj->CalcBoundingBox(); |
| 798 SetGraphicStates(pFormObj, TRUE, TRUE, TRUE); | 748 SetGraphicStates(pFormObj, TRUE, TRUE, TRUE); |
| 799 m_pObjectList->m_ObjectList.AddTail(pFormObj); | 749 m_pObjectList->m_ObjectList.AddTail(pFormObj); |
| 800 } | 750 } |
| 801 #if defined(_FPDFAPI_MINI_) && !defined(_FXCORE_FEATURE_ALL_) | |
| 802 void CPDF_StreamContentParser::AddDuplicateImage() | |
| 803 { | |
| 804 FX_POSITION tailpos = m_pObjectList->m_ObjectList.GetTailPosition(); | |
| 805 CPDF_PageObject* pLastObj = (CPDF_PageObject*)m_pObjectList->m_ObjectList.Ge
tAt(tailpos); | |
| 806 if (pLastObj == NULL || (pLastObj->m_Type != PDFPAGE_INLINES && pLastObj->m_
Type != PDFPAGE_IMAGE)) { | |
| 807 AddImage(NULL, m_pLastImage, FALSE); | |
| 808 return; | |
| 809 } | |
| 810 if (pLastObj->m_GeneralState != m_pCurStates->m_GeneralState || | |
| 811 pLastObj->m_ClipPath != m_pCurStates->m_ClipPath || | |
| 812 pLastObj->m_ColorState != m_pCurStates->m_ColorState) { | |
| 813 AddImage(NULL, m_pLastImage, FALSE); | |
| 814 return; | |
| 815 } | |
| 816 CFX_AffineMatrix ImageMatrix; | |
| 817 ImageMatrix.Copy(m_pCurStates->m_CTM); | |
| 818 ImageMatrix.Concat(m_mtContentToUser); | |
| 819 if (pLastObj->m_Type == PDFPAGE_INLINES) { | |
| 820 CPDF_InlineImages* pInlines = (CPDF_InlineImages*)pLastObj; | |
| 821 if (pInlines->m_pStream != m_pLastImage->GetStream()) { | |
| 822 AddImage(NULL, m_pLastImage, FALSE); | |
| 823 return; | |
| 824 } | |
| 825 pInlines->AddMatrix(ImageMatrix); | |
| 826 } else { | |
| 827 CPDF_ImageObject* pImageObj = (CPDF_ImageObject*)pLastObj; | |
| 828 CPDF_InlineImages* pInlines = FX_NEW CPDF_InlineImages; | |
| 829 pInlines->m_pStream = m_pLastImage->GetStream(); | |
| 830 SetGraphicStates(pInlines, !pInlines->m_pStream->GetDict()->KeyExist(FX_
BSTRC("ColorSpace")), FALSE, FALSE); | |
| 831 pInlines->AddMatrix(pImageObj->m_Matrix); | |
| 832 pInlines->AddMatrix(ImageMatrix); | |
| 833 m_pObjectList->m_ObjectList.RemoveAt(tailpos); | |
| 834 m_pObjectList->m_ObjectList.AddTail(pInlines); | |
| 835 pLastObj->Release(); | |
| 836 } | |
| 837 } | |
| 838 #endif | |
| 839 CPDF_ImageObject* CPDF_StreamContentParser::AddImage(CPDF_Stream* pStream, CPDF_
Image* pImage, FX_BOOL bInline) | 751 CPDF_ImageObject* CPDF_StreamContentParser::AddImage(CPDF_Stream* pStream, CPDF_
Image* pImage, FX_BOOL bInline) |
| 840 { | 752 { |
| 841 if (pStream == NULL && pImage == NULL) { | 753 if (pStream == NULL && pImage == NULL) { |
| 842 return NULL; | 754 return NULL; |
| 843 } | 755 } |
| 844 CFX_AffineMatrix ImageMatrix; | 756 CFX_AffineMatrix ImageMatrix; |
| 845 ImageMatrix.Copy(m_pCurStates->m_CTM); | 757 ImageMatrix.Copy(m_pCurStates->m_CTM); |
| 846 ImageMatrix.Concat(m_mtContentToUser); | 758 ImageMatrix.Concat(m_mtContentToUser); |
| 847 CPDF_ImageObject* pImageObj = FX_NEW CPDF_ImageObject; | 759 CPDF_ImageObject* pImageObj = FX_NEW CPDF_ImageObject; |
| 848 if (pImage) { | 760 if (pImage) { |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 956 return; | 868 return; |
| 957 } | 869 } |
| 958 if (m_PathStartX != m_PathCurrentX || m_PathStartY != m_PathCurrentY) { | 870 if (m_PathStartX != m_PathCurrentX || m_PathStartY != m_PathCurrentY) { |
| 959 AddPathPoint(m_PathStartX, m_PathStartY, FXPT_LINETO | FXPT_CLOSEFIGURE)
; | 871 AddPathPoint(m_PathStartX, m_PathStartY, FXPT_LINETO | FXPT_CLOSEFIGURE)
; |
| 960 } else if (m_pPathPoints[m_PathPointCount - 1].m_Flag != FXPT_MOVETO) { | 872 } else if (m_pPathPoints[m_PathPointCount - 1].m_Flag != FXPT_MOVETO) { |
| 961 m_pPathPoints[m_PathPointCount - 1].m_Flag |= FXPT_CLOSEFIGURE; | 873 m_pPathPoints[m_PathPointCount - 1].m_Flag |= FXPT_CLOSEFIGURE; |
| 962 } | 874 } |
| 963 } | 875 } |
| 964 void CPDF_StreamContentParser::Handle_SetFlat() | 876 void CPDF_StreamContentParser::Handle_SetFlat() |
| 965 { | 877 { |
| 966 #if !defined(_FPDFAPI_MINI_) || defined(_FXCORE_FEATURE_ALL_) | |
| 967 m_pCurStates->m_GeneralState.GetModify()->m_Flatness = GetNumber(0); | 878 m_pCurStates->m_GeneralState.GetModify()->m_Flatness = GetNumber(0); |
| 968 #endif | |
| 969 } | 879 } |
| 970 void CPDF_StreamContentParser::Handle_BeginImageData() | 880 void CPDF_StreamContentParser::Handle_BeginImageData() |
| 971 { | 881 { |
| 972 } | 882 } |
| 973 void CPDF_StreamContentParser::Handle_SetLineJoin() | 883 void CPDF_StreamContentParser::Handle_SetLineJoin() |
| 974 { | 884 { |
| 975 m_pCurStates->m_GraphState.GetModify()->m_LineJoin = (CFX_GraphStateData::Li
neJoin)GetInteger(0); | 885 m_pCurStates->m_GraphState.GetModify()->m_LineJoin = (CFX_GraphStateData::Li
neJoin)GetInteger(0); |
| 976 } | 886 } |
| 977 void CPDF_StreamContentParser::Handle_SetLineCap() | 887 void CPDF_StreamContentParser::Handle_SetLineCap() |
| 978 { | 888 { |
| (...skipping 24 matching lines...) Expand all Loading... |
| 1003 REQUIRE_PARAMS(2); | 913 REQUIRE_PARAMS(2); |
| 1004 if (m_Options.m_bTextOnly) { | 914 if (m_Options.m_bTextOnly) { |
| 1005 return; | 915 return; |
| 1006 } | 916 } |
| 1007 AddPathPoint(GetNumber(1), GetNumber(0), FXPT_LINETO); | 917 AddPathPoint(GetNumber(1), GetNumber(0), FXPT_LINETO); |
| 1008 } | 918 } |
| 1009 void CPDF_StreamContentParser::Handle_MoveTo() | 919 void CPDF_StreamContentParser::Handle_MoveTo() |
| 1010 { | 920 { |
| 1011 REQUIRE_PARAMS(2); | 921 REQUIRE_PARAMS(2); |
| 1012 if (m_Options.m_bTextOnly) { | 922 if (m_Options.m_bTextOnly) { |
| 1013 #ifndef _FPDFAPI_MINI_ | |
| 1014 m_pSyntax->SkipPathObject(); | 923 m_pSyntax->SkipPathObject(); |
| 1015 #endif | |
| 1016 return; | 924 return; |
| 1017 } | 925 } |
| 1018 AddPathPoint(GetNumber(1), GetNumber(0), FXPT_MOVETO); | 926 AddPathPoint(GetNumber(1), GetNumber(0), FXPT_MOVETO); |
| 1019 #ifndef _FPDFAPI_MINI_ | |
| 1020 ParsePathObject(); | 927 ParsePathObject(); |
| 1021 #endif | |
| 1022 } | 928 } |
| 1023 void CPDF_StreamContentParser::Handle_SetMiterLimit() | 929 void CPDF_StreamContentParser::Handle_SetMiterLimit() |
| 1024 { | 930 { |
| 1025 m_pCurStates->m_GraphState.GetModify()->m_MiterLimit = GetNumber(0); | 931 m_pCurStates->m_GraphState.GetModify()->m_MiterLimit = GetNumber(0); |
| 1026 } | 932 } |
| 1027 void CPDF_StreamContentParser::Handle_MarkPlace() | 933 void CPDF_StreamContentParser::Handle_MarkPlace() |
| 1028 { | 934 { |
| 1029 } | 935 } |
| 1030 void CPDF_StreamContentParser::Handle_EndPath() | 936 void CPDF_StreamContentParser::Handle_EndPath() |
| 1031 { | 937 { |
| (...skipping 641 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1673 buf.AppendChar((char)code); | 1579 buf.AppendChar((char)code); |
| 1674 } | 1580 } |
| 1675 bFirst = !bFirst; | 1581 bFirst = !bFirst; |
| 1676 } | 1582 } |
| 1677 } | 1583 } |
| 1678 if (!bFirst) { | 1584 if (!bFirst) { |
| 1679 buf.AppendChar((char)code); | 1585 buf.AppendChar((char)code); |
| 1680 } | 1586 } |
| 1681 return buf.GetByteString(); | 1587 return buf.GetByteString(); |
| 1682 } | 1588 } |
| OLD | NEW |