diff options
author | Nico Weber <thakis@chromium.org> | 2015-08-04 13:00:21 -0700 |
---|---|---|
committer | Nico Weber <thakis@chromium.org> | 2015-08-04 13:00:21 -0700 |
commit | 9d8ec5a6e37e8d1d4d4edca9040de234e2d4728f (patch) | |
tree | c97037f398d714665aefccb6eb54d0969ad7030c /fpdfsdk/src/formfiller/FFL_RadioButton.cpp | |
parent | 780cee82236d1b3b0f9b01a22424e4b8ec9a6f12 (diff) | |
download | pdfium-9d8ec5a6e37e8d1d4d4edca9040de234e2d4728f.tar.xz |
XFA: clang-format all pdfium code.
No behavior change.
Generated by:
find . -name '*.cpp' -o -name '*.h' | \
grep -E -v 'third_party|thirdparties|lpng_v163|tiff_v403' | \
xargs ../../buildtools/mac/clang-format -i
Then manually merged https://codereview.chromium.org/1269223002/
See thread "tabs vs spaces" on pdfium@googlegroups.com for discussion.
BUG=none
Diffstat (limited to 'fpdfsdk/src/formfiller/FFL_RadioButton.cpp')
-rw-r--r-- | fpdfsdk/src/formfiller/FFL_RadioButton.cpp | 205 |
1 files changed, 100 insertions, 105 deletions
diff --git a/fpdfsdk/src/formfiller/FFL_RadioButton.cpp b/fpdfsdk/src/formfiller/FFL_RadioButton.cpp index 1f73e8ccaa..7c4f9a9e49 100644 --- a/fpdfsdk/src/formfiller/FFL_RadioButton.cpp +++ b/fpdfsdk/src/formfiller/FFL_RadioButton.cpp @@ -9,129 +9,124 @@ #include "../../include/formfiller/FFL_RadioButton.h" //#include "../include/FFL_Undo.h" -/* ------------------------------- CFFL_RadioButton ------------------------------- */ +/* ------------------------------- CFFL_RadioButton + * ------------------------------- */ -CFFL_RadioButton::CFFL_RadioButton(CPDFDoc_Environment* pApp, CPDFSDK_Annot* pWidget) : - CFFL_Button(pApp, pWidget) -{ -} +CFFL_RadioButton::CFFL_RadioButton(CPDFDoc_Environment* pApp, + CPDFSDK_Annot* pWidget) + : CFFL_Button(pApp, pWidget) {} -CFFL_RadioButton::~CFFL_RadioButton() -{ -} +CFFL_RadioButton::~CFFL_RadioButton() {} -CPWL_Wnd* CFFL_RadioButton::NewPDFWindow(const PWL_CREATEPARAM& cp, CPDFSDK_PageView* pPageView) -{ - CPWL_RadioButton* pWnd = new CPWL_RadioButton(); - pWnd->Create(cp); +CPWL_Wnd* CFFL_RadioButton::NewPDFWindow(const PWL_CREATEPARAM& cp, + CPDFSDK_PageView* pPageView) { + CPWL_RadioButton* pWnd = new CPWL_RadioButton(); + pWnd->Create(cp); - ASSERT(m_pWidget != NULL); - pWnd->SetCheck(m_pWidget->IsChecked()); + ASSERT(m_pWidget != NULL); + pWnd->SetCheck(m_pWidget->IsChecked()); - return pWnd; + return pWnd; } -FX_BOOL CFFL_RadioButton::OnKeyDown(CPDFSDK_Annot* pAnnot, FX_UINT nKeyCode, FX_UINT nFlags) -{ - switch (nKeyCode) - { - case FWL_VKEY_Return: - case FWL_VKEY_Space: - return TRUE; - default: - return CFFL_FormFiller::OnKeyDown(pAnnot, nKeyCode, nFlags); - } +FX_BOOL CFFL_RadioButton::OnKeyDown(CPDFSDK_Annot* pAnnot, + FX_UINT nKeyCode, + FX_UINT nFlags) { + switch (nKeyCode) { + case FWL_VKEY_Return: + case FWL_VKEY_Space: + return TRUE; + default: + return CFFL_FormFiller::OnKeyDown(pAnnot, nKeyCode, nFlags); + } } -FX_BOOL CFFL_RadioButton::OnChar(CPDFSDK_Annot* pAnnot, FX_UINT nChar, FX_UINT nFlags) -{ - switch (nChar) - { - case FWL_VKEY_Return: - case FWL_VKEY_Space: - { - CFFL_IFormFiller* pIFormFiller = m_pApp->GetIFormFiller(); - ASSERT(pIFormFiller != NULL); - - CPDFSDK_PageView* pPageView = pAnnot->GetPageView(); - ASSERT(pPageView != NULL); - - FX_BOOL bReset = FALSE; - FX_BOOL bExit = FALSE; - - pIFormFiller->OnButtonUp(m_pWidget, pPageView, bReset, bExit,nFlags); - - if (bReset) return TRUE; - if (bExit) return TRUE; - - CFFL_FormFiller::OnChar(pAnnot, nChar, nFlags); - - if (CPWL_RadioButton * pWnd = (CPWL_RadioButton*)GetPDFWindow(pPageView, TRUE)) - pWnd->SetCheck(TRUE); - CommitData(pPageView,nFlags); - return TRUE; - } - default: - return CFFL_FormFiller::OnChar(pAnnot, nChar, nFlags); - } +FX_BOOL CFFL_RadioButton::OnChar(CPDFSDK_Annot* pAnnot, + FX_UINT nChar, + FX_UINT nFlags) { + switch (nChar) { + case FWL_VKEY_Return: + case FWL_VKEY_Space: { + CFFL_IFormFiller* pIFormFiller = m_pApp->GetIFormFiller(); + ASSERT(pIFormFiller != NULL); + + CPDFSDK_PageView* pPageView = pAnnot->GetPageView(); + ASSERT(pPageView != NULL); + + FX_BOOL bReset = FALSE; + FX_BOOL bExit = FALSE; + + pIFormFiller->OnButtonUp(m_pWidget, pPageView, bReset, bExit, nFlags); + + if (bReset) + return TRUE; + if (bExit) + return TRUE; + + CFFL_FormFiller::OnChar(pAnnot, nChar, nFlags); + + if (CPWL_RadioButton* pWnd = + (CPWL_RadioButton*)GetPDFWindow(pPageView, TRUE)) + pWnd->SetCheck(TRUE); + CommitData(pPageView, nFlags); + return TRUE; + } + default: + return CFFL_FormFiller::OnChar(pAnnot, nChar, nFlags); + } } -FX_BOOL CFFL_RadioButton::OnLButtonUp(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point) -{ - CFFL_Button::OnLButtonUp(pPageView, pAnnot, nFlags, point); +FX_BOOL CFFL_RadioButton::OnLButtonUp(CPDFSDK_PageView* pPageView, + CPDFSDK_Annot* pAnnot, + FX_UINT nFlags, + const CPDF_Point& point) { + CFFL_Button::OnLButtonUp(pPageView, pAnnot, nFlags, point); - if (IsValid()) - { - if (CPWL_RadioButton * pWnd = (CPWL_RadioButton*)GetPDFWindow(pPageView, TRUE)) - pWnd->SetCheck(TRUE); + if (IsValid()) { + if (CPWL_RadioButton* pWnd = + (CPWL_RadioButton*)GetPDFWindow(pPageView, TRUE)) + pWnd->SetCheck(TRUE); - if (!CommitData(pPageView,nFlags)) return FALSE; - } + if (!CommitData(pPageView, nFlags)) + return FALSE; + } - return TRUE; + return TRUE; } -FX_BOOL CFFL_RadioButton::IsDataChanged(CPDFSDK_PageView* pPageView) -{ - ASSERT(m_pWidget != NULL); +FX_BOOL CFFL_RadioButton::IsDataChanged(CPDFSDK_PageView* pPageView) { + ASSERT(m_pWidget != NULL); - if (CPWL_RadioButton* pWnd = (CPWL_RadioButton*)GetPDFWindow(pPageView, FALSE)) - { - return pWnd->IsChecked() != m_pWidget->IsChecked(); - } + if (CPWL_RadioButton* pWnd = + (CPWL_RadioButton*)GetPDFWindow(pPageView, FALSE)) { + return pWnd->IsChecked() != m_pWidget->IsChecked(); + } - return FALSE; + return FALSE; } -void CFFL_RadioButton::SaveData(CPDFSDK_PageView* pPageView) -{ - ASSERT(m_pWidget != NULL); - - if (CPWL_RadioButton* pWnd = (CPWL_RadioButton*)GetPDFWindow(pPageView, FALSE)) - { - - FX_BOOL bNewChecked = pWnd->IsChecked(); - - if (bNewChecked) - { - CPDF_FormField* pField = m_pWidget->GetFormField(); - ASSERT(pField != NULL); - - for (int32_t i=0,sz=pField->CountControls(); i<sz; i++) - { - if (CPDF_FormControl* pCtrl = pField->GetControl(i)) - { - if (pCtrl->IsChecked()) - { - break; - } - } - } - } - - m_pWidget->SetCheck(bNewChecked, FALSE); - m_pWidget->UpdateField(); - SetChangeMark(); - } +void CFFL_RadioButton::SaveData(CPDFSDK_PageView* pPageView) { + ASSERT(m_pWidget != NULL); + + if (CPWL_RadioButton* pWnd = + (CPWL_RadioButton*)GetPDFWindow(pPageView, FALSE)) { + FX_BOOL bNewChecked = pWnd->IsChecked(); + + if (bNewChecked) { + CPDF_FormField* pField = m_pWidget->GetFormField(); + ASSERT(pField != NULL); + + for (int32_t i = 0, sz = pField->CountControls(); i < sz; i++) { + if (CPDF_FormControl* pCtrl = pField->GetControl(i)) { + if (pCtrl->IsChecked()) { + break; + } + } + } + } + + m_pWidget->SetCheck(bNewChecked, FALSE); + m_pWidget->UpdateField(); + SetChangeMark(); + } } - |