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

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

Issue 1414963005: Remove default argument from CPDF_Dictionary::SetAt(). (Closed) Base URL: https://pdfium.googlesource.com/pdfium@master
Patch Set: address comments Created 5 years, 1 month 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 827 matching lines...) Expand 10 before | Expand all | Expand 10 after
838 pTrailer->GetElement(FX_BSTRC("Root")); 838 pTrailer->GetElement(FX_BSTRC("Root"));
839 CPDF_Reference* pRef = ToReference(pRoot); 839 CPDF_Reference* pRef = ToReference(pRoot);
840 if (!pRoot || 840 if (!pRoot ||
841 (pRef && 841 (pRef &&
842 (FX_DWORD)m_CrossRef.GetSize() > 842 (FX_DWORD)m_CrossRef.GetSize() >
843 pRef->GetRefObjNum() && 843 pRef->GetRefObjNum() &&
844 m_CrossRef.GetAt(pRef->GetRefObjNum()) != 0)) { 844 m_CrossRef.GetAt(pRef->GetRefObjNum()) != 0)) {
845 FX_POSITION pos = pTrailer->GetStartPos(); 845 FX_POSITION pos = pTrailer->GetStartPos();
846 while (pos) { 846 while (pos) {
847 CFX_ByteString key; 847 CFX_ByteString key;
848 CPDF_Object* pObj = 848 CPDF_Object* pElement =
Lei Zhang 2015/10/26 21:58:22 This is a shadow variable. This function is a bit
849 pTrailer->GetNextElement(pos, key); 849 pTrailer->GetNextElement(pos, key);
850 m_pTrailer->SetAt(key, pObj->Clone(), m_pDocument); 850 FX_DWORD dwObjNum = pElement->GetObjNum();
851 if (dwObjNum) {
852 m_pTrailer->SetAtReference(key, m_pDocument,
853 dwObjNum);
854 } else {
855 m_pTrailer->SetAt(key, pElement->Clone());
856 }
851 } 857 }
852 pObj->Release(); 858 pObj->Release();
853 } else { 859 } else {
854 pObj->Release(); 860 pObj->Release();
855 } 861 }
856 } else { 862 } else {
857 if (pObj->IsStream()) { 863 if (pObj->IsStream()) {
858 m_pTrailer = ToDictionary(pTrailer->Clone()); 864 m_pTrailer = ToDictionary(pTrailer->Clone());
859 pObj->Release(); 865 pObj->Release();
860 } else { 866 } else {
(...skipping 3712 matching lines...) Expand 10 before | Expand all | Expand 10 after
4573 return FALSE; 4579 return FALSE;
4574 } 4580 }
4575 CPDF_PageNode::~CPDF_PageNode() { 4581 CPDF_PageNode::~CPDF_PageNode() {
4576 int32_t iSize = m_childNode.GetSize(); 4582 int32_t iSize = m_childNode.GetSize();
4577 for (int32_t i = 0; i < iSize; ++i) { 4583 for (int32_t i = 0; i < iSize; ++i) {
4578 CPDF_PageNode* pNode = (CPDF_PageNode*)m_childNode[i]; 4584 CPDF_PageNode* pNode = (CPDF_PageNode*)m_childNode[i];
4579 delete pNode; 4585 delete pNode;
4580 } 4586 }
4581 m_childNode.RemoveAll(); 4587 m_childNode.RemoveAll();
4582 } 4588 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698