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

Side by Side Diff: fpdfsdk/cpdfsdk_pageview.cpp

Issue 2391663002: Remove unused CPDFSDK_PageView::ClearFXAnnots (Closed)
Patch Set: Created 4 years, 2 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/cpdfsdk_pageview.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 PDFium Authors. All rights reserved. 1 // Copyright 2016 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/cpdfsdk_pageview.h" 7 #include "fpdfsdk/cpdfsdk_pageview.h"
8 8
9 #include <memory> 9 #include <memory>
10 #include <vector> 10 #include <vector>
(...skipping 493 matching lines...) Expand 10 before | Expand all | Expand 10 after
504 CPDFSDK_Annot* pAnnot = pAnnotHandlerMgr->NewAnnot(pPDFAnnot, this); 504 CPDFSDK_Annot* pAnnot = pAnnotHandlerMgr->NewAnnot(pPDFAnnot, this);
505 if (!pAnnot) 505 if (!pAnnot)
506 continue; 506 continue;
507 m_fxAnnotArray.push_back(pAnnot); 507 m_fxAnnotArray.push_back(pAnnot);
508 pAnnotHandlerMgr->Annot_OnLoad(pAnnot); 508 pAnnotHandlerMgr->Annot_OnLoad(pAnnot);
509 } 509 }
510 510
511 SetLock(FALSE); 511 SetLock(FALSE);
512 } 512 }
513 513
514 void CPDFSDK_PageView::ClearFXAnnots() {
515 SetLock(TRUE);
516 if (m_pSDKDoc && GetFocusAnnot()) {
517 CPDFSDK_Annot::ObservedPtr pNull;
518 m_pSDKDoc->SetFocusAnnot(&pNull);
519 }
520 m_pCaptureWidget.Reset();
521 for (CPDFSDK_Annot* pAnnot : m_fxAnnotArray)
522 m_pSDKDoc->GetEnv()->GetAnnotHandlerMgr()->ReleaseAnnot(pAnnot);
523 m_fxAnnotArray.clear();
524 m_pAnnotList.reset();
525 SetLock(FALSE);
526 }
527
528 void CPDFSDK_PageView::UpdateRects(const std::vector<CFX_FloatRect>& rects) { 514 void CPDFSDK_PageView::UpdateRects(const std::vector<CFX_FloatRect>& rects) {
529 CPDFSDK_Environment* pEnv = m_pSDKDoc->GetEnv(); 515 CPDFSDK_Environment* pEnv = m_pSDKDoc->GetEnv();
530 for (const auto& rc : rects) 516 for (const auto& rc : rects)
531 pEnv->Invalidate(m_page, rc.left, rc.top, rc.right, rc.bottom); 517 pEnv->Invalidate(m_page, rc.left, rc.top, rc.right, rc.bottom);
532 } 518 }
533 519
534 void CPDFSDK_PageView::UpdateView(CPDFSDK_Annot* pAnnot) { 520 void CPDFSDK_PageView::UpdateView(CPDFSDK_Annot* pAnnot) {
535 CFX_FloatRect rcWindow = pAnnot->GetRect(); 521 CFX_FloatRect rcWindow = pAnnot->GetRect();
536 CPDFSDK_Environment* pEnv = m_pSDKDoc->GetEnv(); 522 CPDFSDK_Environment* pEnv = m_pSDKDoc->GetEnv();
537 pEnv->Invalidate(m_page, rcWindow.left, rcWindow.top, rcWindow.right, 523 pEnv->Invalidate(m_page, rcWindow.left, rcWindow.top, rcWindow.right,
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
582 return pAnnot; 568 return pAnnot;
583 } 569 }
584 return nullptr; 570 return nullptr;
585 } 571 }
586 572
587 int CPDFSDK_PageView::GetPageIndexForStaticPDF() const { 573 int CPDFSDK_PageView::GetPageIndexForStaticPDF() const {
588 CPDF_Dictionary* pDict = GetPDFPage()->m_pFormDict; 574 CPDF_Dictionary* pDict = GetPDFPage()->m_pFormDict;
589 CPDF_Document* pDoc = m_pSDKDoc->GetPDFDocument(); 575 CPDF_Document* pDoc = m_pSDKDoc->GetPDFDocument();
590 return (pDoc && pDict) ? pDoc->GetPageIndex(pDict->GetObjNum()) : -1; 576 return (pDoc && pDict) ? pDoc->GetPageIndex(pDict->GetObjNum()) : -1;
591 } 577 }
OLDNEW
« no previous file with comments | « fpdfsdk/cpdfsdk_pageview.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698