summaryrefslogtreecommitdiff
path: root/xfa/fxfa/app/xfa_ffchoicelist.cpp
diff options
context:
space:
mode:
authorthestig <thestig@chromium.org>2016-05-26 22:00:29 -0700
committerCommit bot <commit-bot@chromium.org>2016-05-26 22:00:29 -0700
commit800222e01e3fcdd57536fc987e773677829dd708 (patch)
tree2c7e62ba05fa9855de3090dbab6f61169055372b /xfa/fxfa/app/xfa_ffchoicelist.cpp
parentbefa4506dc9d2a679c526aff96c09bcb0e9daecb (diff)
downloadpdfium-800222e01e3fcdd57536fc987e773677829dd708.tar.xz
Fix MSVC C4800 build warnings.
TBR=weili@chromium.org Review-Url: https://codereview.chromium.org/2017863002
Diffstat (limited to 'xfa/fxfa/app/xfa_ffchoicelist.cpp')
-rw-r--r--xfa/fxfa/app/xfa_ffchoicelist.cpp33
1 files changed, 15 insertions, 18 deletions
diff --git a/xfa/fxfa/app/xfa_ffchoicelist.cpp b/xfa/fxfa/app/xfa_ffchoicelist.cpp
index 3f8ea29a49..21f96eeb79 100644
--- a/xfa/fxfa/app/xfa_ffchoicelist.cpp
+++ b/xfa/fxfa/app/xfa_ffchoicelist.cpp
@@ -62,44 +62,41 @@ FX_BOOL CXFA_FFListBox::LoadWidget() {
m_pNormalWidget->UnlockUpdate();
return CXFA_FFField::LoadWidget();
}
+
FX_BOOL CXFA_FFListBox::OnKillFocus(CXFA_FFWidget* pNewFocus) {
- FX_BOOL flag = ProcessCommittedData();
- if (!flag) {
+ if (!ProcessCommittedData())
UpdateFWLData();
- }
CXFA_FFField::OnKillFocus(pNewFocus);
return TRUE;
}
+
FX_BOOL CXFA_FFListBox::CommitData() {
CFWL_ListBox* pListBox = static_cast<CFWL_ListBox*>(m_pNormalWidget);
int32_t iSels = pListBox->CountSelItems();
CFX_Int32Array iSelArray;
- for (int32_t i = 0; i < iSels; i++) {
+ for (int32_t i = 0; i < iSels; ++i)
iSelArray.Add(pListBox->GetSelIndex(i));
- }
- m_pDataAcc->SetSelectedItems(iSelArray, TRUE);
+ m_pDataAcc->SetSelectedItems(iSelArray, true, FALSE, TRUE);
return TRUE;
}
+
FX_BOOL CXFA_FFListBox::IsDataChanged() {
CFX_Int32Array iSelArray;
m_pDataAcc->GetSelectedItems(iSelArray);
int32_t iOldSels = iSelArray.GetSize();
CFWL_ListBox* pListBox = (CFWL_ListBox*)m_pNormalWidget;
int32_t iSels = pListBox->CountSelItems();
- if (iOldSels == iSels) {
- int32_t iIndex = 0;
- for (; iIndex < iSels; iIndex++) {
- FWL_HLISTITEM hlistItem = pListBox->GetItem(iSelArray[iIndex]);
- if (!(pListBox->GetItemStates(hlistItem) && FWL_ITEMSTATE_LTB_Selected)) {
- break;
- }
- }
- if (iIndex == iSels) {
- return FALSE;
- }
+ if (iOldSels != iSels)
+ return TRUE;
+
+ for (int32_t i = 0; i < iSels; ++i) {
+ FWL_HLISTITEM hlistItem = pListBox->GetItem(iSelArray[i]);
+ if (!(pListBox->GetItemStates(hlistItem) && FWL_ITEMSTATE_LTB_Selected))
+ return TRUE;
}
- return TRUE;
+ return FALSE;
}
+
uint32_t CXFA_FFListBox::GetAlignment() {
uint32_t dwExtendedStyle = 0;
if (CXFA_Para para = m_pDataAcc->GetPara()) {