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

Side by Side Diff: fpdfsdk/fpdfformfill.cpp

Issue 1976123003: Remove { delete this; } anti-pattern from IXFA_WidgetIterator (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Restore page Release(). Created 4 years, 7 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/fsdk_annothandler.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 "public/fpdf_formfill.h" 7 #include "public/fpdf_formfill.h"
8 8
9 #include <memory> 9 #include <memory>
10 #include <vector> 10 #include <vector>
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 return -1; 84 return -1;
85 85
86 CXFA_FFDocView* pDocView = pPageView->GetDocView(); 86 CXFA_FFDocView* pDocView = pPageView->GetDocView();
87 if (!pDocView) 87 if (!pDocView)
88 return -1; 88 return -1;
89 89
90 CXFA_FFWidgetHandler* pWidgetHandler = pDocView->GetWidgetHandler(); 90 CXFA_FFWidgetHandler* pWidgetHandler = pDocView->GetWidgetHandler();
91 if (!pWidgetHandler) 91 if (!pWidgetHandler)
92 return -1; 92 return -1;
93 93
94 std::unique_ptr<IXFA_WidgetIterator, ReleaseDeleter<IXFA_WidgetIterator>> 94 std::unique_ptr<IXFA_WidgetIterator> pWidgetIterator(
95 pWidgetIterator(pPageView->CreateWidgetIterator( 95 pPageView->CreateWidgetIterator(
96 XFA_TRAVERSEWAY_Form, 96 XFA_TRAVERSEWAY_Form,
97 XFA_WIDGETFILTER_Viewable | XFA_WIDGETFILTER_AllType)); 97 XFA_WIDGETFILTER_Viewable | XFA_WIDGETFILTER_AllType));
98 if (!pWidgetIterator) 98 if (!pWidgetIterator)
99 return -1; 99 return -1;
100 100
101 CXFA_FFWidget* pXFAAnnot = pWidgetIterator->MoveToNext(); 101 CXFA_FFWidget* pXFAAnnot = pWidgetIterator->MoveToNext();
102 while (pXFAAnnot) { 102 while (pXFAAnnot) {
103 CFX_RectF rcBBox; 103 CFX_RectF rcBBox;
104 pXFAAnnot->GetBBox(rcBBox, 0); 104 pXFAAnnot->GetBBox(rcBBox, 0);
105 CFX_FloatRect rcWidget(rcBBox.left, rcBBox.top, rcBBox.left + rcBBox.width, 105 CFX_FloatRect rcWidget(rcBBox.left, rcBBox.top, rcBBox.left + rcBBox.width,
(...skipping 610 matching lines...) Expand 10 before | Expand all | Expand 10 after
716 pActionHandler->DoAction_Page(action, CPDF_AAction::OpenPage, pSDKDoc); 716 pActionHandler->DoAction_Page(action, CPDF_AAction::OpenPage, pSDKDoc);
717 } 717 }
718 } else { 718 } else {
719 if (aa.ActionExist(CPDF_AAction::ClosePage)) { 719 if (aa.ActionExist(CPDF_AAction::ClosePage)) {
720 CPDF_Action action = aa.GetAction(CPDF_AAction::ClosePage); 720 CPDF_Action action = aa.GetAction(CPDF_AAction::ClosePage);
721 pActionHandler->DoAction_Page(action, CPDF_AAction::ClosePage, pSDKDoc); 721 pActionHandler->DoAction_Page(action, CPDF_AAction::ClosePage, pSDKDoc);
722 } 722 }
723 } 723 }
724 } 724 }
725 } 725 }
OLDNEW
« no previous file with comments | « no previous file | fpdfsdk/fsdk_annothandler.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698