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

Side by Side Diff: fpdfsdk/javascript/Document.cpp

Issue 2384323005: Cleanup some CPDFSDK_PageView annotation code. (Closed)
Patch Set: Review feedback 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.cpp ('k') | fpdfsdk/javascript/app.cpp » ('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/javascript/Document.h" 7 #include "fpdfsdk/javascript/Document.h"
8 8
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
(...skipping 513 matching lines...) Expand 10 before | Expand all | Expand 10 after
524 524
525 std::vector<CFX_FloatRect> aRefresh(1, rcAnnot); 525 std::vector<CFX_FloatRect> aRefresh(1, rcAnnot);
526 UnderlyingPageType* pPage = pWidget->GetUnderlyingPage(); 526 UnderlyingPageType* pPage = pWidget->GetUnderlyingPage();
527 ASSERT(pPage); 527 ASSERT(pPage);
528 528
529 // If there is currently no pageview associated with the page being used 529 // If there is currently no pageview associated with the page being used
530 // do not create one. We may be in the process of tearing down the document 530 // do not create one. We may be in the process of tearing down the document
531 // and creating a new pageview at this point will cause bad things. 531 // and creating a new pageview at this point will cause bad things.
532 CPDFSDK_PageView* pPageView = m_pDocument->GetPageView(pPage, false); 532 CPDFSDK_PageView* pPageView = m_pDocument->GetPageView(pPage, false);
533 if (pPageView) { 533 if (pPageView) {
534 #if PDF_ENABLE_XFA
534 pPageView->DeleteAnnot(pWidget); 535 pPageView->DeleteAnnot(pWidget);
536 #endif // PDF_ENABLE_XFA
535 pPageView->UpdateRects(aRefresh); 537 pPageView->UpdateRects(aRefresh);
536 } 538 }
537 } 539 }
538 m_pDocument->SetChangeMark(); 540 m_pDocument->SetChangeMark();
539 541
540 return TRUE; 542 return TRUE;
541 } 543 }
542 544
543 // reset filed values within a document. 545 // reset filed values within a document.
544 // comment: 546 // comment:
(...skipping 1174 matching lines...) Expand 10 before | Expand all | Expand 10 after
1719 } 1721 }
1720 } 1722 }
1721 1723
1722 for (const auto& pData : DelayDataForFieldAndControlIndex) 1724 for (const auto& pData : DelayDataForFieldAndControlIndex)
1723 Field::DoDelay(m_pDocument.Get(), pData.get()); 1725 Field::DoDelay(m_pDocument.Get(), pData.get());
1724 } 1726 }
1725 1727
1726 CJS_Document* Document::GetCJSDoc() const { 1728 CJS_Document* Document::GetCJSDoc() const {
1727 return static_cast<CJS_Document*>(m_pJSObject); 1729 return static_cast<CJS_Document*>(m_pJSObject);
1728 } 1730 }
OLDNEW
« no previous file with comments | « fpdfsdk/cpdfsdk_pageview.cpp ('k') | fpdfsdk/javascript/app.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698