Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(386)

Unified Diff: xfa/fxfa/app/xfa_ffchoicelist.cpp

Issue 2017863002: Fix MSVC C4800 build warnings. (Closed) Base URL: https://pdfium.googlesource.com/pdfium@master
Patch Set: put C4800 back Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « xfa/fxfa/app/xfa_ffcheckbutton.cpp ('k') | xfa/fxfa/parser/cxfa_widgetdata.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: xfa/fxfa/app/xfa_ffchoicelist.cpp
diff --git a/xfa/fxfa/app/xfa_ffchoicelist.cpp b/xfa/fxfa/app/xfa_ffchoicelist.cpp
index 3f8ea29a49639bdc4146ee93c547af3ae0525812..21f96eeb790cac7015a5adf5e043a07665ddf9a1 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()) {
« no previous file with comments | « xfa/fxfa/app/xfa_ffcheckbutton.cpp ('k') | xfa/fxfa/parser/cxfa_widgetdata.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698