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: fpdfsdk/src/fsdk_mgr.cpp

Issue 1529553003: Merge to XFA: Get rid of most instance of 'foo != NULL' (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: Created 5 years 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 <algorithm> 7 #include <algorithm>
8 8
9 #include "fpdfsdk/include/fsdk_mgr.h" 9 #include "fpdfsdk/include/fsdk_mgr.h"
10 10
(...skipping 585 matching lines...) Expand 10 before | Expand all | Expand 10 after
596 596
597 void CPDFSDK_Document::OnCloseDocument() { 597 void CPDFSDK_Document::OnCloseDocument() {
598 KillFocusAnnot(); 598 KillFocusAnnot();
599 } 599 }
600 600
601 FX_BOOL CPDFSDK_Document::GetPermissions(int nFlag) { 601 FX_BOOL CPDFSDK_Document::GetPermissions(int nFlag) {
602 return GetPDFDocument()->GetUserPermissions() & nFlag; 602 return GetPDFDocument()->GetUserPermissions() & nFlag;
603 } 603 }
604 604
605 IJS_Runtime* CPDFSDK_Document::GetJsRuntime() { 605 IJS_Runtime* CPDFSDK_Document::GetJsRuntime() {
606 ASSERT(m_pEnv != NULL);
607 return m_pEnv->GetJSRuntime(); 606 return m_pEnv->GetJSRuntime();
608 } 607 }
609 608
610 CFX_WideString CPDFSDK_Document::GetPath() { 609 CFX_WideString CPDFSDK_Document::GetPath() {
611 ASSERT(m_pEnv != NULL);
612 return m_pEnv->JS_docGetFilePath(); 610 return m_pEnv->JS_docGetFilePath();
613 } 611 }
614 612
615 CPDFSDK_PageView::CPDFSDK_PageView(CPDFSDK_Document* pSDKDoc, 613 CPDFSDK_PageView::CPDFSDK_PageView(CPDFSDK_Document* pSDKDoc,
616 UnderlyingPageType* page) 614 UnderlyingPageType* page)
617 : m_page(page), 615 : m_page(page),
618 m_pSDKDoc(pSDKDoc), 616 m_pSDKDoc(pSDKDoc),
619 m_CaptureWidget(nullptr), 617 m_CaptureWidget(nullptr),
620 #ifndef PDF_ENABLE_XFA 618 #ifndef PDF_ENABLE_XFA
621 m_bTakeOverPage(FALSE), 619 m_bTakeOverPage(FALSE),
(...skipping 541 matching lines...) Expand 10 before | Expand all | Expand 10 after
1163 CPDFSDK_Annot* pFocusAnnot = m_pSDKDoc->GetFocusAnnot(); 1161 CPDFSDK_Annot* pFocusAnnot = m_pSDKDoc->GetFocusAnnot();
1164 if (!pFocusAnnot) 1162 if (!pFocusAnnot)
1165 return nullptr; 1163 return nullptr;
1166 1164
1167 for (CPDFSDK_Annot* pAnnot : m_fxAnnotArray) { 1165 for (CPDFSDK_Annot* pAnnot : m_fxAnnotArray) {
1168 if (pAnnot == pFocusAnnot) 1166 if (pAnnot == pFocusAnnot)
1169 return pAnnot; 1167 return pAnnot;
1170 } 1168 }
1171 return nullptr; 1169 return nullptr;
1172 } 1170 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698