Rename CFFL_RadioButton::GetRadioButton() to GetPWLRadioButton()
Straight rename, no funny business.
I spent a few seconds wondering why we had to call GetRadioButton() on
a CFFL_RadioButton and whether it was superfluous and should be removed.
It's not, since it returns an object from the lower PWL layer. The
new naming should make this more obvious.
-- Do the same for CFFL_CheckBox, CFFL_ListBox, and CFFL_TextField.
Change-Id: I908cdbfc0bca1d4c350987b0f8b7069e6d898dfe
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/85030
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
diff --git a/fpdfsdk/formfiller/cffl_checkbox.cpp b/fpdfsdk/formfiller/cffl_checkbox.cpp
index 5676abd..4bea5e8 100644
--- a/fpdfsdk/formfiller/cffl_checkbox.cpp
+++ b/fpdfsdk/formfiller/cffl_checkbox.cpp
@@ -65,7 +65,7 @@
CFFL_FormField::OnChar(pAnnot, nChar, nFlags);
- CPWL_CheckBox* pWnd = CreateOrUpdateCheckBox(pPageView);
+ CPWL_CheckBox* pWnd = CreateOrUpdatePWLCheckBox(pPageView);
if (pWnd && !pWnd->IsReadOnly()) {
CPDFSDK_Widget* pWidget = ToCPDFSDKWidget(pAnnot);
pWnd->SetCheck(!pWidget->IsChecked());
@@ -87,7 +87,7 @@
if (!IsValid())
return true;
- CPWL_CheckBox* pWnd = CreateOrUpdateCheckBox(pPageView);
+ CPWL_CheckBox* pWnd = CreateOrUpdatePWLCheckBox(pPageView);
if (pWnd) {
CPDFSDK_Widget* pWidget = ToCPDFSDKWidget(pAnnot);
pWnd->SetCheck(!pWidget->IsChecked());
@@ -97,12 +97,12 @@
}
bool CFFL_CheckBox::IsDataChanged(const CPDFSDK_PageView* pPageView) {
- CPWL_CheckBox* pWnd = GetCheckBox(pPageView);
+ CPWL_CheckBox* pWnd = GetPWLCheckBox(pPageView);
return pWnd && pWnd->IsChecked() != m_pWidget->IsChecked();
}
void CFFL_CheckBox::SaveData(const CPDFSDK_PageView* pPageView) {
- CPWL_CheckBox* pWnd = GetCheckBox(pPageView);
+ CPWL_CheckBox* pWnd = GetPWLCheckBox(pPageView);
if (!pWnd)
return;
@@ -130,12 +130,12 @@
SetChangeMark();
}
-CPWL_CheckBox* CFFL_CheckBox::GetCheckBox(
+CPWL_CheckBox* CFFL_CheckBox::GetPWLCheckBox(
const CPDFSDK_PageView* pPageView) const {
return static_cast<CPWL_CheckBox*>(GetPWLWindow(pPageView));
}
-CPWL_CheckBox* CFFL_CheckBox::CreateOrUpdateCheckBox(
+CPWL_CheckBox* CFFL_CheckBox::CreateOrUpdatePWLCheckBox(
const CPDFSDK_PageView* pPageView) {
return static_cast<CPWL_CheckBox*>(CreateOrUpdatePWLWindow(pPageView));
}
diff --git a/fpdfsdk/formfiller/cffl_checkbox.h b/fpdfsdk/formfiller/cffl_checkbox.h
index e7bb1c6..86a77f5 100644
--- a/fpdfsdk/formfiller/cffl_checkbox.h
+++ b/fpdfsdk/formfiller/cffl_checkbox.h
@@ -35,8 +35,8 @@
void SaveData(const CPDFSDK_PageView* pPageView) override;
private:
- CPWL_CheckBox* GetCheckBox(const CPDFSDK_PageView* pPageView) const;
- CPWL_CheckBox* CreateOrUpdateCheckBox(const CPDFSDK_PageView* pPageView);
+ CPWL_CheckBox* GetPWLCheckBox(const CPDFSDK_PageView* pPageView) const;
+ CPWL_CheckBox* CreateOrUpdatePWLCheckBox(const CPDFSDK_PageView* pPageView);
};
#endif // FPDFSDK_FORMFILLER_CFFL_CHECKBOX_H_
diff --git a/fpdfsdk/formfiller/cffl_combobox.cpp b/fpdfsdk/formfiller/cffl_combobox.cpp
index 1b432e2..9f0d881 100644
--- a/fpdfsdk/formfiller/cffl_combobox.cpp
+++ b/fpdfsdk/formfiller/cffl_combobox.cpp
@@ -71,7 +71,7 @@
}
bool CFFL_ComboBox::IsDataChanged(const CPDFSDK_PageView* pPageView) {
- auto* pWnd = GetComboBox(pPageView);
+ auto* pWnd = GetPWLComboBox(pPageView);
if (!pWnd)
return false;
@@ -86,7 +86,7 @@
}
void CFFL_ComboBox::SaveData(const CPDFSDK_PageView* pPageView) {
- CPWL_ComboBox* pWnd = GetComboBox(pPageView);
+ CPWL_ComboBox* pWnd = GetPWLComboBox(pPageView);
if (!pWnd)
return;
@@ -120,7 +120,7 @@
CFFL_FieldAction& fa) {
switch (type) {
case CPDF_AAction::kKeyStroke:
- if (CPWL_ComboBox* pComboBox = GetComboBox(pPageView)) {
+ if (CPWL_ComboBox* pComboBox = GetPWLComboBox(pPageView)) {
if (CPWL_Edit* pEdit = pComboBox->GetEdit()) {
fa.bFieldFull = pEdit->IsTextFull();
std::tie(fa.nSelStart, fa.nSelEnd) = pEdit->GetSelection();
@@ -135,7 +135,7 @@
}
break;
case CPDF_AAction::kValidate:
- if (CPWL_ComboBox* pComboBox = GetComboBox(pPageView)) {
+ if (CPWL_ComboBox* pComboBox = GetPWLComboBox(pPageView)) {
if (CPWL_Edit* pEdit = pComboBox->GetEdit()) {
fa.sValue = pEdit->GetText();
}
@@ -155,7 +155,7 @@
const CFFL_FieldAction& fa) {
switch (type) {
case CPDF_AAction::kKeyStroke:
- if (CPWL_ComboBox* pComboBox = GetComboBox(pPageView)) {
+ if (CPWL_ComboBox* pComboBox = GetPWLComboBox(pPageView)) {
if (CPWL_Edit* pEdit = pComboBox->GetEdit()) {
pEdit->SetSelection(fa.nSelStart, fa.nSelEnd);
pEdit->ReplaceSelection(fa.sChange);
@@ -168,7 +168,7 @@
}
void CFFL_ComboBox::SavePWLWindowState(const CPDFSDK_PageView* pPageView) {
- CPWL_ComboBox* pComboBox = GetComboBox(pPageView);
+ CPWL_ComboBox* pComboBox = GetPWLComboBox(pPageView);
if (!pComboBox)
return;
@@ -184,7 +184,7 @@
void CFFL_ComboBox::RecreatePWLWindowFromSavedState(
const CPDFSDK_PageView* pPageView) {
- CPWL_ComboBox* pComboBox = CreateOrUpdateComboBox(pPageView);
+ CPWL_ComboBox* pComboBox = CreateOrUpdatePWLComboBox(pPageView);
if (!pComboBox)
return;
@@ -208,7 +208,7 @@
if (index < 0 || index >= m_pWidget->CountOptions())
return false;
- CPWL_ComboBox* pWnd = GetComboBox(GetCurPageView());
+ CPWL_ComboBox* pWnd = GetPWLComboBox(GetCurPageView());
if (!pWnd)
return false;
@@ -223,13 +223,13 @@
if (index < 0 || index >= m_pWidget->CountOptions())
return false;
- CPWL_ComboBox* pWnd = GetComboBox(GetCurPageView());
+ CPWL_ComboBox* pWnd = GetPWLComboBox(GetCurPageView());
return pWnd && index == pWnd->GetSelect();
}
#ifdef PDF_ENABLE_XFA
bool CFFL_ComboBox::IsFieldFull(const CPDFSDK_PageView* pPageView) {
- CPWL_ComboBox* pComboBox = GetComboBox(pPageView);
+ CPWL_ComboBox* pComboBox = GetPWLComboBox(pPageView);
if (!pComboBox)
return false;
@@ -252,7 +252,7 @@
WideString CFFL_ComboBox::GetSelectExportText() {
WideString swRet;
- CPWL_ComboBox* pComboBox = GetComboBox(GetCurPageView());
+ CPWL_ComboBox* pComboBox = GetPWLComboBox(GetCurPageView());
int nExport = pComboBox ? pComboBox->GetSelect() : -1;
if (nExport >= 0) {
@@ -266,12 +266,12 @@
return swRet;
}
-CPWL_ComboBox* CFFL_ComboBox::GetComboBox(
+CPWL_ComboBox* CFFL_ComboBox::GetPWLComboBox(
const CPDFSDK_PageView* pPageView) const {
return static_cast<CPWL_ComboBox*>(GetPWLWindow(pPageView));
}
-CPWL_ComboBox* CFFL_ComboBox::CreateOrUpdateComboBox(
+CPWL_ComboBox* CFFL_ComboBox::CreateOrUpdatePWLComboBox(
const CPDFSDK_PageView* pPageView) {
return static_cast<CPWL_ComboBox*>(CreateOrUpdatePWLWindow(pPageView));
}
diff --git a/fpdfsdk/formfiller/cffl_combobox.h b/fpdfsdk/formfiller/cffl_combobox.h
index 3d74621..9cfcd3f 100644
--- a/fpdfsdk/formfiller/cffl_combobox.h
+++ b/fpdfsdk/formfiller/cffl_combobox.h
@@ -58,8 +58,8 @@
private:
WideString GetSelectExportText();
- CPWL_ComboBox* GetComboBox(const CPDFSDK_PageView* pPageView) const;
- CPWL_ComboBox* CreateOrUpdateComboBox(const CPDFSDK_PageView* pPageView);
+ CPWL_ComboBox* GetPWLComboBox(const CPDFSDK_PageView* pPageView) const;
+ CPWL_ComboBox* CreateOrUpdatePWLComboBox(const CPDFSDK_PageView* pPageView);
FFL_ComboBoxState m_State;
};
diff --git a/fpdfsdk/formfiller/cffl_listbox.cpp b/fpdfsdk/formfiller/cffl_listbox.cpp
index 6e99e9d..3f8f810 100644
--- a/fpdfsdk/formfiller/cffl_listbox.cpp
+++ b/fpdfsdk/formfiller/cffl_listbox.cpp
@@ -85,7 +85,7 @@
}
bool CFFL_ListBox::IsDataChanged(const CPDFSDK_PageView* pPageView) {
- CPWL_ListBox* pListBox = GetListBox(pPageView);
+ CPWL_ListBox* pListBox = GetPWLListBox(pPageView);
if (!pListBox)
return false;
@@ -106,7 +106,7 @@
}
void CFFL_ListBox::SaveData(const CPDFSDK_PageView* pPageView) {
- CPWL_ListBox* pListBox = GetListBox(pPageView);
+ CPWL_ListBox* pListBox = GetPWLListBox(pPageView);
if (!pListBox)
return;
@@ -145,7 +145,7 @@
if (m_pWidget->GetFieldFlags() & pdfium::form_flags::kChoiceMultiSelect) {
fa.sValue.clear();
} else {
- CPWL_ListBox* pListBox = GetListBox(pPageView);
+ CPWL_ListBox* pListBox = GetPWLListBox(pPageView);
if (pListBox) {
int32_t nCurSel = pListBox->GetCurSel();
if (nCurSel >= 0)
@@ -169,7 +169,7 @@
}
void CFFL_ListBox::SavePWLWindowState(const CPDFSDK_PageView* pPageView) {
- CPWL_ListBox* pListBox = GetListBox(pPageView);
+ CPWL_ListBox* pListBox = GetPWLListBox(pPageView);
if (!pListBox)
return;
@@ -181,7 +181,7 @@
void CFFL_ListBox::RecreatePWLWindowFromSavedState(
const CPDFSDK_PageView* pPageView) {
- CPWL_ListBox* pListBox = CreateOrUpdateListBox(pPageView);
+ CPWL_ListBox* pListBox = CreateOrUpdatePWLListBox(pPageView);
if (!pListBox)
return;
@@ -196,7 +196,7 @@
if (index < 0 || index >= m_pWidget->CountOptions())
return false;
- CPWL_ListBox* pListBox = GetListBox(GetCurPageView());
+ CPWL_ListBox* pListBox = GetPWLListBox(GetCurPageView());
if (!pListBox)
return false;
@@ -218,16 +218,16 @@
if (index < 0 || index >= m_pWidget->CountOptions())
return false;
- CPWL_ListBox* pListBox = GetListBox(GetCurPageView());
+ CPWL_ListBox* pListBox = GetPWLListBox(GetCurPageView());
return pListBox && pListBox->IsItemSelected(index);
}
-CPWL_ListBox* CFFL_ListBox::GetListBox(
+CPWL_ListBox* CFFL_ListBox::GetPWLListBox(
const CPDFSDK_PageView* pPageView) const {
return static_cast<CPWL_ListBox*>(GetPWLWindow(pPageView));
}
-CPWL_ListBox* CFFL_ListBox::CreateOrUpdateListBox(
+CPWL_ListBox* CFFL_ListBox::CreateOrUpdatePWLListBox(
const CPDFSDK_PageView* pPageView) {
return static_cast<CPWL_ListBox*>(CreateOrUpdatePWLWindow(pPageView));
}
diff --git a/fpdfsdk/formfiller/cffl_listbox.h b/fpdfsdk/formfiller/cffl_listbox.h
index 7d8ebc9..487606c 100644
--- a/fpdfsdk/formfiller/cffl_listbox.h
+++ b/fpdfsdk/formfiller/cffl_listbox.h
@@ -41,8 +41,8 @@
bool IsIndexSelected(int index) override;
private:
- CPWL_ListBox* GetListBox(const CPDFSDK_PageView* pPageView) const;
- CPWL_ListBox* CreateOrUpdateListBox(const CPDFSDK_PageView* pPageView);
+ CPWL_ListBox* GetPWLListBox(const CPDFSDK_PageView* pPageView) const;
+ CPWL_ListBox* CreateOrUpdatePWLListBox(const CPDFSDK_PageView* pPageView);
std::set<int> m_OriginSelections;
std::vector<int> m_State;
diff --git a/fpdfsdk/formfiller/cffl_radiobutton.cpp b/fpdfsdk/formfiller/cffl_radiobutton.cpp
index 55f0ca4..66f826f 100644
--- a/fpdfsdk/formfiller/cffl_radiobutton.cpp
+++ b/fpdfsdk/formfiller/cffl_radiobutton.cpp
@@ -60,7 +60,7 @@
}
CFFL_FormField::OnChar(pAnnot, nChar, nFlags);
- CPWL_RadioButton* pWnd = CreateOrUpdateRadioButton(pPageView);
+ CPWL_RadioButton* pWnd = CreateOrUpdatePWLRadioButton(pPageView);
if (pWnd && !pWnd->IsReadOnly())
pWnd->SetCheck(true);
return CommitData(pPageView, nFlags);
@@ -79,7 +79,7 @@
if (!IsValid())
return true;
- CPWL_RadioButton* pWnd = CreateOrUpdateRadioButton(pPageView);
+ CPWL_RadioButton* pWnd = CreateOrUpdatePWLRadioButton(pPageView);
if (pWnd)
pWnd->SetCheck(true);
@@ -87,12 +87,12 @@
}
bool CFFL_RadioButton::IsDataChanged(const CPDFSDK_PageView* pPageView) {
- CPWL_RadioButton* pWnd = GetRadioButton(pPageView);
+ CPWL_RadioButton* pWnd = GetPWLRadioButton(pPageView);
return pWnd && pWnd->IsChecked() != m_pWidget->IsChecked();
}
void CFFL_RadioButton::SaveData(const CPDFSDK_PageView* pPageView) {
- CPWL_RadioButton* pWnd = GetRadioButton(pPageView);
+ CPWL_RadioButton* pWnd = GetPWLRadioButton(pPageView);
if (!pWnd)
return;
@@ -119,12 +119,12 @@
SetChangeMark();
}
-CPWL_RadioButton* CFFL_RadioButton::GetRadioButton(
+CPWL_RadioButton* CFFL_RadioButton::GetPWLRadioButton(
const CPDFSDK_PageView* pPageView) const {
return static_cast<CPWL_RadioButton*>(GetPWLWindow(pPageView));
}
-CPWL_RadioButton* CFFL_RadioButton::CreateOrUpdateRadioButton(
+CPWL_RadioButton* CFFL_RadioButton::CreateOrUpdatePWLRadioButton(
const CPDFSDK_PageView* pPageView) {
return static_cast<CPWL_RadioButton*>(CreateOrUpdatePWLWindow(pPageView));
}
diff --git a/fpdfsdk/formfiller/cffl_radiobutton.h b/fpdfsdk/formfiller/cffl_radiobutton.h
index 847113c..323e121 100644
--- a/fpdfsdk/formfiller/cffl_radiobutton.h
+++ b/fpdfsdk/formfiller/cffl_radiobutton.h
@@ -35,8 +35,8 @@
void SaveData(const CPDFSDK_PageView* pPageView) override;
private:
- CPWL_RadioButton* GetRadioButton(const CPDFSDK_PageView* pPageView) const;
- CPWL_RadioButton* CreateOrUpdateRadioButton(
+ CPWL_RadioButton* GetPWLRadioButton(const CPDFSDK_PageView* pPageView) const;
+ CPWL_RadioButton* CreateOrUpdatePWLRadioButton(
const CPDFSDK_PageView* pPageView);
};
diff --git a/fpdfsdk/formfiller/cffl_textfield.cpp b/fpdfsdk/formfiller/cffl_textfield.cpp
index 7d6fa97..6c3f03e 100644
--- a/fpdfsdk/formfiller/cffl_textfield.cpp
+++ b/fpdfsdk/formfiller/cffl_textfield.cpp
@@ -144,12 +144,12 @@
}
bool CFFL_TextField::IsDataChanged(const CPDFSDK_PageView* pPageView) {
- CPWL_Edit* pEdit = GetEdit(pPageView);
+ CPWL_Edit* pEdit = GetPWLEdit(pPageView);
return pEdit && pEdit->GetText() != m_pWidget->GetValue();
}
void CFFL_TextField::SaveData(const CPDFSDK_PageView* pPageView) {
- CPWL_Edit* pWnd = GetEdit(pPageView);
+ CPWL_Edit* pWnd = GetPWLEdit(pPageView);
if (!pWnd)
return;
@@ -177,7 +177,7 @@
CFFL_FieldAction& fa) {
switch (type) {
case CPDF_AAction::kKeyStroke:
- if (CPWL_Edit* pWnd = GetEdit(pPageView)) {
+ if (CPWL_Edit* pWnd = GetPWLEdit(pPageView)) {
fa.bFieldFull = pWnd->IsTextFull();
fa.sValue = pWnd->GetText();
@@ -189,7 +189,7 @@
}
break;
case CPDF_AAction::kValidate:
- if (CPWL_Edit* pWnd = GetEdit(pPageView)) {
+ if (CPWL_Edit* pWnd = GetPWLEdit(pPageView)) {
fa.sValue = pWnd->GetText();
}
break;
@@ -207,7 +207,7 @@
const CFFL_FieldAction& fa) {
switch (type) {
case CPDF_AAction::kKeyStroke:
- if (CPWL_Edit* pEdit = GetEdit(pPageView)) {
+ if (CPWL_Edit* pEdit = GetPWLEdit(pPageView)) {
pEdit->SetFocus();
pEdit->SetSelection(fa.nSelStart, fa.nSelEnd);
pEdit->ReplaceSelection(fa.sChange);
@@ -219,7 +219,7 @@
}
void CFFL_TextField::SavePWLWindowState(const CPDFSDK_PageView* pPageView) {
- CPWL_Edit* pWnd = GetEdit(pPageView);
+ CPWL_Edit* pWnd = GetPWLEdit(pPageView);
if (!pWnd)
return;
@@ -229,7 +229,7 @@
void CFFL_TextField::RecreatePWLWindowFromSavedState(
const CPDFSDK_PageView* pPageView) {
- CPWL_Edit* pWnd = CreateOrUpdateEdit(pPageView);
+ CPWL_Edit* pWnd = CreateOrUpdatePWLEdit(pPageView);
if (!pWnd)
return;
@@ -239,7 +239,7 @@
#ifdef PDF_ENABLE_XFA
bool CFFL_TextField::IsFieldFull(const CPDFSDK_PageView* pPageView) {
- CPWL_Edit* pWnd = GetEdit(pPageView);
+ CPWL_Edit* pWnd = GetPWLEdit(pPageView);
return pWnd && pWnd->IsTextFull();
}
#endif // PDF_ENABLE_XFA
@@ -255,11 +255,11 @@
m_pFormFillEnv->OnSetFieldInputFocus(pBuffer, nCharacters, true);
}
-CPWL_Edit* CFFL_TextField::GetEdit(const CPDFSDK_PageView* pPageView) const {
+CPWL_Edit* CFFL_TextField::GetPWLEdit(const CPDFSDK_PageView* pPageView) const {
return static_cast<CPWL_Edit*>(GetPWLWindow(pPageView));
}
-CPWL_Edit* CFFL_TextField::CreateOrUpdateEdit(
+CPWL_Edit* CFFL_TextField::CreateOrUpdatePWLEdit(
const CPDFSDK_PageView* pPageView) {
return static_cast<CPWL_Edit*>(CreateOrUpdatePWLWindow(pPageView));
}
diff --git a/fpdfsdk/formfiller/cffl_textfield.h b/fpdfsdk/formfiller/cffl_textfield.h
index f8fd742..b0edc9a 100644
--- a/fpdfsdk/formfiller/cffl_textfield.h
+++ b/fpdfsdk/formfiller/cffl_textfield.h
@@ -53,8 +53,8 @@
void OnSetFocus(CPWL_Edit* pEdit) override;
private:
- CPWL_Edit* GetEdit(const CPDFSDK_PageView* pPageView) const;
- CPWL_Edit* CreateOrUpdateEdit(const CPDFSDK_PageView* pPageView);
+ CPWL_Edit* GetPWLEdit(const CPDFSDK_PageView* pPageView) const;
+ CPWL_Edit* CreateOrUpdatePWLEdit(const CPDFSDK_PageView* pPageView);
FFL_TextFieldState m_State;
};