Rename common methods between ifwl and cfwl.

This CL renames some methods in IFWL which have the same name as the CFWL
methods but the CFWL methods are not proxy methods.

Review-Url: https://codereview.chromium.org/2520413002
diff --git a/xfa/fwl/core/cfwl_listbox.cpp b/xfa/fwl/core/cfwl_listbox.cpp
index 4c933bf..7da49ef 100644
--- a/xfa/fwl/core/cfwl_listbox.cpp
+++ b/xfa/fwl/core/cfwl_listbox.cpp
@@ -82,15 +82,11 @@
     ToListBox(GetWidget())->SetSelItem(pItem, bSelect);
 }
 
-void CFWL_ListBox::GetItemText(CFWL_ListItem* pItem, CFX_WideString& wsText) {
-  if (GetWidget())
-    ToListBox(GetWidget())->GetItemText(pItem, wsText);
-}
-
-CFWL_ListItem* CFWL_ListBox::GetItem(int32_t nIndex) {
-  if (nIndex < 0 || nIndex >= CountItems(nullptr))
-    return nullptr;
-  return m_ItemArray[nIndex].get();
+void CFWL_ListBox::GetItemText(IFWL_Widget* pWidget,
+                               CFWL_ListItem* pItem,
+                               CFX_WideString& wsText) {
+  if (pItem)
+    wsText = static_cast<CFWL_ListItem*>(pItem)->m_wsText;
 }
 
 uint32_t CFWL_ListBox::GetItemStates(CFWL_ListItem* pItem) {
@@ -124,13 +120,6 @@
   return pItem ? static_cast<CFWL_ListItem*>(pItem)->m_dwStates : 0;
 }
 
-void CFWL_ListBox::GetItemText(IFWL_Widget* pWidget,
-                               CFWL_ListItem* pItem,
-                               CFX_WideString& wsText) {
-  if (pItem)
-    wsText = static_cast<CFWL_ListItem*>(pItem)->m_wsText;
-}
-
 void CFWL_ListBox::GetItemRect(IFWL_Widget* pWidget,
                                CFWL_ListItem* pItem,
                                CFX_RectF& rtItem) {
diff --git a/xfa/fwl/core/cfwl_listbox.h b/xfa/fwl/core/cfwl_listbox.h
index ec03382..80bc23b 100644
--- a/xfa/fwl/core/cfwl_listbox.h
+++ b/xfa/fwl/core/cfwl_listbox.h
@@ -64,8 +64,6 @@
   CFWL_ListItem* GetSelItem(int32_t nIndexSel);
   int32_t GetSelIndex(int32_t nIndex);
 
-  CFWL_ListItem* GetItem(int32_t nIndex);
-  void GetItemText(CFWL_ListItem* pItem, CFX_WideString& wsText);
   uint32_t GetItemStates(CFWL_ListItem* pItem);
 
  private:
diff --git a/xfa/fwl/core/ifwl_combobox.cpp b/xfa/fwl/core/ifwl_combobox.cpp
index e632120..82d9d3d 100644
--- a/xfa/fwl/core/ifwl_combobox.cpp
+++ b/xfa/fwl/core/ifwl_combobox.cpp
@@ -207,7 +207,7 @@
           static_cast<IFWL_ComboBox::DataProvider*>(
               m_pProperties->m_pDataProvider);
       CFWL_ListItem* hItem = pData->GetItem(this, m_iCurSel);
-      m_pListBox->GetItemText(hItem, wsText);
+      m_pListBox->GetDataProviderItemText(hItem, wsText);
 
       CFWL_ThemeText theme_text;
       theme_text.m_pWidget = this;
@@ -261,7 +261,7 @@
           static_cast<IFWL_ComboBox::DataProvider*>(
               m_pProperties->m_pDataProvider);
       CFWL_ListItem* hItem = pData->GetItem(this, iSel);
-      m_pListBox->GetItemText(hItem, wsText);
+      m_pListBox->GetDataProviderItemText(hItem, wsText);
       m_pEdit->SetText(wsText);
     }
     m_pEdit->Update();
@@ -298,7 +298,7 @@
   IFWL_ComboBox::DataProvider* pData =
       static_cast<IFWL_ComboBox::DataProvider*>(m_pProperties->m_pDataProvider);
   CFWL_ListItem* hItem = pData->GetItem(this, m_iCurSel);
-  m_pListBox->GetItemText(hItem, wsText);
+  m_pListBox->GetDataProviderItemText(hItem, wsText);
 }
 
 void IFWL_ComboBox::OpenDropDownList(bool bActivate) {
@@ -327,7 +327,7 @@
     m_pEdit->ModifyStylesEx(dwStylesExAdded, dwStylesExRemoved);
 }
 
-FX_FLOAT IFWL_ComboBox::GetListHeight() {
+FX_FLOAT IFWL_ComboBox::GetDataProviderListHeight() {
   return static_cast<IFWL_ComboBox::DataProvider*>(
              m_pProperties->m_pDataProvider)
       ->GetListHeight(this);
@@ -371,9 +371,9 @@
                         (FWL_STYLEEXT_CMB_Sort | FWL_STYLEEXT_CMB_OwnerDraw);
   m_pListBox->ModifyStylesEx(dwStyleAdd, 0);
   m_pListBox->GetWidgetRect(m_rtList, true);
-  FX_FLOAT fHeight = GetListHeight();
-  if (fHeight > 0 && m_rtList.height > GetListHeight()) {
-    m_rtList.height = GetListHeight();
+  FX_FLOAT fHeight = GetDataProviderListHeight();
+  if (fHeight > 0 && m_rtList.height > fHeight) {
+    m_rtList.height = fHeight;
     m_pListBox->ModifyStyles(FWL_WGTSTYLE_VScroll, 0);
   }
 
@@ -435,7 +435,7 @@
   IFWL_ComboBox::DataProvider* pData =
       static_cast<IFWL_ComboBox::DataProvider*>(m_pProperties->m_pDataProvider);
   CFWL_ListItem* hItem = pData->GetItem(this, iListItem);
-  m_pListBox->GetItemText(hItem, wsText);
+  m_pListBox->GetDataProviderItemText(hItem, wsText);
   m_pEdit->SetText(wsText);
   m_pEdit->Update();
   m_pEdit->SetSelected();
@@ -468,7 +468,7 @@
         static_cast<IFWL_ComboBox::DataProvider*>(
             m_pProperties->m_pDataProvider);
     CFWL_ListItem* hItem = pData->GetItem(this, m_iCurSel);
-    m_pListBox->GetItemText(hItem, wsText);
+    m_pListBox->GetDataProviderItemText(hItem, wsText);
     m_pEdit->LockUpdate();
     m_pEdit->SetText(wsText);
     m_pEdit->UnlockUpdate();
@@ -804,7 +804,7 @@
         static_cast<IFWL_ComboBox::DataProvider*>(
             m_pProperties->m_pDataProvider);
     CFWL_ListItem* hItem = pData->GetItem(this, m_iCurSel);
-    m_pListBox->GetItemText(hItem, wsText);
+    m_pListBox->GetDataProviderItemText(hItem, wsText);
     m_pEdit->LockUpdate();
     m_pEdit->SetText(wsText);
     m_pEdit->UnlockUpdate();
@@ -990,7 +990,7 @@
             static_cast<IFWL_ComboBox::DataProvider*>(
                 m_pProperties->m_pDataProvider);
         CFWL_ListItem* hItem = pData->GetItem(this, iCurSel);
-        m_pListBox->GetItemText(hItem, wsTemp);
+        m_pListBox->GetDataProviderItemText(hItem, wsTemp);
         bMatchEqual = wsText == wsTemp;
       }
     }
@@ -1126,7 +1126,7 @@
       if (iCurSel >= 0) {
         CFX_WideString wsTemp;
         CFWL_ListItem* item = m_pListBox->GetSelItem(iCurSel);
-        m_pListBox->GetItemText(item, wsTemp);
+        m_pListBox->GetDataProviderItemText(item, wsTemp);
         bMatchEqual = wsText == wsTemp;
       }
     }
diff --git a/xfa/fwl/core/ifwl_combobox.h b/xfa/fwl/core/ifwl_combobox.h
index db5b067..ad48ec2 100644
--- a/xfa/fwl/core/ifwl_combobox.h
+++ b/xfa/fwl/core/ifwl_combobox.h
@@ -120,7 +120,7 @@
   int32_t GetCurrentSelection() const { return m_iCurSel; }
 
  private:
-  FX_FLOAT GetListHeight();
+  FX_FLOAT GetDataProviderListHeight();
   bool IsDropDownStyle() const {
     return !!(m_pProperties->m_dwStyleExes & FWL_STYLEEXT_CMB_DropDown);
   }
diff --git a/xfa/fwl/core/ifwl_combolist.cpp b/xfa/fwl/core/ifwl_combolist.cpp
index e3ddcd0..18612db 100644
--- a/xfa/fwl/core/ifwl_combolist.cpp
+++ b/xfa/fwl/core/ifwl_combolist.cpp
@@ -260,7 +260,7 @@
               m_pProperties->m_pDataProvider);
       CFWL_ListItem* hItem =
           pData->GetItem(this, pOuter->GetCurrentSelection());
-      hItem = GetItem(hItem, dwKeyCode);
+      hItem = GetListItem(hItem, dwKeyCode);
       if (!hItem)
         break;
 
diff --git a/xfa/fwl/core/ifwl_listbox.cpp b/xfa/fwl/core/ifwl_listbox.cpp
index aa17355..bcc8040 100644
--- a/xfa/fwl/core/ifwl_listbox.cpp
+++ b/xfa/fwl/core/ifwl_listbox.cpp
@@ -215,7 +215,8 @@
     SetSelection(pItem, pItem, bSelect);
 }
 
-void IFWL_ListBox::GetItemText(CFWL_ListItem* pItem, CFX_WideString& wsText) {
+void IFWL_ListBox::GetDataProviderItemText(CFWL_ListItem* pItem,
+                                           CFX_WideString& wsText) {
   if (!m_pProperties->m_pDataProvider)
     return;
 
@@ -227,7 +228,8 @@
   pData->GetItemText(this, pItem, wsText);
 }
 
-CFWL_ListItem* IFWL_ListBox::GetItem(CFWL_ListItem* pItem, uint32_t dwKeyCode) {
+CFWL_ListItem* IFWL_ListBox::GetListItem(CFWL_ListItem* pItem,
+                                         uint32_t dwKeyCode) {
   CFWL_ListItem* hRet = nullptr;
   switch (dwKeyCode) {
     case FWL_VKEY_Up:
@@ -391,7 +393,8 @@
   return nullptr;
 }
 
-bool IFWL_ListBox::GetItemCheckRect(CFWL_ListItem* pItem, CFX_RectF& rtCheck) {
+bool IFWL_ListBox::GetItemCheckRectInternal(CFWL_ListItem* pItem,
+                                            CFX_RectF& rtCheck) {
   if (!m_pProperties->m_pDataProvider)
     return false;
   if (!(m_pProperties->m_dwStyleExes & FWL_STYLEEXT_LTB_Check))
@@ -935,7 +938,7 @@
   if (m_pProperties->m_dwStyleExes & FWL_STYLEEXT_LTB_Check) {
     CFWL_ListItem* hSelectedItem = GetItemAtPoint(pMsg->m_fx, pMsg->m_fy);
     CFX_RectF rtCheck;
-    GetItemCheckRect(hSelectedItem, rtCheck);
+    GetItemCheckRectInternal(hSelectedItem, rtCheck);
     bool bChecked = GetItemChecked(pItem);
     if (rtCheck.Contains(pMsg->m_fx, pMsg->m_fy)) {
       SetItemChecked(pItem, !bChecked);
@@ -970,7 +973,7 @@
     case FWL_VKEY_Home:
     case FWL_VKEY_End: {
       CFWL_ListItem* pItem = GetFocusedItem();
-      pItem = GetItem(pItem, dwKeyCode);
+      pItem = GetListItem(pItem, dwKeyCode);
       bool bShift = !!(pMsg->m_dwFlags & FWL_KEYFLAG_Shift);
       bool bCtrl = !!(pMsg->m_dwFlags & FWL_KEYFLAG_Ctrl);
       OnVK(pItem, bShift, bCtrl);
diff --git a/xfa/fwl/core/ifwl_listbox.h b/xfa/fwl/core/ifwl_listbox.h
index ec65874..b6c0b82 100644
--- a/xfa/fwl/core/ifwl_listbox.h
+++ b/xfa/fwl/core/ifwl_listbox.h
@@ -98,13 +98,13 @@
   CFWL_ListItem* GetSelItem(int32_t nIndexSel);
   int32_t GetSelIndex(int32_t nIndex);
   void SetSelItem(CFWL_ListItem* hItem, bool bSelect = true);
-  void GetItemText(CFWL_ListItem* hItem, CFX_WideString& wsText);
+  void GetDataProviderItemText(CFWL_ListItem* hItem, CFX_WideString& wsText);
 
   FX_FLOAT GetItemHeight() const { return m_fItemHeight; }
   FX_FLOAT CalcItemHeight();
 
  protected:
-  CFWL_ListItem* GetItem(CFWL_ListItem* hItem, uint32_t dwKeyCode);
+  CFWL_ListItem* GetListItem(CFWL_ListItem* hItem, uint32_t dwKeyCode);
   void SetSelection(CFWL_ListItem* hStart, CFWL_ListItem* hEnd, bool bSelected);
   CFWL_ListItem* GetItemAtPoint(FX_FLOAT fx, FX_FLOAT fy);
   bool ScrollToVisible(CFWL_ListItem* hItem);
@@ -120,7 +120,7 @@
   void SelectAll();
   CFWL_ListItem* GetFocusedItem();
   void SetFocusItem(CFWL_ListItem* hItem);
-  bool GetItemCheckRect(CFWL_ListItem* hItem, CFX_RectF& rtCheck);
+  bool GetItemCheckRectInternal(CFWL_ListItem* hItem, CFX_RectF& rtCheck);
   bool SetItemChecked(CFWL_ListItem* hItem, bool bChecked);
   bool GetItemChecked(CFWL_ListItem* hItem);
   void DrawBkground(CFX_Graphics* pGraphics,
diff --git a/xfa/fxfa/app/xfa_ffchoicelist.cpp b/xfa/fxfa/app/xfa_ffchoicelist.cpp
index 63ed7c4..da433ae 100644
--- a/xfa/fxfa/app/xfa_ffchoicelist.cpp
+++ b/xfa/fxfa/app/xfa_ffchoicelist.cpp
@@ -66,7 +66,7 @@
   m_pDataAcc->GetSelectedItems(iSelArray);
   int32_t iSelCount = iSelArray.GetSize();
   for (int32_t j = 0; j < iSelCount; j++) {
-    CFWL_ListItem* item = pListBox->GetItem(iSelArray[j]);
+    CFWL_ListItem* item = pListBox->GetItem(nullptr, iSelArray[j]);
     pListBox->SetSelItem(item, true);
   }
   m_pNormalWidget->UnlockUpdate();
@@ -100,7 +100,7 @@
     return true;
 
   for (int32_t i = 0; i < iSels; ++i) {
-    CFWL_ListItem* hlistItem = pListBox->GetItem(iSelArray[i]);
+    CFWL_ListItem* hlistItem = pListBox->GetItem(nullptr, iSelArray[i]);
     if (!(pListBox->GetItemStates(hlistItem) & FWL_ITEMSTATE_LTB_Selected))
       return true;
   }
@@ -160,7 +160,7 @@
   CFWL_ListBox* pListBox = (CFWL_ListBox*)m_pNormalWidget;
   int32_t iSels = pListBox->CountSelItems();
   if (iSels > 0) {
-    pListBox->GetItemText(pListBox->GetSelItem(0), eParam.m_wsNewText);
+    pListBox->GetItemText(nullptr, pListBox->GetSelItem(0), eParam.m_wsNewText);
   }
   m_pDataAcc->ProcessEvent(XFA_ATTRIBUTEENUM_Change, &eParam);
 }
@@ -178,13 +178,13 @@
   AddInvalidateRect();
 }
 void CXFA_FFListBox::DeleteItem(int32_t nIndex) {
-  if (nIndex < 0) {
-    ((CFWL_ListBox*)m_pNormalWidget)->DeleteAll();
-  } else {
-    ((CFWL_ListBox*)m_pNormalWidget)
-        ->DeleteString(((CFWL_ListBox*)m_pNormalWidget)->GetItem(nIndex));
-  }
-  m_pNormalWidget->Update();
+  CFWL_ListBox* listBox = static_cast<CFWL_ListBox*>(m_pNormalWidget);
+  if (nIndex < 0)
+    listBox->DeleteAll();
+  else
+    listBox->DeleteString(listBox->GetItem(nullptr, nIndex));
+
+  listBox->Update();
   AddInvalidateRect();
 }