diff options
author | thestig <thestig@chromium.org> | 2016-05-26 22:00:29 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-05-26 22:00:29 -0700 |
commit | 800222e01e3fcdd57536fc987e773677829dd708 (patch) | |
tree | 2c7e62ba05fa9855de3090dbab6f61169055372b /xfa/fxfa/app/xfa_ffcheckbutton.cpp | |
parent | befa4506dc9d2a679c526aff96c09bcb0e9daecb (diff) | |
download | pdfium-800222e01e3fcdd57536fc987e773677829dd708.tar.xz |
Fix MSVC C4800 build warnings.
TBR=weili@chromium.org
Review-Url: https://codereview.chromium.org/2017863002
Diffstat (limited to 'xfa/fxfa/app/xfa_ffcheckbutton.cpp')
-rw-r--r-- | xfa/fxfa/app/xfa_ffcheckbutton.cpp | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/xfa/fxfa/app/xfa_ffcheckbutton.cpp b/xfa/fxfa/app/xfa_ffcheckbutton.cpp index 80a4e92bda..9e174a286e 100644 --- a/xfa/fxfa/app/xfa_ffcheckbutton.cpp +++ b/xfa/fxfa/app/xfa_ffcheckbutton.cpp @@ -239,12 +239,9 @@ void CXFA_FFCheckButton::RenderWidget(CFX_Graphics* pGS, FX_BOOL CXFA_FFCheckButton::OnLButtonUp(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) { - if (!m_pNormalWidget) { - return FALSE; - } - if (!IsButtonDown()) { + if (!m_pNormalWidget || !IsButtonDown()) return FALSE; - } + SetButtonDown(FALSE); CFWL_MsgMouse ms; ms.m_dwCmd = FWL_MouseCommand::LeftButtonUp; @@ -256,21 +253,22 @@ FX_BOOL CXFA_FFCheckButton::OnLButtonUp(uint32_t dwFlags, TranslateFWLMessage(&ms); return TRUE; } + XFA_CHECKSTATE CXFA_FFCheckButton::FWLState2XFAState() { - XFA_CHECKSTATE eCheckState = XFA_CHECKSTATE_Off; uint32_t dwState = m_pNormalWidget->GetStates(); - if (dwState & FWL_STATE_CKB_Checked) { - eCheckState = XFA_CHECKSTATE_On; - } else if (dwState & FWL_STATE_CKB_Neutral) { - eCheckState = XFA_CHECKSTATE_Neutral; - } - return eCheckState; + if (dwState & FWL_STATE_CKB_Checked) + return XFA_CHECKSTATE_On; + if (dwState & FWL_STATE_CKB_Neutral) + return XFA_CHECKSTATE_Neutral; + return XFA_CHECKSTATE_Off; } + FX_BOOL CXFA_FFCheckButton::CommitData() { XFA_CHECKSTATE eCheckState = FWLState2XFAState(); - m_pDataAcc->SetCheckState(eCheckState, TRUE); + m_pDataAcc->SetCheckState(eCheckState, true); return TRUE; } + FX_BOOL CXFA_FFCheckButton::IsDataChanged() { XFA_CHECKSTATE eCheckState = FWLState2XFAState(); return m_pDataAcc->GetCheckState() != eCheckState; |