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 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
185 pData->m_pPathList[pData->m_PathCount - 1].SetNull(); | 185 pData->m_pPathList[pData->m_PathCount - 1].SetNull(); |
186 FXSYS_memmove32(pData->m_pTypeList + index, pData->m_pTypeList + index + 1,
pData->m_PathCount - index - 1); | 186 FXSYS_memmove32(pData->m_pTypeList + index, pData->m_pTypeList + index + 1,
pData->m_PathCount - index - 1); |
187 pData->m_PathCount --; | 187 pData->m_PathCount --; |
188 } | 188 } |
189 #define FPDF_CLIPPATH_MAX_TEXTS 1024 | 189 #define FPDF_CLIPPATH_MAX_TEXTS 1024 |
190 void CPDF_ClipPath::AppendTexts(CPDF_TextObject** pTexts, int count) | 190 void CPDF_ClipPath::AppendTexts(CPDF_TextObject** pTexts, int count) |
191 { | 191 { |
192 CPDF_ClipPathData* pData = GetModify(); | 192 CPDF_ClipPathData* pData = GetModify(); |
193 if (pData->m_TextCount + count > FPDF_CLIPPATH_MAX_TEXTS) { | 193 if (pData->m_TextCount + count > FPDF_CLIPPATH_MAX_TEXTS) { |
194 for (int i = 0; i < count; i ++) { | 194 for (int i = 0; i < count; i ++) { |
195 if (pTexts[i]) | 195 delete pTexts[i]; |
196 pTexts[i]->Release(); | |
197 } | 196 } |
198 return; | 197 return; |
199 } | 198 } |
200 CPDF_TextObject** pNewList = FX_Alloc(CPDF_TextObject*, pData->m_TextCount +
count + 1); | 199 CPDF_TextObject** pNewList = FX_Alloc(CPDF_TextObject*, pData->m_TextCount +
count + 1); |
201 if (pData->m_pTextList) { | 200 if (pData->m_pTextList) { |
202 FXSYS_memcpy32(pNewList, pData->m_pTextList, pData->m_TextCount * sizeof
(CPDF_TextObject*)); | 201 FXSYS_memcpy32(pNewList, pData->m_pTextList, pData->m_TextCount * sizeof
(CPDF_TextObject*)); |
203 FX_Free(pData->m_pTextList); | 202 FX_Free(pData->m_pTextList); |
204 } | 203 } |
205 pData->m_pTextList = pNewList; | 204 pData->m_pTextList = pNewList; |
206 for (int i = 0; i < count; i ++) { | 205 for (int i = 0; i < count; i ++) { |
(...skipping 500 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
707 pDict = NULL; | 706 pDict = NULL; |
708 if (item.GetParamType() == CPDF_ContentMarkItem::PropertiesDict || | 707 if (item.GetParamType() == CPDF_ContentMarkItem::PropertiesDict || |
709 item.GetParamType() == CPDF_ContentMarkItem::DirectDict) { | 708 item.GetParamType() == CPDF_ContentMarkItem::DirectDict) { |
710 pDict = (CPDF_Dictionary*)item.GetParam(); | 709 pDict = (CPDF_Dictionary*)item.GetParam(); |
711 } | 710 } |
712 return TRUE; | 711 return TRUE; |
713 } | 712 } |
714 } | 713 } |
715 return FALSE; | 714 return FALSE; |
716 } | 715 } |
OLD | NEW |