diff options
author | Dan Sinclair <dsinclair@chromium.org> | 2017-11-20 21:19:13 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-11-20 21:19:13 +0000 |
commit | 2501ae2474c1f097a06634d647de2eb3fb730864 (patch) | |
tree | 3ac7d386a3e73f3c848c203c3f0e61af9d284c1f /xfa/fxfa/cxfa_ffcheckbutton.cpp | |
parent | 89453e92d5d0b7aaf9e0c3890a90a21adc94a0ce (diff) | |
download | pdfium-2501ae2474c1f097a06634d647de2eb3fb730864.tar.xz |
Remove CXFA_DataData operator bool override
This CL removes CXFA_DataData::operator bool in favour of an explicit
HasValidNode method. This makes the call sites a lot clearer.
Change-Id: I6fae14fdeec4674ca7916e21b9e5703070fc3069
Reviewed-on: https://pdfium-review.googlesource.com/18830
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Diffstat (limited to 'xfa/fxfa/cxfa_ffcheckbutton.cpp')
-rw-r--r-- | xfa/fxfa/cxfa_ffcheckbutton.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/xfa/fxfa/cxfa_ffcheckbutton.cpp b/xfa/fxfa/cxfa_ffcheckbutton.cpp index a9d47d17bb..7d82fc6e9f 100644 --- a/xfa/fxfa/cxfa_ffcheckbutton.cpp +++ b/xfa/fxfa/cxfa_ffcheckbutton.cpp @@ -93,13 +93,13 @@ bool CXFA_FFCheckButton::PerformLayout() { float fCheckSize = m_pDataAcc->GetCheckButtonSize(); CXFA_MarginData marginData = m_pDataAcc->GetMarginData(); CFX_RectF rtWidget = GetRectWithoutRotate(); - if (marginData) + if (marginData.HasValidNode()) XFA_RectWidthoutMargin(rtWidget, marginData); int32_t iCapPlacement = -1; float fCapReserve = 0; CXFA_CaptionData captionData = m_pDataAcc->GetCaptionData(); - if (captionData && captionData.GetPresence()) { + if (captionData.HasValidNode() && captionData.GetPresence()) { m_rtCaption = rtWidget; iCapPlacement = captionData.GetPlacementType(); fCapReserve = captionData.GetReserve(); @@ -115,7 +115,8 @@ bool CXFA_FFCheckButton::PerformLayout() { int32_t iHorzAlign = XFA_ATTRIBUTEENUM_Left; int32_t iVertAlign = XFA_ATTRIBUTEENUM_Top; - if (CXFA_ParaData paraData = m_pDataAcc->GetParaData()) { + CXFA_ParaData paraData = m_pDataAcc->GetParaData(); + if (paraData.HasValidNode()) { iHorzAlign = paraData.GetHorizontalAlign(); iVertAlign = paraData.GetVerticalAlign(); } @@ -173,9 +174,9 @@ bool CXFA_FFCheckButton::PerformLayout() { AddUIMargin(iCapPlacement); m_rtCheckBox = m_rtUI; CXFA_BorderData borderUIData = m_pDataAcc->GetUIBorderData(); - if (borderUIData) { + if (borderUIData.HasValidNode()) { CXFA_MarginData borderMarginData = borderUIData.GetMarginData(); - if (borderMarginData) + if (borderMarginData.HasValidNode()) XFA_RectWidthoutMargin(m_rtUI, borderMarginData); } |