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

Side by Side Diff: core/src/fpdfapi/fpdf_page/fpdf_page_graph_state.cpp

Issue 1093213002: Remove Release() from CPDF_PageObject (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Move dtor to .cpp file. Created 5 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
« no previous file with comments | « core/src/fpdfapi/fpdf_page/fpdf_page.cpp ('k') | core/src/fpdfdoc/doc_annot.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "../../../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
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
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 }
OLDNEW
« no previous file with comments | « core/src/fpdfapi/fpdf_page/fpdf_page.cpp ('k') | core/src/fpdfdoc/doc_annot.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698