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

Side by Side Diff: core/fpdfapi/fpdf_page/fpdf_page_doc.cpp

Issue 2226113002: Add CPDF_Array::IsEmpty(). (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Add CPDF_Array::IsEmpty(). Created 4 years, 4 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 "core/fpdfapi/fpdf_page/pageint.h" 7 #include "core/fpdfapi/fpdf_page/pageint.h"
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <set> 10 #include <set>
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after
268 break; 268 break;
269 } 269 }
270 if (!pDefaultCS) 270 if (!pDefaultCS)
271 return pCS; 271 return pCS;
272 272
273 pdfium::ScopedSetInsertion<CPDF_Object*> insertion(pVisited, pCSObj); 273 pdfium::ScopedSetInsertion<CPDF_Object*> insertion(pVisited, pCSObj);
274 return GetColorSpaceImpl(pDefaultCS, nullptr, pVisited); 274 return GetColorSpaceImpl(pDefaultCS, nullptr, pVisited);
275 } 275 }
276 276
277 CPDF_Array* pArray = pCSObj->AsArray(); 277 CPDF_Array* pArray = pCSObj->AsArray();
278 if (!pArray || pArray->GetCount() == 0) 278 if (!pArray || pArray->IsEmpty())
279 return nullptr; 279 return nullptr;
280 280
281 if (pArray->GetCount() == 1) { 281 if (pArray->GetCount() == 1) {
282 pdfium::ScopedSetInsertion<CPDF_Object*> insertion(pVisited, pCSObj); 282 pdfium::ScopedSetInsertion<CPDF_Object*> insertion(pVisited, pCSObj);
283 return GetColorSpaceImpl(pArray->GetDirectObjectAt(0), pResources, 283 return GetColorSpaceImpl(pArray->GetDirectObjectAt(0), pResources,
284 pVisited); 284 pVisited);
285 } 285 }
286 286
287 CPDF_CountedColorSpace* csData = nullptr; 287 CPDF_CountedColorSpace* csData = nullptr;
288 auto it = m_ColorSpaceMap.find(pCSObj); 288 auto it = m_ColorSpaceMap.find(pCSObj);
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after
538 } 538 }
539 539
540 CPDF_CountedPattern* CPDF_DocPageData::FindPatternPtr( 540 CPDF_CountedPattern* CPDF_DocPageData::FindPatternPtr(
541 CPDF_Object* pPatternObj) const { 541 CPDF_Object* pPatternObj) const {
542 if (!pPatternObj) 542 if (!pPatternObj)
543 return nullptr; 543 return nullptr;
544 544
545 auto it = m_PatternMap.find(pPatternObj); 545 auto it = m_PatternMap.find(pPatternObj);
546 return it != m_PatternMap.end() ? it->second : nullptr; 546 return it != m_PatternMap.end() ? it->second : nullptr;
547 } 547 }
OLDNEW
« no previous file with comments | « core/fpdfapi/fpdf_page/cpdf_colorspace.cpp ('k') | core/fpdfapi/fpdf_parser/include/cpdf_array.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698