Add CFWL_ListBox::IsMultiSelection().

Review-Url: https://codereview.chromium.org/2527783004
diff --git a/xfa/fwl/core/cfwl_listbox.cpp b/xfa/fwl/core/cfwl_listbox.cpp
index f234585..1208ab3 100644
--- a/xfa/fwl/core/cfwl_listbox.cpp
+++ b/xfa/fwl/core/cfwl_listbox.cpp
@@ -196,7 +196,7 @@
     }
     return;
   }
-  if (m_pProperties->m_dwStyleExes & FWL_STYLEEXT_LTB_MultiSelection)
+  if (IsMultiSelection())
     SetSelectionDirect(pItem, bSelect);
   else
     SetSelection(pItem, pItem, bSelect);
@@ -269,13 +269,17 @@
   SetItemStyles(this, pItem, dwOldStyle);
 }
 
+bool CFWL_ListBox::IsMultiSelection() const {
+  return m_pProperties->m_dwStyleExes & FWL_STYLEEXT_LTB_MultiSelection;
+}
+
 bool CFWL_ListBox::IsItemSelected(CFWL_ListItem* pItem) {
   uint32_t dwState = GetItemStyles(this, pItem);
   return (dwState & FWL_ITEMSTATE_LTB_Selected) != 0;
 }
 
 void CFWL_ListBox::ClearSelection() {
-  bool bMulti = m_pProperties->m_dwStyleExes & FWL_STYLEEXT_LTB_MultiSelection;
+  bool bMulti = IsMultiSelection();
   int32_t iCount = CountItems(this);
   for (int32_t i = 0; i < iCount; i++) {
     CFWL_ListItem* pItem = GetItem(this, i);
@@ -289,7 +293,7 @@
 }
 
 void CFWL_ListBox::SelectAll() {
-  if (!(m_pProperties->m_dwStyleExes & FWL_STYLEEXT_LTB_MultiSelection))
+  if (!IsMultiSelection())
     return;
 
   int32_t iCount = CountItems(this);
@@ -852,7 +856,7 @@
   if (!pItem)
     return;
 
-  if (m_pProperties->m_dwStyleExes & FWL_STYLEEXT_LTB_MultiSelection) {
+  if (IsMultiSelection()) {
     if (pMsg->m_dwFlags & FWL_KEYFLAG_Ctrl) {
       bool bSelected = IsItemSelected(pItem);
       SetSelectionDirect(pItem, !bSelected);
@@ -922,7 +926,7 @@
   if (!pItem)
     return;
 
-  if (m_pProperties->m_dwStyleExes & FWL_STYLEEXT_LTB_MultiSelection) {
+  if (IsMultiSelection()) {
     if (bCtrl) {
       // Do nothing.
     } else if (bShift) {
diff --git a/xfa/fwl/core/cfwl_listbox.h b/xfa/fwl/core/cfwl_listbox.h
index a758e19..a2dcdba 100644
--- a/xfa/fwl/core/cfwl_listbox.h
+++ b/xfa/fwl/core/cfwl_listbox.h
@@ -113,6 +113,7 @@
 
  private:
   void SetSelectionDirect(CFWL_ListItem* hItem, bool bSelect);
+  bool IsMultiSelection() const;
   bool IsItemSelected(CFWL_ListItem* hItem);
   void ClearSelection();
   void SelectAll();