summaryrefslogtreecommitdiff
path: root/core/fpdfdoc/cpdf_formfield.cpp
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2017-10-05 11:40:33 -0400
committerChromium commit bot <commit-bot@chromium.org>2017-10-05 17:12:50 +0000
commit59454e1d00d37e9ec6b9341605d1e181e8dbec80 (patch)
tree32e4aefe15e3a25d6c7e6c68ee7dbe54591766a6 /core/fpdfdoc/cpdf_formfield.cpp
parent3862d24efe5ca45f29e4404e674f3152f492cb01 (diff)
downloadpdfium-59454e1d00d37e9ec6b9341605d1e181e8dbec80.tar.xz
Remove friends from form code
This CL removes the friends from CPDF_FormControl and CPDF_InterForm and adds accessors and moves methods to public as needed. Change-Id: I9d18c9158b1499ca935964b5f9dbd937f0806163 Reviewed-on: https://pdfium-review.googlesource.com/15533 Reviewed-by: Ryan Harrison <rharrison@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'core/fpdfdoc/cpdf_formfield.cpp')
-rw-r--r--core/fpdfdoc/cpdf_formfield.cpp44
1 files changed, 22 insertions, 22 deletions
diff --git a/core/fpdfdoc/cpdf_formfield.cpp b/core/fpdfdoc/cpdf_formfield.cpp
index fec1945956..637cb9eece 100644
--- a/core/fpdfdoc/cpdf_formfield.cpp
+++ b/core/fpdfdoc/cpdf_formfield.cpp
@@ -174,8 +174,8 @@ bool CPDF_FormField::ResetField(bool bNotify) {
CheckControl(i, GetControl(i)->IsDefaultChecked(), false);
}
}
- if (bNotify && m_pForm->m_pFormNotify)
- m_pForm->m_pFormNotify->AfterCheckedStatusChange(this);
+ if (bNotify && m_pForm->GetFormNotify())
+ m_pForm->GetFormNotify()->AfterCheckedStatusChange(this);
break;
}
case CPDF_FormField::ComboBox:
@@ -408,7 +408,7 @@ int CPDF_FormField::GetMaxLen() const {
for (auto& pControl : m_ControlList) {
if (!pControl)
continue;
- CPDF_Dictionary* pWidgetDict = pControl->m_pWidgetDict.Get();
+ CPDF_Dictionary* pWidgetDict = pControl->GetWidget();
if (pWidgetDict->KeyExist("MaxLen"))
return pWidgetDict->GetIntegerFor("MaxLen");
}
@@ -467,7 +467,7 @@ int CPDF_FormField::GetSelectedIndex(int index) const {
}
bool CPDF_FormField::ClearSelection(bool bNotify) {
- if (bNotify && m_pForm->m_pFormNotify) {
+ if (bNotify && m_pForm->GetFormNotify()) {
WideString csValue;
int iIndex = GetSelectedIndex(0);
if (iIndex >= 0)
@@ -680,7 +680,7 @@ int CPDF_FormField::InsertOption(WideString csOptLabel,
}
bool CPDF_FormField::ClearOptions(bool bNotify) {
- if (bNotify && m_pForm->m_pFormNotify) {
+ if (bNotify && m_pForm->GetFormNotify()) {
WideString csValue;
int iIndex = GetSelectedIndex(0);
if (iIndex >= 0)
@@ -753,8 +753,8 @@ bool CPDF_FormField::CheckControl(int iControlIndex,
csIndex.Format("%d", iControlIndex);
m_pDict->SetNewFor<CPDF_Name>("V", csIndex);
}
- if (bNotify && m_pForm->m_pFormNotify)
- m_pForm->m_pFormNotify->AfterCheckedStatusChange(this);
+ if (bNotify && m_pForm->GetFormNotify())
+ m_pForm->GetFormNotify()->AfterCheckedStatusChange(this);
return true;
}
@@ -788,8 +788,8 @@ bool CPDF_FormField::SetCheckValue(const WideString& value,
if (val)
break;
}
- if (bNotify && m_pForm->m_pFormNotify)
- m_pForm->m_pFormNotify->AfterCheckedStatusChange(this);
+ if (bNotify && m_pForm->GetFormNotify())
+ m_pForm->GetFormNotify()->AfterCheckedStatusChange(this);
return true;
}
@@ -842,7 +842,7 @@ bool CPDF_FormField::SelectOption(int iOptIndex, bool bSelected, bool bNotify) {
if (bSelected)
return true;
- if (bNotify && m_pForm->m_pFormNotify) {
+ if (bNotify && m_pForm->GetFormNotify()) {
WideString csValue = GetOptionLabel(iOptIndex);
if (!NotifyListOrComboBoxBeforeChange(csValue))
return false;
@@ -856,7 +856,7 @@ bool CPDF_FormField::SelectOption(int iOptIndex, bool bSelected, bool bNotify) {
if (!bSelected)
continue;
- if (bNotify && m_pForm->m_pFormNotify) {
+ if (bNotify && m_pForm->GetFormNotify()) {
WideString csValue = GetOptionLabel(iOptIndex);
if (!NotifyListOrComboBoxBeforeChange(csValue))
return false;
@@ -880,7 +880,7 @@ bool CPDF_FormField::SelectOption(int iOptIndex, bool bSelected, bool bNotify) {
}
bool CPDF_FormField::ClearSelectedOptions(bool bNotify) {
- if (bNotify && m_pForm->m_pFormNotify) {
+ if (bNotify && m_pForm->GetFormNotify()) {
WideString csValue;
int iIndex = GetSelectedIndex(0);
if (iIndex >= 0)
@@ -897,7 +897,7 @@ bool CPDF_FormField::ClearSelectedOptions(bool bNotify) {
}
void CPDF_FormField::LoadDA() {
- CPDF_Dictionary* pFormDict = m_pForm->m_pFormDict.Get();
+ CPDF_Dictionary* pFormDict = m_pForm->GetFormDict();
if (!pFormDict)
return;
@@ -926,32 +926,32 @@ void CPDF_FormField::LoadDA() {
if (!pFontDict)
return;
- m_pFont = m_pForm->m_pDocument->LoadFont(pFontDict);
+ m_pFont = m_pForm->GetDocument()->LoadFont(pFontDict);
m_FontSize = FX_atof(syntax.GetWord());
}
bool CPDF_FormField::NotifyBeforeSelectionChange(const WideString& value) {
- if (!m_pForm->m_pFormNotify)
+ if (!m_pForm->GetFormNotify())
return true;
- return m_pForm->m_pFormNotify->BeforeSelectionChange(this, value) >= 0;
+ return m_pForm->GetFormNotify()->BeforeSelectionChange(this, value) >= 0;
}
void CPDF_FormField::NotifyAfterSelectionChange() {
- if (!m_pForm->m_pFormNotify)
+ if (!m_pForm->GetFormNotify())
return;
- m_pForm->m_pFormNotify->AfterSelectionChange(this);
+ m_pForm->GetFormNotify()->AfterSelectionChange(this);
}
bool CPDF_FormField::NotifyBeforeValueChange(const WideString& value) {
- if (!m_pForm->m_pFormNotify)
+ if (!m_pForm->GetFormNotify())
return true;
- return m_pForm->m_pFormNotify->BeforeValueChange(this, value) >= 0;
+ return m_pForm->GetFormNotify()->BeforeValueChange(this, value) >= 0;
}
void CPDF_FormField::NotifyAfterValueChange() {
- if (!m_pForm->m_pFormNotify)
+ if (!m_pForm->GetFormNotify())
return;
- m_pForm->m_pFormNotify->AfterValueChange(this);
+ m_pForm->GetFormNotify()->AfterValueChange(this);
}
bool CPDF_FormField::NotifyListOrComboBoxBeforeChange(const WideString& value) {