summaryrefslogtreecommitdiff
path: root/xfa/fxfa
diff options
context:
space:
mode:
Diffstat (limited to 'xfa/fxfa')
-rw-r--r--xfa/fxfa/app/xfa_ffdocview.cpp11
-rw-r--r--xfa/fxfa/app/xfa_ffwidget.cpp4
-rw-r--r--xfa/fxfa/app/xfa_ffwidgetacc.cpp5
-rw-r--r--xfa/fxfa/xfa_ffwidget.h2
4 files changed, 10 insertions, 12 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);
}
diff --git a/xfa/fxfa/app/xfa_ffwidget.cpp b/xfa/fxfa/app/xfa_ffwidget.cpp
index c1822470e0..4cd6b44a66 100644
--- a/xfa/fxfa/app/xfa_ffwidget.cpp
+++ b/xfa/fxfa/app/xfa_ffwidget.cpp
@@ -2048,6 +2048,4 @@ void XFA_DrawBox(CXFA_Box box,
CXFA_CalcData::CXFA_CalcData() : m_iRefCount(0) {}
-CXFA_CalcData::~CXFA_CalcData() {
- m_Globals.RemoveAll();
-}
+CXFA_CalcData::~CXFA_CalcData() {}
diff --git a/xfa/fxfa/app/xfa_ffwidgetacc.cpp b/xfa/fxfa/app/xfa_ffwidgetacc.cpp
index d4d9949c3e..5fe591c02a 100644
--- a/xfa/fxfa/app/xfa_ffwidgetacc.cpp
+++ b/xfa/fxfa/app/xfa_ffwidgetacc.cpp
@@ -678,9 +678,8 @@ int32_t CXFA_WidgetAcc::ExecuteScript(CXFA_Script script,
pRefNode->SetUserData(XFA_CalcData, pGlobalData,
&gs_XFADeleteCalcData);
}
- if (pGlobalData->m_Globals.Find(this) < 0) {
- pGlobalData->m_Globals.Add(this);
- }
+ if (!pdfium::ContainsValue(pGlobalData->m_Globals, this))
+ pGlobalData->m_Globals.push_back(this);
}
}
}
diff --git a/xfa/fxfa/xfa_ffwidget.h b/xfa/fxfa/xfa_ffwidget.h
index f4ef8ce97b..009cd44dc0 100644
--- a/xfa/fxfa/xfa_ffwidget.h
+++ b/xfa/fxfa/xfa_ffwidget.h
@@ -37,7 +37,7 @@ class CXFA_CalcData {
CXFA_CalcData();
~CXFA_CalcData();
- CFX_ArrayTemplate<CXFA_WidgetAcc*> m_Globals;
+ std::vector<CXFA_WidgetAcc*> m_Globals;
int32_t m_iRefCount;
};