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

Side by Side Diff: core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp

Issue 1417823005: Add type cast definitions for CPDF_Name. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 5 years, 2 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 <set> 7 #include <set>
8 #include <utility> 8 #include <utility>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 3789 matching lines...) Expand 10 before | Expand all | Expand 10 after
3800 if (!bNumber) { 3800 if (!bNumber) {
3801 return -1; 3801 return -1;
3802 } 3802 }
3803 FX_DWORD objNum = FXSYS_atoi(objnum); 3803 FX_DWORD objNum = FXSYS_atoi(objnum);
3804 CPDF_Object* pObj = m_parser.ParseIndirectObjectAt(NULL, 0, objNum, NULL); 3804 CPDF_Object* pObj = m_parser.ParseIndirectObjectAt(NULL, 0, objNum, NULL);
3805 if (!pObj) { 3805 if (!pObj) {
3806 m_Pos += m_parser.m_Syntax.SavePos(); 3806 m_Pos += m_parser.m_Syntax.SavePos();
3807 return 0; 3807 return 0;
3808 } 3808 }
3809 CPDF_Dictionary* pDict = pObj->GetDict(); 3809 CPDF_Dictionary* pDict = pObj->GetDict();
3810 CPDF_Object* pName = pDict ? pDict->GetElement(FX_BSTRC("Type")) : NULL; 3810 CPDF_Name* pName =
3811 if (pName && pName->GetType() == PDFOBJ_NAME) { 3811 ToName(pDict ? pDict->GetElement(FX_BSTRC("Type")) : nullptr);
3812 if (pName) {
3812 if (pName->GetString() == FX_BSTRC("XRef")) { 3813 if (pName->GetString() == FX_BSTRC("XRef")) {
3813 m_Pos += m_parser.m_Syntax.SavePos(); 3814 m_Pos += m_parser.m_Syntax.SavePos();
3814 xref_offset = pObj->GetDict()->GetInteger(FX_BSTRC("Prev")); 3815 xref_offset = pObj->GetDict()->GetInteger(FX_BSTRC("Prev"));
3815 pObj->Release(); 3816 pObj->Release();
3816 return 1; 3817 return 1;
3817 } 3818 }
3818 } 3819 }
3819 pObj->Release(); 3820 pObj->Release();
3820 return -1; 3821 return -1;
3821 } 3822 }
(...skipping 793 matching lines...) Expand 10 before | Expand all | Expand 10 after
4615 return FALSE; 4616 return FALSE;
4616 } 4617 }
4617 CPDF_PageNode::~CPDF_PageNode() { 4618 CPDF_PageNode::~CPDF_PageNode() {
4618 int32_t iSize = m_childNode.GetSize(); 4619 int32_t iSize = m_childNode.GetSize();
4619 for (int32_t i = 0; i < iSize; ++i) { 4620 for (int32_t i = 0; i < iSize; ++i) {
4620 CPDF_PageNode* pNode = (CPDF_PageNode*)m_childNode[i]; 4621 CPDF_PageNode* pNode = (CPDF_PageNode*)m_childNode[i];
4621 delete pNode; 4622 delete pNode;
4622 } 4623 }
4623 m_childNode.RemoveAll(); 4624 m_childNode.RemoveAll();
4624 } 4625 }
OLDNEW
« no previous file with comments | « core/src/fpdfapi/fpdf_parser/fpdf_parser_objects.cpp ('k') | core/src/fpdfapi/fpdf_parser/fpdf_parser_utility.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698