summaryrefslogtreecommitdiff
path: root/fpdfsdk/fpdfsave.cpp
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2018-01-23 15:22:54 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-01-23 15:22:54 +0000
commit08915150a3fb64aa1ebf9bdf20d1158a20b4266f (patch)
tree4aaf0b9751cad22a499f3073900103995b62c0c5 /fpdfsdk/fpdfsave.cpp
parent22a1bb99afe62a032ab1fbac9f594c5c182ca880 (diff)
downloadpdfium-08915150a3fb64aa1ebf9bdf20d1158a20b4266f.tar.xz
Convert CXFA_WidgetAccIterator to CXFA_ReadyNodeIterator
This CL converts the WidgetAcc iterator to return nodes in which the OnReady event has been fired. Change-Id: I5ec6809c1610ac3467019d8492121901d3845a37 Reviewed-on: https://pdfium-review.googlesource.com/23490 Reviewed-by: Ryan Harrison <rharrison@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'fpdfsdk/fpdfsave.cpp')
-rw-r--r--fpdfsdk/fpdfsave.cpp16
1 files changed, 7 insertions, 9 deletions
diff --git a/fpdfsdk/fpdfsave.cpp b/fpdfsdk/fpdfsave.cpp
index b4d4a4107a..b95850f7b6 100644
--- a/fpdfsdk/fpdfsave.cpp
+++ b/fpdfsdk/fpdfsave.cpp
@@ -31,8 +31,8 @@
#include "xfa/fxfa/cxfa_ffapp.h"
#include "xfa/fxfa/cxfa_ffdocview.h"
#include "xfa/fxfa/cxfa_ffwidgethandler.h"
+#include "xfa/fxfa/cxfa_readynodeiterator.h"
#include "xfa/fxfa/cxfa_widgetacc.h"
-#include "xfa/fxfa/cxfa_widgetacciterator.h"
#include "xfa/fxfa/parser/cxfa_object.h"
#endif
@@ -205,12 +205,11 @@ bool SendPostSaveToXFADoc(CPDFXFA_Context* pContext) {
return false;
CXFA_FFWidgetHandler* pWidgetHandler = pXFADocView->GetWidgetHandler();
- std::unique_ptr<CXFA_WidgetAccIterator> pWidgetAccIterator =
- pXFADocView->CreateWidgetAccIterator();
- while (CXFA_WidgetAcc* pWidgetAcc = pWidgetAccIterator->MoveToNext()) {
+ auto it = pXFADocView->CreateReadyNodeIterator();
+ while (CXFA_Node* pNode = it->MoveToNext()) {
CXFA_EventParam preParam;
preParam.m_eType = XFA_EVENT_PostSave;
- pWidgetHandler->ProcessEvent(pWidgetAcc->GetNode(), &preParam);
+ pWidgetHandler->ProcessEvent(pNode, &preParam);
}
pXFADocView->UpdateDocView();
pContext->ClearChangeMark();
@@ -227,12 +226,11 @@ bool SendPreSaveToXFADoc(CPDFXFA_Context* pContext,
return true;
CXFA_FFWidgetHandler* pWidgetHandler = pXFADocView->GetWidgetHandler();
- std::unique_ptr<CXFA_WidgetAccIterator> pWidgetAccIterator =
- pXFADocView->CreateWidgetAccIterator();
- while (CXFA_WidgetAcc* pWidgetAcc = pWidgetAccIterator->MoveToNext()) {
+ auto it = pXFADocView->CreateReadyNodeIterator();
+ while (CXFA_Node* pNode = it->MoveToNext()) {
CXFA_EventParam preParam;
preParam.m_eType = XFA_EVENT_PreSave;
- pWidgetHandler->ProcessEvent(pWidgetAcc->GetNode(), &preParam);
+ pWidgetHandler->ProcessEvent(pNode, &preParam);
}
pXFADocView->UpdateDocView();
return SaveXFADocumentData(pContext, fileList);