summaryrefslogtreecommitdiff
path: root/xfa/fxfa/app/xfa_ffdocview.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'xfa/fxfa/app/xfa_ffdocview.cpp')
-rw-r--r--xfa/fxfa/app/xfa_ffdocview.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/xfa/fxfa/app/xfa_ffdocview.cpp b/xfa/fxfa/app/xfa_ffdocview.cpp
index bf91baf082..0aedeed231 100644
--- a/xfa/fxfa/app/xfa_ffdocview.cpp
+++ b/xfa/fxfa/app/xfa_ffdocview.cpp
@@ -636,11 +636,12 @@ void CXFA_FFDocView::AddCalculateWidgetAcc(CXFA_WidgetAcc* pWidgetAcc) {
}
void CXFA_FFDocView::AddCalculateNodeNotify(CXFA_Node* pNodeChange) {
- CXFA_CalcData* pGlobalData =
- (CXFA_CalcData*)pNodeChange->GetUserData(XFA_CalcData);
- int32_t iCount = pGlobalData ? pGlobalData->m_Globals.GetSize() : 0;
- for (int32_t i = 0; i < iCount; i++) {
- CXFA_WidgetAcc* pResultAcc = pGlobalData->m_Globals[i];
+ auto pGlobalData =
+ static_cast<CXFA_CalcData*>(pNodeChange->GetUserData(XFA_CalcData));
+ if (!pGlobalData)
+ return;
+
+ for (const auto& pResultAcc : pGlobalData->m_Globals) {
if (!pResultAcc->GetNode()->HasRemovedChildren())
AddCalculateWidgetAcc(pResultAcc);
}