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

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

Issue 1243883003: Fix else-after-returns throughout pdfium. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Rebase, Address comments. Created 5 years, 5 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 "../../../include/fpdfapi/fpdf_page.h" 7 #include "../../../include/fpdfapi/fpdf_page.h"
8 #include "../../../include/fpdfapi/fpdf_module.h" 8 #include "../../../include/fpdfapi/fpdf_module.h"
9 #include "pageint.h" 9 #include "pageint.h"
10 CPDF_PageObject* CPDF_PageObject::Create(int type) 10 CPDF_PageObject* CPDF_PageObject::Create(int type)
(...skipping 736 matching lines...) Expand 10 before | Expand all | Expand 10 after
747 } 747 }
748 m_pParser->Continue(pPause); 748 m_pParser->Continue(pPause);
749 if (m_pParser->GetStatus() == CPDF_ContentParser::Done) { 749 if (m_pParser->GetStatus() == CPDF_ContentParser::Done) {
750 m_ParseState = PDF_CONTENT_PARSED; 750 m_ParseState = PDF_CONTENT_PARSED;
751 delete m_pParser; 751 delete m_pParser;
752 m_pParser = NULL; 752 m_pParser = NULL;
753 } 753 }
754 } 754 }
755 int CPDF_PageObjects::EstimateParseProgress() const 755 int CPDF_PageObjects::EstimateParseProgress() const
756 { 756 {
757 if (m_pParser == NULL) { 757 if (!m_pParser) {
758 return m_ParseState == PDF_CONTENT_PARSED ? 100 : 0; 758 return m_ParseState == PDF_CONTENT_PARSED ? 100 : 0;
759 } 759 }
760 return m_pParser->EstimateProgress(); 760 return m_pParser->EstimateProgress();
761 } 761 }
762 FX_POSITION CPDF_PageObjects::InsertObject(FX_POSITION posInsertAfter, CPDF_Page Object* pNewObject) 762 FX_POSITION CPDF_PageObjects::InsertObject(FX_POSITION posInsertAfter, CPDF_Page Object* pNewObject)
763 { 763 {
764 if (posInsertAfter == NULL) { 764 if (!posInsertAfter) {
765 return m_ObjectList.AddHead(pNewObject); 765 return m_ObjectList.AddHead(pNewObject);
766 } else {
767 return m_ObjectList.InsertAfter(posInsertAfter, pNewObject);
768 } 766 }
767 return m_ObjectList.InsertAfter(posInsertAfter, pNewObject);
769 } 768 }
770 int CPDF_PageObjects::GetObjectIndex(CPDF_PageObject* pObj) const 769 int CPDF_PageObjects::GetObjectIndex(CPDF_PageObject* pObj) const
771 { 770 {
772 int index = 0; 771 int index = 0;
773 FX_POSITION pos = m_ObjectList.GetHeadPosition(); 772 FX_POSITION pos = m_ObjectList.GetHeadPosition();
774 while (pos) { 773 while (pos) {
775 CPDF_PageObject* pThisObj = (CPDF_PageObject*)m_ObjectList.GetNext(pos); 774 CPDF_PageObject* pThisObj = (CPDF_PageObject*)m_ObjectList.GetNext(pos);
776 if (pThisObj == pObj) { 775 if (pThisObj == pObj) {
777 return index; 776 return index;
778 } 777 }
(...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after
1069 matrix = m_PageMatrix; 1068 matrix = m_PageMatrix;
1070 matrix.Concat(display_matrix); 1069 matrix.Concat(display_matrix);
1071 } 1070 }
1072 CPDF_ParseOptions::CPDF_ParseOptions() 1071 CPDF_ParseOptions::CPDF_ParseOptions()
1073 { 1072 {
1074 m_bTextOnly = FALSE; 1073 m_bTextOnly = FALSE;
1075 m_bMarkedContent = TRUE; 1074 m_bMarkedContent = TRUE;
1076 m_bSeparateForm = TRUE; 1075 m_bSeparateForm = TRUE;
1077 m_bDecodeInlineImage = FALSE; 1076 m_bDecodeInlineImage = FALSE;
1078 } 1077 }
OLDNEW
« no previous file with comments | « core/src/fpdfapi/fpdf_font/fpdf_font_cid.cpp ('k') | core/src/fpdfapi/fpdf_page/fpdf_page_colors.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698