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

Side by Side Diff: fpdfsdk/src/fsdk_mgr.cpp

Issue 1652533002: Add tests for CBA_AnnotIterator. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: static_cast. Created 4 years, 10 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
« no previous file with comments | « fpdfsdk/src/fsdk_baseform_embeddertest.cpp ('k') | pdfium.gyp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #include <memory> 8 #include <memory>
9 9
10 #include "fpdfsdk/include/fsdk_mgr.h" 10 #include "fpdfsdk/include/fsdk_mgr.h"
(...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after
371 m_pActionHandler.reset(new CPDFSDK_ActionHandler()); 371 m_pActionHandler.reset(new CPDFSDK_ActionHandler());
372 return m_pActionHandler.get(); 372 return m_pActionHandler.get();
373 } 373 }
374 374
375 CFFL_IFormFiller* CPDFDoc_Environment::GetIFormFiller() { 375 CFFL_IFormFiller* CPDFDoc_Environment::GetIFormFiller() {
376 if (!m_pIFormFiller) 376 if (!m_pIFormFiller)
377 m_pIFormFiller.reset(new CFFL_IFormFiller(this)); 377 m_pIFormFiller.reset(new CFFL_IFormFiller(this));
378 return m_pIFormFiller.get(); 378 return m_pIFormFiller.get();
379 } 379 }
380 380
381 // static
382 CPDFSDK_Document* CPDFSDK_Document::FromFPDFFormHandle(
383 FPDF_FORMHANDLE hHandle) {
384 CPDFDoc_Environment* pEnv = static_cast<CPDFDoc_Environment*>(hHandle);
385 return pEnv ? pEnv->GetSDKDocument() : nullptr;
386 }
387
381 CPDFSDK_Document::CPDFSDK_Document(UnderlyingDocumentType* pDoc, 388 CPDFSDK_Document::CPDFSDK_Document(UnderlyingDocumentType* pDoc,
382 CPDFDoc_Environment* pEnv) 389 CPDFDoc_Environment* pEnv)
383 : m_pDoc(pDoc), 390 : m_pDoc(pDoc),
384 m_pFocusAnnot(nullptr), 391 m_pFocusAnnot(nullptr),
385 m_pEnv(pEnv), 392 m_pEnv(pEnv),
386 m_bChangeMask(FALSE), 393 m_bChangeMask(FALSE),
387 m_bBeingDestroyed(FALSE) {} 394 m_bBeingDestroyed(FALSE) {}
388 395
389 CPDFSDK_Document::~CPDFSDK_Document() { 396 CPDFSDK_Document::~CPDFSDK_Document() {
390 m_bBeingDestroyed = TRUE; 397 m_bBeingDestroyed = TRUE;
(...skipping 526 matching lines...) Expand 10 before | Expand all | Expand 10 after
917 CPDFSDK_Annot* pFocusAnnot = m_pSDKDoc->GetFocusAnnot(); 924 CPDFSDK_Annot* pFocusAnnot = m_pSDKDoc->GetFocusAnnot();
918 if (!pFocusAnnot) 925 if (!pFocusAnnot)
919 return nullptr; 926 return nullptr;
920 927
921 for (CPDFSDK_Annot* pAnnot : m_fxAnnotArray) { 928 for (CPDFSDK_Annot* pAnnot : m_fxAnnotArray) {
922 if (pAnnot == pFocusAnnot) 929 if (pAnnot == pFocusAnnot)
923 return pAnnot; 930 return pAnnot;
924 } 931 }
925 return nullptr; 932 return nullptr;
926 } 933 }
OLDNEW
« no previous file with comments | « fpdfsdk/src/fsdk_baseform_embeddertest.cpp ('k') | pdfium.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698