summaryrefslogtreecommitdiff
path: root/xfa/fwl/cfwl_checkbox.cpp
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2017-01-30 14:26:24 -0800
committerChromium commit bot <commit-bot@chromium.org>2017-01-31 01:34:14 +0000
commit576e8151efab01166142ec697b66ce38b7bf6780 (patch)
tree3a5407e99f885419081e673726ece94b155e2d1c /xfa/fwl/cfwl_checkbox.cpp
parent3509d16d3f3538867c42689b2353cb394c1fd97b (diff)
downloadpdfium-576e8151efab01166142ec697b66ce38b7bf6780.tar.xz
Use std::vector and unique_ptr in xfa/fwl.
Change-Id: I21aeb1df387b60330d87a6cc82c615878c1f5596 Reviewed-on: https://pdfium-review.googlesource.com/2457 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'xfa/fwl/cfwl_checkbox.cpp')
-rw-r--r--xfa/fwl/cfwl_checkbox.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/xfa/fwl/cfwl_checkbox.cpp b/xfa/fwl/cfwl_checkbox.cpp
index 5d40d8f425..4a2d2dbaee 100644
--- a/xfa/fwl/cfwl_checkbox.cpp
+++ b/xfa/fwl/cfwl_checkbox.cpp
@@ -9,6 +9,7 @@
#include <algorithm>
#include <memory>
#include <utility>
+#include <vector>
#include "third_party/base/ptr_util.h"
#include "xfa/fde/tto/fde_textout.h"
@@ -187,12 +188,10 @@ void CFWL_CheckBox::NextStates() {
FWL_STATE_CKB_Unchecked) {
CFWL_WidgetMgr* pWidgetMgr = GetOwnerApp()->GetWidgetMgr();
if (!pWidgetMgr->IsFormDisabled()) {
- CFX_ArrayTemplate<CFWL_Widget*> radioarr;
- pWidgetMgr->GetSameGroupRadioButton(this, radioarr);
- CFWL_CheckBox* pCheckBox = nullptr;
- int32_t iCount = radioarr.GetSize();
- for (int32_t i = 0; i < iCount; i++) {
- pCheckBox = static_cast<CFWL_CheckBox*>(radioarr[i]);
+ std::vector<CFWL_Widget*> radioarr =
+ pWidgetMgr->GetSameGroupRadioButton(this);
+ for (const auto& pWidget : radioarr) {
+ CFWL_CheckBox* pCheckBox = static_cast<CFWL_CheckBox*>(pWidget);
if (pCheckBox != this &&
pCheckBox->GetStates() & FWL_STATE_CKB_Checked) {
pCheckBox->SetCheckState(0);