summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2017-07-06 11:13:02 -0400
committerChromium commit bot <commit-bot@chromium.org>2017-07-06 19:11:27 +0000
commit5fe9808f03dc8164161d5b421f650af1d8547f53 (patch)
tree1a4d696df083350aef03bcf87b6f6ed94168e899
parent64667cd369e13529be606077429fe4524dba0b24 (diff)
downloadpdfium-5fe9808f03dc8164161d5b421f650af1d8547f53.tar.xz
Remove in-out from OnPopup{Pre|Post}Open
This CL removes the bExit param from OnPopup{Pre|Post}Open in favour of using a return value. Change-Id: Icc99b137455343482fc1f60947c3b1f4246aeda1 Reviewed-on: https://pdfium-review.googlesource.com/7332 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
-rw-r--r--fpdfsdk/formfiller/cffl_interactiveformfiller.cpp12
-rw-r--r--fpdfsdk/formfiller/cffl_interactiveformfiller.h6
-rw-r--r--fpdfsdk/pdfwindow/cpwl_combo_box.cpp34
-rw-r--r--fpdfsdk/pdfwindow/cpwl_edit.h8
4 files changed, 19 insertions, 41 deletions
diff --git a/fpdfsdk/formfiller/cffl_interactiveformfiller.cpp b/fpdfsdk/formfiller/cffl_interactiveformfiller.cpp
index 4d5ceb8d16..f5931d5a59 100644
--- a/fpdfsdk/formfiller/cffl_interactiveformfiller.cpp
+++ b/fpdfsdk/formfiller/cffl_interactiveformfiller.cpp
@@ -759,28 +759,24 @@ bool CFFL_InteractiveFormFiller::OnFull(CPDFSDK_Annot::ObservedPtr* pAnnot,
return true;
}
-void CFFL_InteractiveFormFiller::OnPopupPreOpen(void* pPrivateData,
- bool& bExit,
+bool CFFL_InteractiveFormFiller::OnPopupPreOpen(void* pPrivateData,
uint32_t nFlag) {
CFFL_PrivateData* pData = reinterpret_cast<CFFL_PrivateData*>(pPrivateData);
ASSERT(pData);
ASSERT(pData->pWidget);
CPDFSDK_Annot::ObservedPtr pObserved(pData->pWidget);
- if (OnPreOpen(&pObserved, pData->pPageView, nFlag) || !pObserved)
- bExit = true;
+ return OnPreOpen(&pObserved, pData->pPageView, nFlag) || !pObserved;
}
-void CFFL_InteractiveFormFiller::OnPopupPostOpen(void* pPrivateData,
- bool& bExit,
+bool CFFL_InteractiveFormFiller::OnPopupPostOpen(void* pPrivateData,
uint32_t nFlag) {
CFFL_PrivateData* pData = reinterpret_cast<CFFL_PrivateData*>(pPrivateData);
ASSERT(pData);
ASSERT(pData->pWidget);
CPDFSDK_Annot::ObservedPtr pObserved(pData->pWidget);
- if (OnPostOpen(&pObserved, pData->pPageView, nFlag) || !pObserved)
- bExit = true;
+ return OnPostOpen(&pObserved, pData->pPageView, nFlag) || !pObserved;
}
bool CFFL_InteractiveFormFiller::OnPreOpen(CPDFSDK_Annot::ObservedPtr* pAnnot,
diff --git a/fpdfsdk/formfiller/cffl_interactiveformfiller.h b/fpdfsdk/formfiller/cffl_interactiveformfiller.h
index 7be39f7137..de5aafd7e1 100644
--- a/fpdfsdk/formfiller/cffl_interactiveformfiller.h
+++ b/fpdfsdk/formfiller/cffl_interactiveformfiller.h
@@ -141,10 +141,8 @@ class CFFL_InteractiveFormFiller : public IPWL_Filler_Notify {
bool& bExit,
uint32_t nFlag) override;
#ifdef PDF_ENABLE_XFA
- void OnPopupPreOpen(void* pPrivateData, bool& bExit, uint32_t nFlag) override;
- void OnPopupPostOpen(void* pPrivateData,
- bool& bExit,
- uint32_t nFlag) override;
+ bool OnPopupPreOpen(void* pPrivateData, uint32_t nFlag) override;
+ bool OnPopupPostOpen(void* pPrivateData, uint32_t nFlag) override;
void SetFocusAnnotTab(CPDFSDK_Annot* pWidget, bool bSameField, bool bNext);
#endif // PDF_ENABLE_XFA
void UnRegisterFormFiller(CPDFSDK_Annot* pAnnot);
diff --git a/fpdfsdk/pdfwindow/cpwl_combo_box.cpp b/fpdfsdk/pdfwindow/cpwl_combo_box.cpp
index 660f8cd9d3..4427440bb8 100644
--- a/fpdfsdk/pdfwindow/cpwl_combo_box.cpp
+++ b/fpdfsdk/pdfwindow/cpwl_combo_box.cpp
@@ -427,9 +427,7 @@ void CPWL_ComboBox::SetPopup(bool bPopup) {
return;
#ifdef PDF_ENABLE_XFA
- bool bExit = false;
- m_pFillerNotify->OnPopupPreOpen(GetAttachedData(), bExit, 0);
- if (bExit)
+ if (m_pFillerNotify->OnPopupPreOpen(GetAttachedData(), 0))
return;
#endif // PDF_ENABLE_XFA
@@ -458,8 +456,7 @@ void CPWL_ComboBox::SetPopup(bool bPopup) {
Move(rcWindow, true, true);
#ifdef PDF_ENABLE_XFA
- bExit = false;
- m_pFillerNotify->OnPopupPostOpen(GetAttachedData(), bExit, 0);
+ m_pFillerNotify->OnPopupPostOpen(GetAttachedData(), 0);
#endif // PDF_ENABLE_XFA
}
@@ -474,18 +471,15 @@ bool CPWL_ComboBox::OnKeyDown(uint16_t nChar, uint32_t nFlag) {
switch (nChar) {
case FWL_VKEY_Up:
if (m_pList->GetCurSel() > 0) {
- bool bExit = false;
#ifdef PDF_ENABLE_XFA
if (m_pFillerNotify) {
- m_pFillerNotify->OnPopupPreOpen(GetAttachedData(), bExit, nFlag);
- if (bExit)
+ if (m_pFillerNotify->OnPopupPreOpen(GetAttachedData(), nFlag))
return false;
- bExit = false;
- m_pFillerNotify->OnPopupPostOpen(GetAttachedData(), bExit, nFlag);
- if (bExit)
+ if (m_pFillerNotify->OnPopupPostOpen(GetAttachedData(), nFlag))
return false;
}
#endif // PDF_ENABLE_XFA
+ bool bExit = false;
if (m_pList->OnKeyDownWithExit(nChar, bExit, nFlag)) {
if (bExit)
return false;
@@ -495,18 +489,15 @@ bool CPWL_ComboBox::OnKeyDown(uint16_t nChar, uint32_t nFlag) {
return true;
case FWL_VKEY_Down:
if (m_pList->GetCurSel() < m_pList->GetCount() - 1) {
- bool bExit = false;
#ifdef PDF_ENABLE_XFA
if (m_pFillerNotify) {
- m_pFillerNotify->OnPopupPreOpen(GetAttachedData(), bExit, nFlag);
- if (bExit)
+ if (m_pFillerNotify->OnPopupPreOpen(GetAttachedData(), nFlag))
return false;
- bExit = false;
- m_pFillerNotify->OnPopupPostOpen(GetAttachedData(), bExit, nFlag);
- if (bExit)
+ if (m_pFillerNotify->OnPopupPostOpen(GetAttachedData(), nFlag))
return false;
}
#endif // PDF_ENABLE_XFA
+ bool bExit = false;
if (m_pList->OnKeyDownWithExit(nChar, bExit, nFlag)) {
if (bExit)
return false;
@@ -533,18 +524,15 @@ bool CPWL_ComboBox::OnChar(uint16_t nChar, uint32_t nFlag) {
if (HasFlag(PCBS_ALLOWCUSTOMTEXT))
return m_pEdit->OnChar(nChar, nFlag);
- bool bExit = false;
#ifdef PDF_ENABLE_XFA
if (m_pFillerNotify) {
- m_pFillerNotify->OnPopupPreOpen(GetAttachedData(), bExit, nFlag);
- if (bExit)
+ if (m_pFillerNotify->OnPopupPreOpen(GetAttachedData(), nFlag))
return false;
-
- m_pFillerNotify->OnPopupPostOpen(GetAttachedData(), bExit, nFlag);
- if (bExit)
+ if (m_pFillerNotify->OnPopupPostOpen(GetAttachedData(), nFlag))
return false;
}
#endif // PDF_ENABLE_XFA
+ bool bExit = false;
return m_pList->OnCharWithExit(nChar, bExit, nFlag) ? bExit : false;
}
diff --git a/fpdfsdk/pdfwindow/cpwl_edit.h b/fpdfsdk/pdfwindow/cpwl_edit.h
index 8d549b5f6b..038aba955f 100644
--- a/fpdfsdk/pdfwindow/cpwl_edit.h
+++ b/fpdfsdk/pdfwindow/cpwl_edit.h
@@ -32,12 +32,8 @@ class IPWL_Filler_Notify {
bool& bExit,
uint32_t nFlag) = 0;
#ifdef PDF_ENABLE_XFA
- virtual void OnPopupPreOpen(void* pPrivateData,
- bool& bExit,
- uint32_t nFlag) = 0;
- virtual void OnPopupPostOpen(void* pPrivateData,
- bool& bExit,
- uint32_t nFlag) = 0;
+ virtual bool OnPopupPreOpen(void* pPrivateData, uint32_t nFlag) = 0;
+ virtual bool OnPopupPostOpen(void* pPrivateData, uint32_t nFlag) = 0;
#endif // PDF_ENABLE_XFA
};