| 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 "pageint.h" | 7 #include "pageint.h" |
| 8 | 8 |
| 9 #include "core/include/fpdfapi/fpdf_module.h" | 9 #include "core/include/fpdfapi/fpdf_module.h" |
| 10 #include "core/include/fpdfapi/fpdf_page.h" | 10 #include "core/include/fpdfapi/fpdf_page.h" |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 m_pCurStates->m_ColorState.New(); | 73 m_pCurStates->m_ColorState.New(); |
| 74 } | 74 } |
| 75 for (size_t i = 0; i < FX_ArraySize(m_Type3Data); ++i) { | 75 for (size_t i = 0; i < FX_ArraySize(m_Type3Data); ++i) { |
| 76 m_Type3Data[i] = 0.0; | 76 m_Type3Data[i] = 0.0; |
| 77 } | 77 } |
| 78 } | 78 } |
| 79 | 79 |
| 80 CPDF_StreamContentParser::~CPDF_StreamContentParser() { | 80 CPDF_StreamContentParser::~CPDF_StreamContentParser() { |
| 81 ClearAllParams(); | 81 ClearAllParams(); |
| 82 for (int i = 0; i < m_StateStack.GetSize(); ++i) { | 82 for (int i = 0; i < m_StateStack.GetSize(); ++i) { |
| 83 delete (CPDF_AllStates*)m_StateStack[i]; | 83 delete m_StateStack[i]; |
| 84 } | 84 } |
| 85 FX_Free(m_pPathPoints); | 85 FX_Free(m_pPathPoints); |
| 86 if (m_pLastImageDict) { | 86 if (m_pLastImageDict) { |
| 87 m_pLastImageDict->Release(); | 87 m_pLastImageDict->Release(); |
| 88 } | 88 } |
| 89 if (m_pLastCloneImageDict) { | 89 if (m_pLastCloneImageDict) { |
| 90 m_pLastCloneImageDict->Release(); | 90 m_pLastCloneImageDict->Release(); |
| 91 } | 91 } |
| 92 } | 92 } |
| 93 int CPDF_StreamContentParser::GetNextParamPos() { | 93 int CPDF_StreamContentParser::GetNextParamPos() { |
| (...skipping 718 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 812 } | 812 } |
| 813 m_CurContentMark.GetModify()->DeleteLastMark(); | 813 m_CurContentMark.GetModify()->DeleteLastMark(); |
| 814 } | 814 } |
| 815 void CPDF_StreamContentParser::Handle_EndText() { | 815 void CPDF_StreamContentParser::Handle_EndText() { |
| 816 int count = m_ClipTextList.GetSize(); | 816 int count = m_ClipTextList.GetSize(); |
| 817 if (count == 0) { | 817 if (count == 0) { |
| 818 return; | 818 return; |
| 819 } | 819 } |
| 820 if (m_pCurStates->m_TextState.GetObject()->m_TextMode < 4) { | 820 if (m_pCurStates->m_TextState.GetObject()->m_TextMode < 4) { |
| 821 for (int i = 0; i < count; i++) { | 821 for (int i = 0; i < count; i++) { |
| 822 CPDF_TextObject* pText = (CPDF_TextObject*)m_ClipTextList.GetAt(i); | 822 delete m_ClipTextList.GetAt(i); |
| 823 delete pText; | |
| 824 } | 823 } |
| 825 } else { | 824 } else { |
| 826 m_pCurStates->m_ClipPath.AppendTexts( | 825 m_pCurStates->m_ClipPath.AppendTexts(m_ClipTextList.GetData(), count); |
| 827 (CPDF_TextObject**)m_ClipTextList.GetData(), count); | |
| 828 } | 826 } |
| 829 m_ClipTextList.RemoveAll(); | 827 m_ClipTextList.RemoveAll(); |
| 830 } | 828 } |
| 831 void CPDF_StreamContentParser::Handle_EndSectionUndefined() { | 829 void CPDF_StreamContentParser::Handle_EndSectionUndefined() { |
| 832 if (m_CompatCount) { | 830 if (m_CompatCount) { |
| 833 m_CompatCount--; | 831 m_CompatCount--; |
| 834 } | 832 } |
| 835 } | 833 } |
| 836 void CPDF_StreamContentParser::Handle_FillPath() { | 834 void CPDF_StreamContentParser::Handle_FillPath() { |
| 837 if (m_Options.m_bTextOnly) { | 835 if (m_Options.m_bTextOnly) { |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 943 void CPDF_StreamContentParser::Handle_SaveGraphState() { | 941 void CPDF_StreamContentParser::Handle_SaveGraphState() { |
| 944 CPDF_AllStates* pStates = new CPDF_AllStates; | 942 CPDF_AllStates* pStates = new CPDF_AllStates; |
| 945 pStates->Copy(*m_pCurStates); | 943 pStates->Copy(*m_pCurStates); |
| 946 m_StateStack.Add(pStates); | 944 m_StateStack.Add(pStates); |
| 947 } | 945 } |
| 948 void CPDF_StreamContentParser::Handle_RestoreGraphState() { | 946 void CPDF_StreamContentParser::Handle_RestoreGraphState() { |
| 949 int size = m_StateStack.GetSize(); | 947 int size = m_StateStack.GetSize(); |
| 950 if (size == 0) { | 948 if (size == 0) { |
| 951 return; | 949 return; |
| 952 } | 950 } |
| 953 CPDF_AllStates* pStates = (CPDF_AllStates*)m_StateStack.GetAt(size - 1); | 951 CPDF_AllStates* pStates = m_StateStack.GetAt(size - 1); |
| 954 m_pCurStates->Copy(*pStates); | 952 m_pCurStates->Copy(*pStates); |
| 955 delete pStates; | 953 delete pStates; |
| 956 m_StateStack.RemoveAt(size - 1); | 954 m_StateStack.RemoveAt(size - 1); |
| 957 } | 955 } |
| 958 void CPDF_StreamContentParser::Handle_Rectangle() { | 956 void CPDF_StreamContentParser::Handle_Rectangle() { |
| 959 if (m_Options.m_bTextOnly) { | 957 if (m_Options.m_bTextOnly) { |
| 960 return; | 958 return; |
| 961 } | 959 } |
| 962 FX_FLOAT x = GetNumber(3), y = GetNumber(2); | 960 FX_FLOAT x = GetNumber(3), y = GetNumber(2); |
| 963 FX_FLOAT w = GetNumber(1), h = GetNumber(0); | 961 FX_FLOAT w = GetNumber(1), h = GetNumber(0); |
| (...skipping 562 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1526 m_pObjectList->m_ObjectList.AddTail(pPathObj); | 1524 m_pObjectList->m_ObjectList.AddTail(pPathObj); |
| 1527 } | 1525 } |
| 1528 if (PathClipType) { | 1526 if (PathClipType) { |
| 1529 if (!matrix.IsIdentity()) { | 1527 if (!matrix.IsIdentity()) { |
| 1530 Path.Transform(&matrix); | 1528 Path.Transform(&matrix); |
| 1531 matrix.SetIdentity(); | 1529 matrix.SetIdentity(); |
| 1532 } | 1530 } |
| 1533 m_pCurStates->m_ClipPath.AppendPath(Path, PathClipType, TRUE); | 1531 m_pCurStates->m_ClipPath.AppendPath(Path, PathClipType, TRUE); |
| 1534 } | 1532 } |
| 1535 } | 1533 } |
| OLD | NEW |