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

Side by Side Diff: xfa/fwl/basewidget/fwl_listboximp.cpp

Issue 1951653002: Return bool rather than bitwise-and for FX_BOOL (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: More bool, fix nits. 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 unified diff | Download patch
« no previous file with comments | « xfa/fwl/basewidget/fwl_editimp.cpp ('k') | xfa/fwl/core/fwl_formimp.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 PDFium Authors. All rights reserved. 1 // Copyright 2014 PDFium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6 6
7 #include "xfa/fwl/basewidget/fwl_listboximp.h" 7 #include "xfa/fwl/basewidget/fwl_listboximp.h"
8 8
9 #include "xfa/fde/tto/fde_textout.h" 9 #include "xfa/fde/tto/fde_textout.h"
10 #include "xfa/fwl/basewidget/fwl_comboboximp.h" 10 #include "xfa/fwl/basewidget/fwl_comboboximp.h"
(...skipping 381 matching lines...) Expand 10 before | Expand all | Expand 10 after
392 } 392 }
393 void CFWL_ListBoxImp::ClearSelection() { 393 void CFWL_ListBoxImp::ClearSelection() {
394 FX_BOOL bMulti = 394 FX_BOOL bMulti =
395 m_pProperties->m_dwStyleExes & FWL_STYLEEXT_LTB_MultiSelection; 395 m_pProperties->m_dwStyleExes & FWL_STYLEEXT_LTB_MultiSelection;
396 IFWL_ListBoxDP* pData = 396 IFWL_ListBoxDP* pData =
397 static_cast<IFWL_ListBoxDP*>(m_pProperties->m_pDataProvider); 397 static_cast<IFWL_ListBoxDP*>(m_pProperties->m_pDataProvider);
398 int32_t iCount = pData->CountItems(m_pInterface); 398 int32_t iCount = pData->CountItems(m_pInterface);
399 for (int32_t i = 0; i < iCount; i++) { 399 for (int32_t i = 0; i < iCount; i++) {
400 FWL_HLISTITEM hItem = pData->GetItem(m_pInterface, i); 400 FWL_HLISTITEM hItem = pData->GetItem(m_pInterface, i);
401 uint32_t dwState = pData->GetItemStyles(m_pInterface, hItem); 401 uint32_t dwState = pData->GetItemStyles(m_pInterface, hItem);
402 FX_BOOL bFindSel = dwState & FWL_ITEMSTATE_LTB_Selected; 402 if (!(dwState & FWL_ITEMSTATE_LTB_Selected))
403 if (!bFindSel) {
404 continue; 403 continue;
405 }
406 SetSelectionDirect(hItem, FALSE); 404 SetSelectionDirect(hItem, FALSE);
407 if (!bMulti) { 405 if (!bMulti)
408 return; 406 return;
409 }
410 } 407 }
411 } 408 }
412 void CFWL_ListBoxImp::SelectAll() { 409 void CFWL_ListBoxImp::SelectAll() {
413 FX_BOOL bMulti = 410 FX_BOOL bMulti =
414 m_pProperties->m_dwStyleExes & FWL_STYLEEXT_LTB_MultiSelection; 411 m_pProperties->m_dwStyleExes & FWL_STYLEEXT_LTB_MultiSelection;
415 if (!bMulti) { 412 if (!bMulti) {
416 return; 413 return;
417 } 414 }
418 IFWL_ListBoxDP* pData = 415 IFWL_ListBoxDP* pData =
419 static_cast<IFWL_ListBoxDP*>(m_pProperties->m_pDataProvider); 416 static_cast<IFWL_ListBoxDP*>(m_pProperties->m_pDataProvider);
(...skipping 822 matching lines...) Expand 10 before | Expand all | Expand 10 after
1242 pScrollBar->SetTrackPos(fPos); 1239 pScrollBar->SetTrackPos(fPos);
1243 m_pOwner->Repaint(&m_pOwner->m_rtClient); 1240 m_pOwner->Repaint(&m_pOwner->m_rtClient);
1244 } 1241 }
1245 return TRUE; 1242 return TRUE;
1246 } 1243 }
1247 void CFWL_ListBoxImpDelegate::DispatchSelChangedEv() { 1244 void CFWL_ListBoxImpDelegate::DispatchSelChangedEv() {
1248 CFWL_EvtLtbSelChanged ev; 1245 CFWL_EvtLtbSelChanged ev;
1249 ev.m_pSrcTarget = m_pOwner->m_pInterface; 1246 ev.m_pSrcTarget = m_pOwner->m_pInterface;
1250 m_pOwner->DispatchEvent(&ev); 1247 m_pOwner->DispatchEvent(&ev);
1251 } 1248 }
OLDNEW
« no previous file with comments | « xfa/fwl/basewidget/fwl_editimp.cpp ('k') | xfa/fwl/core/fwl_formimp.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698