diff options
author | tsepez <tsepez@chromium.org> | 2016-05-18 12:10:49 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-05-18 12:10:49 -0700 |
commit | e7b2853a4143137803609fe96330d7924c1731ed (patch) | |
tree | abc54132c4a402b11e6e3741fe620002b1a7ae9c /fpdfsdk/fpdfsave.cpp | |
parent | 501e8cdc9143d4b1bebd22e7bfdcae4368e459ee (diff) | |
download | pdfium-e7b2853a4143137803609fe96330d7924c1731ed.tar.xz |
Remove Release() from CXFA_WidgetAccIterator
Review-Url: https://codereview.chromium.org/1990793004
Diffstat (limited to 'fpdfsdk/fpdfsave.cpp')
-rw-r--r-- | fpdfsdk/fpdfsave.cpp | 20 |
1 files changed, 6 insertions, 14 deletions
diff --git a/fpdfsdk/fpdfsave.cpp b/fpdfsdk/fpdfsave.cpp index d48bfbb3b1..84de668dde 100644 --- a/fpdfsdk/fpdfsave.cpp +++ b/fpdfsdk/fpdfsave.cpp @@ -232,17 +232,13 @@ bool SendPostSaveToXFADoc(CPDFXFA_Document* pDocument) { return false; CXFA_FFWidgetHandler* pWidgetHander = pXFADocView->GetWidgetHandler(); - CXFA_WidgetAcc* pWidgetAcc = NULL; - CXFA_WidgetAccIterator* pWidgetAccIterator = - pXFADocView->CreateWidgetAccIterator(); - pWidgetAcc = pWidgetAccIterator->MoveToNext(); - while (pWidgetAcc) { + std::unique_ptr<CXFA_WidgetAccIterator> pWidgetAccIterator( + pXFADocView->CreateWidgetAccIterator()); + while (CXFA_WidgetAcc* pWidgetAcc = pWidgetAccIterator->MoveToNext()) { CXFA_EventParam preParam; preParam.m_eType = XFA_EVENT_PostSave; pWidgetHander->ProcessEvent(pWidgetAcc, &preParam); - pWidgetAcc = pWidgetAccIterator->MoveToNext(); } - pWidgetAccIterator->Release(); pXFADocView->UpdateDocView(); pDocument->_ClearChangeMark(); return true; @@ -259,17 +255,13 @@ bool SendPreSaveToXFADoc(CPDFXFA_Document* pDocument, return true; CXFA_FFWidgetHandler* pWidgetHander = pXFADocView->GetWidgetHandler(); - CXFA_WidgetAcc* pWidgetAcc = NULL; - CXFA_WidgetAccIterator* pWidgetAccIterator = - pXFADocView->CreateWidgetAccIterator(); - pWidgetAcc = pWidgetAccIterator->MoveToNext(); - while (pWidgetAcc) { + std::unique_ptr<CXFA_WidgetAccIterator> pWidgetAccIterator( + pXFADocView->CreateWidgetAccIterator()); + while (CXFA_WidgetAcc* pWidgetAcc = pWidgetAccIterator->MoveToNext()) { CXFA_EventParam preParam; preParam.m_eType = XFA_EVENT_PreSave; pWidgetHander->ProcessEvent(pWidgetAcc, &preParam); - pWidgetAcc = pWidgetAccIterator->MoveToNext(); } - pWidgetAccIterator->Release(); pXFADocView->UpdateDocView(); return SaveXFADocumentData(pDocument, fileList); } |