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

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

Issue 1417033004: Merge to XFA: Add type cast definitions for CPDF_Name. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
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 3795 matching lines...) Expand 10 before | Expand all | Expand 10 after
3806 if (!bNumber) { 3806 if (!bNumber) {
3807 return -1; 3807 return -1;
3808 } 3808 }
3809 FX_DWORD objNum = FXSYS_atoi(objnum); 3809 FX_DWORD objNum = FXSYS_atoi(objnum);
3810 CPDF_Object* pObj = m_parser.ParseIndirectObjectAt(NULL, 0, objNum, NULL); 3810 CPDF_Object* pObj = m_parser.ParseIndirectObjectAt(NULL, 0, objNum, NULL);
3811 if (!pObj) { 3811 if (!pObj) {
3812 m_Pos += m_parser.m_Syntax.SavePos(); 3812 m_Pos += m_parser.m_Syntax.SavePos();
3813 return 0; 3813 return 0;
3814 } 3814 }
3815 CPDF_Dictionary* pDict = pObj->GetDict(); 3815 CPDF_Dictionary* pDict = pObj->GetDict();
3816 CPDF_Object* pName = pDict ? pDict->GetElement(FX_BSTRC("Type")) : NULL; 3816 CPDF_Name* pName =
3817 if (pName && pName->GetType() == PDFOBJ_NAME) { 3817 ToName(pDict ? pDict->GetElement(FX_BSTRC("Type")) : nullptr);
3818 if (pName) {
3818 if (pName->GetString() == FX_BSTRC("XRef")) { 3819 if (pName->GetString() == FX_BSTRC("XRef")) {
3819 m_Pos += m_parser.m_Syntax.SavePos(); 3820 m_Pos += m_parser.m_Syntax.SavePos();
3820 xref_offset = pObj->GetDict()->GetInteger(FX_BSTRC("Prev")); 3821 xref_offset = pObj->GetDict()->GetInteger(FX_BSTRC("Prev"));
3821 pObj->Release(); 3822 pObj->Release();
3822 return 1; 3823 return 1;
3823 } 3824 }
3824 } 3825 }
3825 pObj->Release(); 3826 pObj->Release();
3826 return -1; 3827 return -1;
3827 } 3828 }
(...skipping 793 matching lines...) Expand 10 before | Expand all | Expand 10 after
4621 return FALSE; 4622 return FALSE;
4622 } 4623 }
4623 CPDF_PageNode::~CPDF_PageNode() { 4624 CPDF_PageNode::~CPDF_PageNode() {
4624 int32_t iSize = m_childNode.GetSize(); 4625 int32_t iSize = m_childNode.GetSize();
4625 for (int32_t i = 0; i < iSize; ++i) { 4626 for (int32_t i = 0; i < iSize; ++i) {
4626 CPDF_PageNode* pNode = (CPDF_PageNode*)m_childNode[i]; 4627 CPDF_PageNode* pNode = (CPDF_PageNode*)m_childNode[i];
4627 delete pNode; 4628 delete pNode;
4628 } 4629 }
4629 m_childNode.RemoveAll(); 4630 m_childNode.RemoveAll();
4630 } 4631 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698