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

Side by Side Diff: fpdfsdk/fsdk_mgr.cpp

Issue 2278613003: Drop CPDFSDK_PageView::Annot_HasAppearance (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 4 years, 3 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 | « no previous file | fpdfsdk/include/fsdk_mgr.h » ('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 "fpdfsdk/include/fsdk_mgr.h" 7 #include "fpdfsdk/include/fsdk_mgr.h"
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <memory> 10 #include <memory>
(...skipping 622 matching lines...) Expand 10 before | Expand all | Expand 10 after
633 } 633 }
634 634
635 void CPDFSDK_PageView::KillFocusAnnotIfNeeded() { 635 void CPDFSDK_PageView::KillFocusAnnotIfNeeded() {
636 // if there is a focused annot on the page, we should kill the focus first. 636 // if there is a focused annot on the page, we should kill the focus first.
637 if (CPDFSDK_Annot* focusedAnnot = m_pSDKDoc->GetFocusAnnot()) { 637 if (CPDFSDK_Annot* focusedAnnot = m_pSDKDoc->GetFocusAnnot()) {
638 if (pdfium::ContainsValue(m_fxAnnotArray, focusedAnnot)) 638 if (pdfium::ContainsValue(m_fxAnnotArray, focusedAnnot))
639 KillFocusAnnot(); 639 KillFocusAnnot();
640 } 640 }
641 } 641 }
642 642
643 FX_BOOL CPDFSDK_PageView::Annot_HasAppearance(CPDF_Annot* pAnnot) {
644 CPDF_Dictionary* pAnnotDic = pAnnot->GetAnnotDict();
645 if (pAnnotDic)
646 return pAnnotDic->KeyExist("AS");
647 return FALSE;
648 }
649
650 CPDFSDK_Annot* CPDFSDK_PageView::AddAnnot(CPDF_Annot* pPDFAnnot) { 643 CPDFSDK_Annot* CPDFSDK_PageView::AddAnnot(CPDF_Annot* pPDFAnnot) {
651 CPDFDoc_Environment* pEnv = m_pSDKDoc->GetEnv(); 644 CPDFDoc_Environment* pEnv = m_pSDKDoc->GetEnv();
652 ASSERT(pEnv); 645 ASSERT(pEnv);
653 CPDFSDK_AnnotHandlerMgr* pAnnotHandler = pEnv->GetAnnotHandlerMgr(); 646 CPDFSDK_AnnotHandlerMgr* pAnnotHandler = pEnv->GetAnnotHandlerMgr();
654 CPDFSDK_Annot* pSDKAnnot = pAnnotHandler->NewAnnot(pPDFAnnot, this); 647 CPDFSDK_Annot* pSDKAnnot = pAnnotHandler->NewAnnot(pPDFAnnot, this);
655 if (!pSDKAnnot) 648 if (!pSDKAnnot)
656 return nullptr; 649 return nullptr;
657 650
658 m_fxAnnotArray.push_back(pSDKAnnot); 651 m_fxAnnotArray.push_back(pSDKAnnot);
659 pAnnotHandler->Annot_OnCreate(pSDKAnnot); 652 pAnnotHandler->Annot_OnCreate(pSDKAnnot);
(...skipping 397 matching lines...) Expand 10 before | Expand all | Expand 10 after
1057 int CPDFSDK_PageView::GetPageIndexForStaticPDF() const { 1050 int CPDFSDK_PageView::GetPageIndexForStaticPDF() const {
1058 #ifdef PDF_ENABLE_XFA 1051 #ifdef PDF_ENABLE_XFA
1059 CPDF_Page* pPage = m_page->GetPDFPage(); 1052 CPDF_Page* pPage = m_page->GetPDFPage();
1060 #else // PDF_ENABLE_XFA 1053 #else // PDF_ENABLE_XFA
1061 CPDF_Page* pPage = m_page; 1054 CPDF_Page* pPage = m_page;
1062 #endif // PDF_ENABLE_XFA 1055 #endif // PDF_ENABLE_XFA
1063 CPDF_Dictionary* pDict = pPage->m_pFormDict; 1056 CPDF_Dictionary* pDict = pPage->m_pFormDict;
1064 CPDF_Document* pDoc = m_pSDKDoc->GetPDFDocument(); 1057 CPDF_Document* pDoc = m_pSDKDoc->GetPDFDocument();
1065 return (pDoc && pDict) ? pDoc->GetPageIndex(pDict->GetObjNum()) : -1; 1058 return (pDoc && pDict) ? pDoc->GetPageIndex(pDict->GetObjNum()) : -1;
1066 } 1059 }
OLDNEW
« no previous file with comments | « no previous file | fpdfsdk/include/fsdk_mgr.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698